From 47480f65171b2dd862ba619be0bffc31b9e40ffc Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Mon, 31 Jul 2023 20:06:44 +0200 Subject: [PATCH] 1.15rc1 --- .../o_dialog_textbox_autocomplete/Draw_64.gml | 1 + .../Draw_64.gml | 1 + objects/o_main/Create_0.gml | 2 +- .../_node_VFX_spawner/_node_VFX_spawner.gml | 6 +- scripts/globals/globals.gml | 6 +- scripts/node_particle/node_particle.gml | 2 +- scripts/node_path/node_path.gml | 13 +++- .../node_path_builder/node_path_builder.gml | 77 +++++++++++++++++++ scripts/node_path_shift/node_path_shift.gml | 2 +- 9 files changed, 99 insertions(+), 11 deletions(-) diff --git a/objects/o_dialog_textbox_autocomplete/Draw_64.gml b/objects/o_dialog_textbox_autocomplete/Draw_64.gml index 758998ffc..b7bc1c7ea 100644 --- a/objects/o_dialog_textbox_autocomplete/Draw_64.gml +++ b/objects/o_dialog_textbox_autocomplete/Draw_64.gml @@ -1,6 +1,7 @@ /// @description if(!active) exit; if(textbox == noone) exit; +if(textbox != WIDGET_CURRENT) exit; #region dialog_x = clamp(dialog_x, 0, WIN_W - dialog_w - 1); diff --git a/objects/o_dialog_textbox_function_guide/Draw_64.gml b/objects/o_dialog_textbox_function_guide/Draw_64.gml index 832df705f..d78a3a259 100644 --- a/objects/o_dialog_textbox_function_guide/Draw_64.gml +++ b/objects/o_dialog_textbox_function_guide/Draw_64.gml @@ -1,6 +1,7 @@ /// @description if(!active) exit; if(textbox == noone) exit; +if(textbox != WIDGET_CURRENT) exit; #region draw_set_text(f_code, fa_left, fa_top, COLORS._main_text); diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index becfa0fd0..57dd90a28 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -299,5 +299,5 @@ #endregion #region debug - instance_create_depth(0, 0, 0, addon_key_displayer); + //instance_create_depth(0, 0, 0, addon_key_displayer); #endregion \ No newline at end of file diff --git a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml index a497e0cc1..f0c2ffe05 100644 --- a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml +++ b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml @@ -380,9 +380,9 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co render(_time); } - static step = function() {} + static onStep = function() {} - static inspectorStep = function() { + static step = function() { var _inSurf = inputs[| 0].getValue(); var _dist = inputs[| 4].getValue(); var _scatt = inputs[| 24].getValue(); @@ -404,6 +404,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co inputs[| 26].setVisible(true); } } + + onStep(); } static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index d5f5f47d2..24acbe375 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -92,10 +92,10 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; - VERSION = 11472; - SAVE_VERSION = 11470; + VERSION = 11481; + SAVE_VERSION = 11480; VERSION_STRING = "1.15rc1"; - BUILD_NUMBER = 11472; + BUILD_NUMBER = 11481; globalvar APPEND_MAP; APPEND_MAP = ds_map_create(); diff --git a/scripts/node_particle/node_particle.gml b/scripts/node_particle/node_particle.gml index e12c36a3c..6b90c17da 100644 --- a/scripts/node_particle/node_particle.gml +++ b/scripts/node_particle/node_particle.gml @@ -42,7 +42,7 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _ PROJECT.animator.setFrame(-1); } - static step = function() { + static onStep = function() { var _dim = inputs[| input_len + 0].getValue(); var _outSurf = outputs[| 0].getValue(); diff --git a/scripts/node_path/node_path.gml b/scripts/node_path/node_path.gml index 301ae49a0..afbf9a049 100644 --- a/scripts/node_path/node_path.gml +++ b/scripts/node_path/node_path.gml @@ -594,7 +594,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { ind++; } - + var anchor_hover = -1; var hover_type = 0; @@ -957,10 +957,17 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { var _rat = inputs[| 0].getValue(); var _typ = inputs[| 2].getValue(); + var _rnd = inputs[| 3].getValue(); var anchors = []; - for(var i = input_fix_len; i < ds_list_size(inputs); i++) - array_push(anchors, inputs[| i].getValue()); + for(var i = input_fix_len; i < ds_list_size(inputs); i++) { + var _anc = inputs[| i].getValue(); + if(_rnd) { + _anc[0] = round(_anc[0]); + _anc[1] = round(_anc[2]); + } + array_push(anchors, _anc); + } outputs[| 2].setValue(anchors); if(is_array(_rat)) { diff --git a/scripts/node_path_builder/node_path_builder.gml b/scripts/node_path_builder/node_path_builder.gml index f292fec2f..8a0800de8 100644 --- a/scripts/node_path_builder/node_path_builder.gml +++ b/scripts/node_path_builder/node_path_builder.gml @@ -3,6 +3,8 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr previewable = false; w = 96; + length = 0; + lengthAcc = []; inputs[| 0] = nodeValue("Point array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) .setVisible(true, true) @@ -12,6 +14,33 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self); + static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { + var _lines = inputs[| 0].getValue(); + var _conn = inputs[| 1].getValue(); + + draw_set_color(COLORS._main_accent); + + if(_conn) { + for( var i = 1, n = array_length(_lines); i < n; i++ ) { + var p0 = _lines[i - 1]; + var p1 = _lines[i - 0]; + + draw_line(_x + p0[0] * _s, _y + p0[1] * _s, + _x + p1[0] * _s, _y + p1[1] * _s); + } + } else { + var len = floor(array_length(_lines) / 2) * 2; + + for( var i = 0; i < len; i += 2 ) { + var p0 = _lines[i + 0]; + var p1 = _lines[i + 1]; + + draw_line(_x + p0[0] * _s, _y + p0[1] * _s, + _x + p1[0] * _s, _y + p1[1] * _s); + } + } + } + static getLineCount = function() { var _lines = inputs[| 0].getValue(); var _conn = inputs[| 1].getValue(); @@ -19,6 +48,17 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr return _conn? 1 : floor(array_length(_lines) / 2); } + static getSegmentCount = function() { + var _lines = inputs[| 0].getValue(); + var _conn = inputs[| 1].getValue(); + + return _conn? array_length(_lines) - 1 : 1; + } + + static getLength = function(index) { return is_array(length)? array_safe_get(length, index) : length; } + + static getAccuLength = function(index) { return array_safe_get(lengthAcc, index, []); } + static getBoundary = function() { var boundary = new BoundingBox(); var _lines = inputs[| 0].getValue(); @@ -60,10 +100,47 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr } } + static getPointDistance = function(_dist, ind = 0) { + var _conn = inputs[| 1].getValue(); + + if(_conn) return getPointRatio(_dist / length); + else return getPointRatio(_dist / length[ind], ind); + } + function update() { var _lines = inputs[| 0].getValue(); var _conn = inputs[| 1].getValue(); + if(_conn) { + length = 0; + lengthAcc = []; + + for( var i = 1, n = array_length(_lines); i < n; i++ ) { + var p0 = _lines[i - 1]; + var p1 = _lines[i - 0]; + + var dist = point_distance(p0[0], p0[1], p1[0], p1[1]); + + length += dist; + array_push(lengthAcc, length); + } + } else { + length = []; + lengthAcc = []; + + var len = floor(array_length(_lines) / 2) * 2; + + for( var i = 0; i < len; i += 2 ) { + var p0 = _lines[i + 0]; + var p1 = _lines[i + 1]; + + var dist = point_distance(p0[0], p0[1], p1[0], p1[1]); + + array_push(length, dist); + array_push(lengthAcc, [ dist ]); + } + } + outputs[| 0].setValue(self); } diff --git a/scripts/node_path_shift/node_path_shift.gml b/scripts/node_path_shift/node_path_shift.gml index c2e925086..d0ab259dd 100644 --- a/scripts/node_path_shift/node_path_shift.gml +++ b/scripts/node_path_shift/node_path_shift.gml @@ -61,7 +61,7 @@ function Node_Path_Shift(_x, _y, _group = noone) : Node(_x, _y, _group) construc } static getPointDistance = function(_dist, ind = 0) { - return getPointRatio(_rat * getLength()); + return getPointRatio(_dist / getLength(), ind); } function update() {