From 1b4c4acd7f4d0ec9f7f7df074350dc82c80e8759 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 29 Jan 2025 12:10:14 +0700 Subject: [PATCH] Fix error when animating global variable. --- datafiles/data/Nodes/Internal.zip | Bin 9100058 -> 9100058 bytes scripts/node_global/node_global.gml | 46 ++++++++++++------------ scripts/timeline_data/timeline_data.gml | 7 ++-- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/datafiles/data/Nodes/Internal.zip b/datafiles/data/Nodes/Internal.zip index 385071f61b658b7007d1070a1d8d8ca2708f4c21..ffc8349de3f6bb8cb0c58455cdeeb532cb088d75 100644 GIT binary patch delta 1292 zcmYk(S!`5g7zSW0En~+*D~qCYpfHFn&<A#kBLV7M>_qP}0xP&&zzH{bVv|1vq9 zmoKDu(kZ-zG)zP~GB61)yo^k^@d~mq8B>sr9K4FDn1<q_O z&6+@3XQTcjXnJ&Gz?>|_!GO6~^4oy9Nb+XDER=i}Fny9=hdKP~=5;Pz7c||{2?xz0 z$umJ`f;&C>cF@d`CeO~7tO&8`3z^xeVxeSH$Xp=hibTx^tkM5pTI} zxBnpj`L7nWUeX^?YnX8>qRP^x@ifYN@3pF;)RdupQRS0jM^x2HUWlqXW}K4`=St&# zr>d45eR6e|%9En0OI4+sHL2Rr+1+aX*yN^eXL59#P8HX>l_?WULwkEv{`2wp-X3+y F|38bv1DpT= delta 1292 zcmYk(S!`5g7zSYN;@Gj!vMA^rDV>5Xv>nPKg|^f6D74jDmO4unaR-Z1I%-F2WqW&u z^9K^WfIsPya7PFROhXurA=qh4G%4|>jTh}0L-0ax#BgDZ1bx4rp>&cbZ@%w*|C0Ip zuUyFJrz3b6X-G!~GVuspcobQ1<1u7o0Tv<$xmbk7Sc0W^98X{wmg7l01rH27jTOkl zO60?f0<6MnJcB|MVGY)z7$qo$59?5d_1J)o*o0@X8Rgi5t*AgHs^CX8YEX+h)T80D z*$_y}Z_~dAO^@CiFc(O1Fkr5eJR2~JC2s`GQpvjk( zCxgxeS9E1rKZk^ZA1Izo|*{#j#8A~6MA9v@COXQUA!p>>4d;3GNteCsq zr03{)+D6-{k(#KPUZ5ALg;#eldY^X8gwqeCv`%&lF1Z*OSPVA~ESq-J3+E)Rj}HX2v)~ees?t z>rQ4`L7VQJwl+xeUA?;VAIqh0Oj~a0)Jf;3yH@6z8K=RKjj0do=a$qK#$0;n!Gu@e z9#O7&ugaZ%nXxv>0;X4QPFjoauRc>9bHyS_i(=;@$rHEa?azKIHl(;TV%JFC z9hZRV~aoCx6SA z|L(_716{`{VI_ ILu%OnKY9w=MF0Q* diff --git a/scripts/node_global/node_global.gml b/scripts/node_global/node_global.gml index 9444fa58b..1c9362a70 100644 --- a/scripts/node_global/node_global.gml +++ b/scripts/node_global/node_global.gml @@ -40,7 +40,7 @@ function variable_editor(nodeVal) constructor { refreshInput(); RENDER_ALL - } ); + }); sc_type.update_hover = false; sc_disp = new scrollBox(display_list[0], function(value) { @@ -61,7 +61,7 @@ function variable_editor(nodeVal) constructor { slider_range = [ 0, 1 ]; slider_step = 0.01; - static refreshInput = function() { #region + static refreshInput = function() { value.setType(val_type[type_index]); value.name = value_name; @@ -146,9 +146,9 @@ function variable_editor(nodeVal) constructor { case "Export" : value.setDisplay(VALUE_DISPLAY.path_save, { filter: "" }); break; case "Font" : value.setDisplay(VALUE_DISPLAY.path_font); break; } - } #endregion + } - static draw = function(_x, _y, _w, _m, _focus, _hover) { #region + static draw = function(_x, _y, _w, _m, _focus, _hover) { var _h = 0; switch(sc_disp.data_list[disp_index]) { @@ -177,7 +177,7 @@ function variable_editor(nodeVal) constructor { } return _h; - } #endregion + } } function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor { @@ -193,38 +193,36 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor { input_display_list = -1; anim_priority = -999; + static isActiveDynamic = function(frame = CURRENT_FRAME) { return true; } + static valueUpdate = function(index) { RENDER_ALL } - static createValue = function() { #region + static createValue = function() { var _in = nodeValue_Float("NewValue", self, 0); _in.editor = new variable_editor(_in); array_push(inputs, _in); return _in; - } #endregion + } - static inputExist = function(key) { #region - return ds_map_exists(value, key); - } #endregion + static inputExist = function(key) { return ds_map_exists(value, key); } - static inputGetable = function(from, key) { #region + static inputGetable = function(from, key) { if(!inputExist(key)) return false; var to = value[? key]; - if(!typeCompatible(from.type, to.type)) - return false; - if(typeIncompatible(from, to)) - return false; + if(!typeCompatible(from.type, to.type)) return false; + if(typeIncompatible(from, to)) return false; return true; - } #endregion + } - static getInputKey = function(key, def = noone) { #region + static getInputKey = function(key, def = noone) { if(!ds_map_exists(value, key)) return def; return value[? key]; - } #endregion + } - static step = function() { #region + static step = function() { for( var i = 0; i < array_length(inputs); i++ ) { var _inp = inputs[i]; value[? _inp.name] = _inp; @@ -233,9 +231,9 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor { if(string_pos(" ", _inp.name)) val = false; _inp.editor.tb_name.boxColor = val? c_white : COLORS._main_value_negative; } - } #endregion + } - static serialize = function() { #region + static serialize = function() { var _map = {}; var _inputs = []; @@ -255,9 +253,9 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor { _map.attri = attributes; return _map; - } #endregion + } - static deserialize = function(_map) { #region + static deserialize = function(_map) { var _inputs = _map.inputs; for(var i = 0; i < array_length(_inputs); i++) { @@ -283,5 +281,5 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor { if(struct_has(_map, "attr")) struct_override(attributes, _map.attr); step(); - } #endregion + } } \ No newline at end of file diff --git a/scripts/timeline_data/timeline_data.gml b/scripts/timeline_data/timeline_data.gml index 3259aa534..37195fefd 100644 --- a/scripts/timeline_data/timeline_data.gml +++ b/scripts/timeline_data/timeline_data.gml @@ -74,14 +74,13 @@ function timelineItemNode(node) : timelineItem() constructor { color_dsp = cc; draw_sprite_stretched_ext(THEME.box_r2, 0, _x, _y, _w, lh, cc, alpha); + if(_sel) draw_sprite_stretched_ext(THEME.box_r2, 1, _x, _y, _w, lh, COLORS._main_accent, 1); if(hover && point_in_rectangle(_msx, _msy, _x + ui(20), _y, _x + _w, _y + lh - 1)) { - draw_sprite_stretched_add(THEME.box_r2, 0, _x, _y, _w, lh, col, 0.05); + draw_sprite_stretched_add(THEME.box_r2, 1, _x, _y, _w, lh, col, 0.3); res = 1; } - // draw_sprite_stretched_add(THEME.box_r2, 1, _x, _y, _w, lh, c_white, 0.15); - var tx = lx + lw - ui(7); var tt = __txtx("panel_animation_goto", "Go to node"); var _m = [ _msx, _msy ]; @@ -89,8 +88,6 @@ function timelineItemNode(node) : timelineItem() constructor { if(buttonInstant(noone, tx - ui(9), _y + ui(1), ui(18), ui(18), _m, hover, focus, tt, THEME.animate_node_go, 0, col == -1? COLORS._main_icon_light : col, 0.4) == 2) graphFocusNode(node); - if(_sel) draw_sprite_stretched_ext(THEME.box_r2, 1, _x, _y, _w, lh, COLORS._main_accent, 1); - var aa = 0.75; if(hover && point_in_rectangle(_msx, _msy, lx, _y, lx + ui(20), _y + lh)) { aa = 1;