diff --git a/datafiles/data/themes/default.zip b/datafiles/data/themes/default.zip index 2e41d0720..3b32e0e4f 100644 Binary files a/datafiles/data/themes/default.zip and b/datafiles/data/themes/default.zip differ diff --git a/objects/o_crash_handler/Create_0.gml b/objects/o_crash_handler/Create_0.gml index d2a33a1d3..e9e205bb5 100644 --- a/objects/o_crash_handler/Create_0.gml +++ b/objects/o_crash_handler/Create_0.gml @@ -40,7 +40,7 @@ gameframe_button_array = []; path = DIRECTORY + "log/crash_log.txt"; if(!file_exists(path)) game_end(1); - crash_content = file_text_read_all(path); + crash_content = file_read_all(path); log_surface = surface_create(1, 1); log_y = 0; log_y_to = 0; diff --git a/objects/o_dialog_assetbox/Create_0.gml b/objects/o_dialog_assetbox/Create_0.gml index 1f277c2f5..b921a5366 100644 --- a/objects/o_dialog_assetbox/Create_0.gml +++ b/objects/o_dialog_assetbox/Create_0.gml @@ -64,11 +64,8 @@ event_inherited(); for(var i = 0; i < ds_list_size(global.ASSETS.subDir); i++) { var _w = folderPane.surface_w - ui(16); var _hover = sHOVER && folderPane.hover; - var _clr = { - selecting : COLORS.assetbox_current_bg - } - var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, _w, _hover, sFOCUS, global.ASSETS, _clr); + var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, _w, _hover, sFOCUS, global.ASSETS); hh += hg; _y += hg; } diff --git a/objects/o_dialog_assetbox/Draw_64.gml b/objects/o_dialog_assetbox/Draw_64.gml index 4332fb409..99a52ae46 100644 --- a/objects/o_dialog_assetbox/Draw_64.gml +++ b/objects/o_dialog_assetbox/Draw_64.gml @@ -20,8 +20,8 @@ draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text); draw_text(dialog_x + ui(16), dialog_y + ui(16), __txt("Assets")); - draw_sprite_stretched(THEME.ui_panel_inner_bg, 0, dialog_x + ui(16), dialog_y + ui(48), folderW - ui(24), dialog_h - ui(64)); - draw_sprite_stretched(THEME.ui_panel_inner_bg, 0, dialog_x + ui(12) + folderW, dialog_y + ui(16), dialog_w - ui(28) - folderW, dialog_h - ui(32)); + draw_sprite_stretched(THEME.ui_panel_bg, 1, dialog_x + ui(16), dialog_y + ui(48), folderW - ui(24), dialog_h - ui(64)); + draw_sprite_stretched(THEME.ui_panel_bg, 1, dialog_x + ui(12) + folderW, dialog_y + ui(16), dialog_w - ui(28) - folderW, dialog_h - ui(32)); var dx0 = dialog_x + ui(16) + folderW - ui(8); var dx1 = dialog_x + ui(16) + folderW; diff --git a/scripts/__VFX/__VFX.gml b/scripts/__VFX/__VFX.gml index 3ad084134..52e594f0c 100644 --- a/scripts/__VFX/__VFX.gml +++ b/scripts/__VFX/__VFX.gml @@ -275,7 +275,7 @@ function __part(_node) constructor { ss = surf[ind]; break; } - } else if(arr_type == 3) ss = ss[_index]; + } else if(arr_type == 3) ss = array_safe_get(ss, _index); var surface = is_instanceof(ss, SurfaceAtlas)? ss.getSurface() : node.surface_cache[$ ss]; @@ -320,6 +320,12 @@ function __part(_node) constructor { return [x, y]; } #endregion + + static clone = function() { #region + var _p = new __part(node); + struct_override(_p, self); + return _p; + } #endregion } #region helper diff --git a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml index b4290bb5c..44494a177 100644 --- a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml +++ b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml @@ -68,7 +68,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co .rejectArray(); inputs[| 22] = nodeValue("Surface array", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "Whether to select image from an array in order, at random, or treat array as animation." ) - .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Random", "Order", "Animation", "Array" ]) + .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Random", "Order", "Animation" ]) .setVisible(false); inputs[| 23] = nodeValue("Animation speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ] ) diff --git a/scripts/directory_object/directory_object.gml b/scripts/directory_object/directory_object.gml index 956e605a5..ec9fd4220 100644 --- a/scripts/directory_object/directory_object.gml +++ b/scripts/directory_object/directory_object.gml @@ -212,10 +212,8 @@ function DirectoryObject(name, path) constructor { } } - if(ds_list_empty(subDir)) - draw_sprite_ui_uniform(THEME.folder_content, parent.context == self, _x + ui(16), _y + hg / 2 - 1, 1, COLORS.collection_folder_empty); - else - draw_sprite_ui_uniform(THEME.folder_content, open, _x + ui(16), _y + hg / 2 - 1, 1, COLORS.collection_folder_nonempty); + if(ds_list_empty(subDir)) draw_sprite_ui_uniform(THEME.folder_content, parent.context == self, _x + ui(16), _y + hg / 2 - 1, 1, COLORS.collection_folder_empty); + else draw_sprite_ui_uniform(THEME.folder_content, open, _x + ui(16), _y + hg / 2 - 1, 1, COLORS.collection_folder_nonempty); draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner); draw_text(_x + ui(32), _y + hg / 2, name); diff --git a/scripts/font_loader/font_loader.gml b/scripts/font_loader/font_loader.gml index 214fdb56a..7976140f1 100644 --- a/scripts/font_loader/font_loader.gml +++ b/scripts/font_loader/font_loader.gml @@ -98,7 +98,7 @@ function loadFonts() { return; } - var s = file_text_read_all(path); + var s = file_read_all(path); var fontDef = json_try_parse(s); f_h1 = _font_load_from_struct(fontDef, "h1", _f_h1); diff --git a/scripts/json_file/json_file.gml b/scripts/json_file/json_file.gml index 962357221..fb64bf453 100644 --- a/scripts/json_file/json_file.gml +++ b/scripts/json_file/json_file.gml @@ -1,20 +1,28 @@ function json_encode_minify(map) { + gml_pragma("forceinline"); + return json_minify(json_encode(map)); } function json_stringify_minify(map) { + gml_pragma("forceinline"); + return json_minify(json_stringify(map)); } function json_load(path) { + gml_pragma("forceinline"); + if(!file_exists(path)) return noone; - var s = file_text_read_all(path); + var s = file_read_all(path); var js = json_decode(s); return js; } function json_save(path, map) { + gml_pragma("forceinline"); + var s = json_encode_minify(map); var f = file_text_open_write(path); @@ -23,14 +31,18 @@ function json_save(path, map) { } function json_load_struct(path) { + gml_pragma("forceinline"); + if(!file_exists(path)) return noone; - var s = file_text_read_all(path); + var s = file_read_all(path); var js = json_try_parse(s); return js; } function json_save_struct(path, struct, pretty = false) { + gml_pragma("forceinline"); + var s; if(pretty) diff --git a/scripts/load_function/load_function.gml b/scripts/load_function/load_function.gml index 25733b961..d0fb3d4ce 100644 --- a/scripts/load_function/load_function.gml +++ b/scripts/load_function/load_function.gml @@ -80,7 +80,6 @@ function __LOAD_PATH(path, readonly = false, override = false) { if(file_exists(temp_file_path)) file_delete(temp_file_path); file_copy(path, temp_file_path); - //ALWAYS_FULL = false; PROJECT.readonly = readonly; SET_PATH(PROJECT, path); diff --git a/scripts/node_VFX_override/node_VFX_override.gml b/scripts/node_VFX_override/node_VFX_override.gml index 99973a718..d3be39993 100644 --- a/scripts/node_VFX_override/node_VFX_override.gml +++ b/scripts/node_VFX_override/node_VFX_override.gml @@ -40,33 +40,44 @@ function Node_VFX_Override(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _alp = getInputData(5); var _srf = getInputData(6); + var nParts = array_create(array_length(parts)); + + var _a_pos = is_array(_pos); + var _a_sca = is_array(_sca); + var _a_rot = is_array(_rot); + var _a_col = is_array(_col); + var _a_alp = is_array(_alp); + var _a_srf = is_array(_srf); + + var _l_pos = array_length(_pos); + var _l_sca = array_length(_sca); + var _l_rot = array_length(_rot); + var _l_col = array_length(_col); + var _l_alp = array_length(_alp); + var _l_srf = array_length(_srf); + for( var i = 0, n = array_length(parts); i < n; i++ ) { - var part = parts[i]; + var nPart = parts[i].clone(); - if(is_array(_pos) && array_length(_pos) > i && is_array(_pos[i])) { - part.x = _pos[i][0]; - part.y = _pos[i][1]; + if(_a_pos && _l_pos > i && is_array(_pos[i])) { + nPart.x = _pos[i][0]; + nPart.y = _pos[i][1]; } - if(is_array(_sca) && array_length(_sca) > i && is_array(_sca[i])) { - part.scx = _sca[i][0]; - part.scy = _sca[i][1]; + if(_a_sca && _l_sca > i && is_array(_sca[i])) { + nPart.scx = _sca[i][0]; + nPart.scy = _sca[i][1]; } - if(is_array(_rot) && array_length(_rot) > i ) - part.rot = array_safe_get(_rot, i); + if(_a_rot && _l_rot > i) nPart.rot = array_safe_get(_rot, i); + if(_a_col && _l_col > i) nPart.blend = array_safe_get(_col, i); + if(_a_alp && _l_alp > i) nPart.alp = array_safe_get(_alp, i); + if(_a_srf && _l_srf > i) nPart.surf = array_safe_get(_srf, i); - if(is_array(_col) && array_length(_col) > i ) - part.blend = array_safe_get(_col, i); - - if(is_array(_alp) && array_length(_alp) > i ) - part.alp = array_safe_get(_alp, i); - - if(is_array(_srf) && array_length(_srf) > i ) - part.surf = array_safe_get(_srf, i); + nParts[i] = nPart; } - outputs[| 0].setValue(parts); + outputs[| 0].setValue(nParts); } static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { diff --git a/scripts/node_particle/node_particle.gml b/scripts/node_particle/node_particle.gml index 557bccc16..2ba64b602 100644 --- a/scripts/node_particle/node_particle.gml +++ b/scripts/node_particle/node_particle.gml @@ -5,6 +5,8 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _ onSurfaceSize = function() { return getInputData(input_len, DEF_SURF); }; inputs[| 3].setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); + inputs[| 22].setDisplay(VALUE_DISPLAY.enum_scroll, [ "Random", "Order", "Animation", "Array" ]); + inputs[| input_len + 0] = nodeValue("Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF) .setDisplay(VALUE_DISPLAY.vector); diff --git a/scripts/node_text_file_read/node_text_file_read.gml b/scripts/node_text_file_read/node_text_file_read.gml index 3e92840b9..b5e56eeff 100644 --- a/scripts/node_text_file_read/node_text_file_read.gml +++ b/scripts/node_text_file_read/node_text_file_read.gml @@ -73,7 +73,7 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons case ".txt": outputs[| 1].setValue(path); - content = file_text_read_all(path); + content = file_read_all(path); if(path_current == "") first_update = true; diff --git a/scripts/sprite_loader/sprite_loader.gml b/scripts/sprite_loader/sprite_loader.gml index 94a5f4985..d05c4c0d0 100644 --- a/scripts/sprite_loader/sprite_loader.gml +++ b/scripts/sprite_loader/sprite_loader.gml @@ -48,7 +48,7 @@ function __getGraphicList() { INLINE var path = _sprite_path("./graphics.json", "default"); - var s = file_text_read_all(path); + var s = file_read_all(path); return json_try_parse(s); } @@ -71,7 +71,7 @@ function loadGraphic(theme = "default") { return; } - var s = file_text_read_all(path); + var s = file_read_all(path); var graphics = variable_struct_get_names(sprDef); var sprStr = json_try_parse(s); var str; diff --git a/scripts/text_file/text_file.gml b/scripts/text_file/text_file.gml index 22334c2d9..d91cdff49 100644 --- a/scripts/text_file/text_file.gml +++ b/scripts/text_file/text_file.gml @@ -1,13 +1,15 @@ -function file_text_read_all(path) { +function file_read_all(path) { + gml_pragma("forceinline"); + var f = file_text_open_read(path); - var s = ""; - while(!file_text_eof(f)) - s += string(file_text_readln(f)); + var s = file_text_read_all(f); file_text_close(f); return s; } function file_text_read_all_lines(path) { + gml_pragma("forceinline"); + var f = file_text_open_read(path); var s = []; while(!file_text_eof(f)) @@ -17,6 +19,8 @@ function file_text_read_all_lines(path) { } function file_text_write_all(path, str) { + gml_pragma("forceinline"); + if(file_exists(path)) file_delete(path); var f = file_text_open_write(path);