From 480e38ae01c769b21722b6381d3212074c151d73 Mon Sep 17 00:00:00 2001 From: MakhamDev Date: Sun, 1 Oct 2023 11:17:39 +0700 Subject: [PATCH] Computer migration. Bug fixes. --- PixelComposer.yyp | 2 +- objects/o_dialog_file_name_collection/Draw_64.gml | 3 +-- scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml | 2 ++ scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml | 7 +++++-- scripts/addon_lua/addon_lua.gml | 2 +- scripts/buttonPalette/buttonPalette.gml | 4 ++-- scripts/collection_data/collection_data.gml | 3 --- scripts/gif_reader/gif_reader.gml | 2 +- scripts/globals/globals.gml | 6 +++--- scripts/node_VFX_spawner/node_VFX_spawner.gml | 1 - scripts/node_data/node_data.gml | 7 ++++++- scripts/node_image_gif/node_image_gif.gml | 1 - scripts/node_pin/node_pin.gml | 4 ++-- scripts/node_rigid_object/node_rigid_object.gml | 4 +--- scripts/panel_animation/panel_animation.gml | 4 +++- scripts/panel_collection/panel_collection.gml | 2 +- scripts/save_function/save_function.gml | 2 +- 17 files changed, 30 insertions(+), 26 deletions(-) diff --git a/PixelComposer.yyp b/PixelComposer.yyp index b9ea07491..f09e2a2d5 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -744,7 +744,7 @@ "isEcma": false, "LibraryEmitters": [], "MetaData": { - "IDEVersion": "2023.8.0.98", + "IDEVersion": "2023.8.1.102", }, "resources": [ {"id":{"name":"s_node_corner","path":"sprites/s_node_corner/s_node_corner.yy",},}, diff --git a/objects/o_dialog_file_name_collection/Draw_64.gml b/objects/o_dialog_file_name_collection/Draw_64.gml index 08a574f42..22fc7dcb9 100644 --- a/objects/o_dialog_file_name_collection/Draw_64.gml +++ b/objects/o_dialog_file_name_collection/Draw_64.gml @@ -30,9 +30,8 @@ var txt = __txtx("new_collection_create", "Create collection"); var icon = THEME.accept; var clr = COLORS._main_value_positive; - if(updating != noone) { + if(updating != noone) txt = __txtx("new_collection_update", "Update collection"); - } if(ugc == 1) { txt = __txtx("panel_inspector_workshop_upload", "Upload to Steam Workshop"); diff --git a/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml b/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml index c93888303..ff0b793f6 100644 --- a/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml +++ b/scripts/BBMOD_DualQuaternion/BBMOD_DualQuaternion.gml @@ -1,3 +1,5 @@ +// feather ignore all + /// @func BBMOD_DualQuaternion([_x, _y, _z, _w, _dx, _dy, _dz, _dw]) /// /// @desc A dual quaternion. diff --git a/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml b/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml index b8dbbd291..8333b4946 100644 --- a/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml +++ b/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml @@ -1,3 +1,5 @@ +// feather ignore all + /// @func BBMOD_Quaternion([_x, _y, _z, _w]) /// /// @desc A quaternion. @@ -410,10 +412,11 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor static Normalize = function () { gml_pragma("forceinline"); var _lengthSqr = LengthSqr(); + if(_lengthSqr == 0) + return new BBMOD_Quaternion(); + if (_lengthSqr >= math_get_epsilon()) - { return Scale(1.0 / sqrt(_lengthSqr)); - } return Clone(); }; diff --git a/scripts/addon_lua/addon_lua.gml b/scripts/addon_lua/addon_lua.gml index 011f45830..25c63c15c 100644 --- a/scripts/addon_lua/addon_lua.gml +++ b/scripts/addon_lua/addon_lua.gml @@ -1007,7 +1007,7 @@ end", with(_addon_custom) if(self.ID == ID) _addon = self; if(_addon == noone) return noone; - var wd = new button(onModify).setText(txt); + var wd = button(onModify).setText(txt); wd.setLua(_addon.thread, onModify, function() { return lua_call(lua_thread, lua_thread_key); }); diff --git a/scripts/buttonPalette/buttonPalette.gml b/scripts/buttonPalette/buttonPalette.gml index 233ce2e64..4e51918cf 100644 --- a/scripts/buttonPalette/buttonPalette.gml +++ b/scripts/buttonPalette/buttonPalette.gml @@ -1,7 +1,7 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { onApply = _onApply; parentDialog = dialog; - current_palette = noone; + current_palette = []; function apply(value) { if(!interactable) return; @@ -42,7 +42,7 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { h = _h; } - if(!is_array(current_palette) || is_array(current_palette[0])) + if(!is_array(current_palette) || array_empty(current_palette) || is_array(current_palette[0])) return 0; var hoverRect = point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + h); diff --git a/scripts/collection_data/collection_data.gml b/scripts/collection_data/collection_data.gml index 6d7d93302..3c429ddbc 100644 --- a/scripts/collection_data/collection_data.gml +++ b/scripts/collection_data/collection_data.gml @@ -29,9 +29,6 @@ function refreshCollections() { } function searchCollection(_list, _search_str, _clear_list = true) { - //if(_clear_list) - // ds_list_clear(_list); - if(_search_str == "") return; var search_lower = string_lower(_search_str); diff --git a/scripts/gif_reader/gif_reader.gml b/scripts/gif_reader/gif_reader.gml index df519937b..0bc7235f6 100644 --- a/scripts/gif_reader/gif_reader.gml +++ b/scripts/gif_reader/gif_reader.gml @@ -1055,7 +1055,7 @@ function gif_std_enum_getIndex() { static readUInt16 = method(undefined, haxe_io_Input_readUInt16); static readBytes = method(undefined, haxe_io_Input_readBytes); static readString = method(undefined, haxe_io_Input_readString); - if (_sourcePos == undefined) _sourcePos = 0; + _sourcePos ??= 0; if (false) throw argument[2]; method(self, haxe_io_Input_new)(); if (_sourceLen == undefined) _sourceLen = array_length(_sourceBytes.b) - _sourcePos; diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index d5e8334b6..f9b2a64df 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -105,10 +105,10 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; - VERSION = 11530; + VERSION = 11531; SAVE_VERSION = 11530; - VERSION_STRING = "1.15.3.0"; - BUILD_NUMBER = 11530; + VERSION_STRING = "1.15.3.1"; + BUILD_NUMBER = 11531; globalvar APPEND_MAP; APPEND_MAP = ds_map_create(); diff --git a/scripts/node_VFX_spawner/node_VFX_spawner.gml b/scripts/node_VFX_spawner/node_VFX_spawner.gml index 12bc2eb79..62392df5c 100644 --- a/scripts/node_VFX_spawner/node_VFX_spawner.gml +++ b/scripts/node_VFX_spawner/node_VFX_spawner.gml @@ -105,6 +105,5 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y var ss = min((w - 8) / surface_get_width_safe(spr), (h - 8) / surface_get_height_safe(spr)) * _s; draw_surface_align(spr, cx, cy, ss, fa_center, fa_center); } #endregion - } \ No newline at end of file diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index fd6787ced..11756f85a 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -49,6 +49,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x name = ""; display_name = ""; internalName = ""; + onSetDisplayName = noone; + renamed = false; tooltip = ""; x = _x; @@ -251,8 +253,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x h = max(min_h, (preview_surface && previewable)? 128 : 0, _hi, _ho); } #endregion - onSetDisplayName = noone; static setDisplayName = function(_name) { #region + renamed = true; display_name = _name; internalName = string_replace_all(display_name, " ", "_"); refreshNodeMap(); @@ -1376,6 +1378,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x array_push(_trigger, inspectInput2.serialize(scale, preset)); array_push(_trigger, updatedTrigger.serialize(scale, preset)); _map.inspectInputs = _trigger; + _map.renamed = renamed; doSerialize(_map); processSerialize(_map); @@ -1432,6 +1435,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x triggerRender(); } + + renamed = struct_try_get(load_map, "renamed", false); } #endregion static inputBalance = function() { #region //Cross version compatibility for dynamic input nodes diff --git a/scripts/node_image_gif/node_image_gif.gml b/scripts/node_image_gif/node_image_gif.gml index 70bb4e649..e72be1ce2 100644 --- a/scripts/node_image_gif/node_image_gif.gml +++ b/scripts/node_image_gif/node_image_gif.gml @@ -109,7 +109,6 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct spr = spr_builder._spr; triggerRender(); loading = 0; - delete spr_builder; gc_collect(); } diff --git a/scripts/node_pin/node_pin.gml b/scripts/node_pin/node_pin.gml index eb91988ef..04a09b83c 100644 --- a/scripts/node_pin/node_pin.gml +++ b/scripts/node_pin/node_pin.gml @@ -65,7 +65,7 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { if(hov != noone) jun = hov.connect_type == JUNCTION_CONNECT.input? outputs[| 0] : inputs[| 0]; else jun = inputs[| 0].value_from == noone? inputs[| 0] : outputs[| 0]; - if(jun.drawJunction(_s, _mx, _my,)) + if(jun.drawJunction(_s, _mx, _my)) hover = jun; } @@ -85,7 +85,7 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { active_draw_index = -1; } - if(display_name != "") { + if(renamed && display_name != "" && display_name != "Pin") { draw_set_text(f_p0, fa_center, fa_bottom, COLORS._main_text); draw_text_transformed(xx, yy - 12, display_name, _s, _s, 0); } diff --git a/scripts/node_rigid_object/node_rigid_object.gml b/scripts/node_rigid_object/node_rigid_object.gml index 2daa81b93..80cab9323 100644 --- a/scripts/node_rigid_object/node_rigid_object.gml +++ b/scripts/node_rigid_object/node_rigid_object.gml @@ -2,7 +2,6 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr name = "Object"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - //update_on_frame = true; w = 96; min_h = 96; @@ -29,8 +28,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Box", "Circle", "Custom" ]) .rejectArray(); - inputs[| 6] = nodeValue("Texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone) - .rejectArray(); + inputs[| 6] = nodeValue("Texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); inputs[| 7] = nodeValue("Start shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 16, 16, 4, 4, AREA_SHAPE.rectangle ]) .setDisplay(VALUE_DISPLAY.area); diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index a292ea237..d5fd8922c 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -1884,9 +1884,11 @@ function Panel_Animation() : PanelContent() constructor { for( var i = 0, n = array_length(keyframe_selecting); i < n; i++ ) { var cl = keyframe_selecting[i].cloneAnimator(,, false); if(cl == noone) continue; - array_append(clones, cl); + array_push(clones, cl); } + if(array_empty(clones)) return; + keyframe_selecting = clones; keyframe_dragging = keyframe_selecting[0]; keyframe_drag_type = KEYFRAME_DRAG_TYPE.move; diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index bf06128e7..dc525cea6 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -219,7 +219,7 @@ function Panel_Collection() : PanelContent() constructor { draw_sprite_ui_uniform(THEME.group, 0, _boxx + grid_size / 2, yy + grid_size / 2, 1, c_white); if(meta != noone && mode == 0) { - if(meta.steam) { + if(struct_try_get(meta, "steam")) { draw_sprite_ui_uniform(THEME.steam, 0, _boxx + ui(12), yy + ui(12), 1, COLORS._main_icon_dark, 1); if(meta.author_steam_id == STEAM_USER_ID) { draw_sprite_ui_uniform(THEME.steam_creator, 0, _boxx + grid_size - ui(8), yy + ui(12), 1, COLORS._main_icon_dark, 1); diff --git a/scripts/save_function/save_function.gml b/scripts/save_function/save_function.gml index 5898542f8..c148d3298 100644 --- a/scripts/save_function/save_function.gml +++ b/scripts/save_function/save_function.gml @@ -173,7 +173,7 @@ function SAVE_COLLECTION(_node, _path, save_surface = true, metadata = noone, co if(save_surface) { var preview_surface = PANEL_PREVIEW.getNodePreviewSurface(); if(is_surface(preview_surface)) { - var icon_path = string_copy(_path, 1, string_length(_path) - 5) + ".png"; + var icon_path = string_replace(_path, filename_ext(_path), "") + ".png"; surface_save_safe(preview_surface, icon_path); } }