diff --git a/objects/o_dialog_gradient/Draw_64.gml b/objects/o_dialog_gradient/Draw_64.gml index c5bc3b5f1..a44201683 100644 --- a/objects/o_dialog_gradient/Draw_64.gml +++ b/objects/o_dialog_gradient/Draw_64.gml @@ -73,9 +73,8 @@ if !ready exit; bx -= ui(32); if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, "Open gradient folder", THEME.folder) == 2) { - var _realpath = environment_get_variable("LOCALAPPDATA") + "/Pixels_Composer/Gradients"; - var _windir = environment_get_variable("WINDIR") + "/explorer.exe"; - execute_shell(_windir, _realpath); + var _realpath = DIRECTORY + "Gradients"; + shellOpenExplorer(_realpath) } bx -= ui(32); #endregion diff --git a/objects/o_dialog_palette/Draw_64.gml b/objects/o_dialog_palette/Draw_64.gml index 02d8c7ddd..ed9a7e5f8 100644 --- a/objects/o_dialog_palette/Draw_64.gml +++ b/objects/o_dialog_palette/Draw_64.gml @@ -66,9 +66,8 @@ if palette == 0 exit; bx -= ui(32); if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("color_selector_open_palette", "Open palette folder"), THEME.folder) == 2) { - var _realpath = environment_get_variable("LOCALAPPDATA") + "/Pixels_Composer/Palettes"; - var _windir = environment_get_variable("WINDIR") + "/explorer.exe"; - execute_shell(_windir, _realpath); + var _realpath = DIRECTORY + "Palettes"; + shellOpenExplorer(_realpath) } draw_sprite_ui_uniform(THEME.folder, 0, bx + ui(14), by + ui(14), 1, COLORS._main_icon); bx -= ui(32); diff --git a/scripts/array_functions/array_functions.gml b/scripts/array_functions/array_functions.gml index 019e63be6..33e800e71 100644 --- a/scripts/array_functions/array_functions.gml +++ b/scripts/array_functions/array_functions.gml @@ -37,6 +37,11 @@ function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) return arr[index]; } +function array_push_create(arr, val) { + if(!is_array(arr)) return [ val ]; + array_push(arr, val); + return arr; +} function array_exists(arr, val) { for( var i = 0; i < array_length(arr); i++ ) { diff --git a/scripts/gradients_function/gradients_function.gml b/scripts/gradients_function/gradients_function.gml index 1f16d4600..5dabb3a01 100644 --- a/scripts/gradients_function/gradients_function.gml +++ b/scripts/gradients_function/gradients_function.gml @@ -172,12 +172,12 @@ function loadGradient(path) { var _t = file_text_open_read(path); while(!file_text_eof(_t)) { - var key = file_text_readln(_t); + var key = string_trim(file_text_readln(_t)); var _col = 0, _pos = 0; if(string_pos(",", key)) { var keys = string_splice(key, ","); - if(array_length(keys) != 2) continue; + if(array_length(keys) < 2) continue; _col = toNumber(keys[0]); _pos = toNumber(keys[1]); @@ -190,5 +190,6 @@ function loadGradient(path) { array_push(grad.keys, new gradientKey(_pos, _col)); } file_text_close(_t); + return grad; } \ No newline at end of file diff --git a/scripts/load_palette/load_palette.gml b/scripts/load_palette/load_palette.gml index ef27e7511..a4b395594 100644 --- a/scripts/load_palette/load_palette.gml +++ b/scripts/load_palette/load_palette.gml @@ -21,7 +21,7 @@ function loadPalette(path) { if(string_char_at(_w, 1) == "#") break; var _c = string_splice(_w, " "); if(array_length(_c) >= 3) - pal[_index++] = make_color_rgb(toString(_c[0]), toString(_c[1]), toString(_c[2])); + pal[_index++] = make_color_rgb(toNumber(_c[0]), toNumber(_c[1]), toNumber(_c[2])); break; } } diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 833c5b4bd..056f8fe28 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -330,7 +330,7 @@ function Panel_Collection() : PanelContent() constructor { } function refreshContext() { - context.scan([".json", ".pxcc"]); + context.scan([ ".json", ".pxcc", ".png", ".jpg", ".gif" ]); if(STEAM_ENABLED) steamUCGload();