diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index ebff0f259..f3633fe18 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -1383,6 +1383,7 @@ {"name":"__node_3d_prim_cylinder","order":2,"path":"scripts/__node_3d_prim_cylinder/__node_3d_prim_cylinder.yy",}, {"name":"s_discord","order":7,"path":"sprites/s_discord/s_discord.yy",}, {"name":"Obj_FirebaseFirestore_Collection_Query_options","order":10,"path":"objects/Obj_FirebaseFirestore_Collection_Query_options/Obj_FirebaseFirestore_Collection_Query_options.yy",}, + {"name":"stack_functions","order":7,"path":"scripts/stack_functions/stack_functions.yy",}, {"name":"panel_nodes","order":2,"path":"scripts/panel_nodes/panel_nodes.yy",}, {"name":"sh_gradient_points","order":19,"path":"shaders/sh_gradient_points/sh_gradient_points.yy",}, {"name":"node_array_composite","order":17,"path":"scripts/node_array_composite/node_array_composite.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index ed670a66a..dd81c6cbe 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -766,6 +766,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"README.txt","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Welcome files.zip","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, @@ -800,7 +801,6 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Steamworks_Extension_Documentation.html","CopyToMask":0,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ucrtbased.dll","ConfigValues":{},"CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"webpmux.exe","CopyToMask":-1,"filePath":"datafiles/webp",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Welcome files.zip","CopyToMask":-1,"filePath":"datafiles",}, ], "isEcma": false, "LibraryEmitters": [], @@ -2108,6 +2108,7 @@ {"id":{"name":"__node_3d_prim_cylinder","path":"scripts/__node_3d_prim_cylinder/__node_3d_prim_cylinder.yy",},}, {"id":{"name":"s_discord","path":"sprites/s_discord/s_discord.yy",},}, {"id":{"name":"Obj_FirebaseFirestore_Collection_Query_options","path":"objects/Obj_FirebaseFirestore_Collection_Query_options/Obj_FirebaseFirestore_Collection_Query_options.yy",},}, + {"id":{"name":"stack_functions","path":"scripts/stack_functions/stack_functions.yy",},}, {"id":{"name":"panel_nodes","path":"scripts/panel_nodes/panel_nodes.yy",},}, {"id":{"name":"sh_gradient_points","path":"shaders/sh_gradient_points/sh_gradient_points.yy",},}, {"id":{"name":"node_array_composite","path":"scripts/node_array_composite/node_array_composite.yy",},}, diff --git a/datafiles/Welcome files.zip b/datafiles/Welcome files.zip index 691331aa3..6b9303975 100644 Binary files a/datafiles/Welcome files.zip and b/datafiles/Welcome files.zip differ diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index fa25925cb..b22e4a3a1 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -46,7 +46,7 @@ event_inherited(); var name = __txt(cat.name); maxLen = max(maxLen, string_width(name)); } - category_width = maxLen + ui(48); + category_width = maxLen + ui(56); #endregion function rightClick(node) { #region diff --git a/objects/o_dialog_scrollbox/Create_0.gml b/objects/o_dialog_scrollbox/Create_0.gml index 32bd757cc..ecb3e14e3 100644 --- a/objects/o_dialog_scrollbox/Create_0.gml +++ b/objects/o_dialog_scrollbox/Create_0.gml @@ -93,7 +93,7 @@ event_inherited(); } if(clickable) { - if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly + 1, _dw, _ly + hght - 1)) { + if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly, _dw, _ly + hght - 1)) { selecting = i; hovering = data[i]; diff --git a/scripts/array_functions/array_functions.gml b/scripts/array_functions/array_functions.gml index 078e7d15c..e5c469a25 100644 --- a/scripts/array_functions/array_functions.gml +++ b/scripts/array_functions/array_functions.gml @@ -1,4 +1,4 @@ -function array_create_from_list(list) { +function array_create_from_list(list) { #region if(list == undefined) return []; if(!ds_exists(list, ds_type_list)) return []; @@ -6,9 +6,9 @@ function array_create_from_list(list) { for( var i = 0; i < ds_list_size(list); i++ ) arr[i] = list[| i]; return arr; -} +} #endregion -function array_safe_set(arr, index, value, fill = 0) { +function array_safe_set(arr, index, value, fill = 0) { #region if(!is_array(arr)) return arr; if(is_array(index)) return arr; @@ -23,9 +23,16 @@ function array_safe_set(arr, index, value, fill = 0) { array_set(arr, index, value); return arr; -} +} #endregion -function array_resize_fill(arr, size, fill = 0) { +function array_fill(arr, startIndex, endIndex, value = 0) { #region + INLINE + + for( var i = startIndex; i < endIndex; i++ ) + arr[i] = value; +} #endregion + +function array_resize_fill(arr, size, fill = 0) { #region if(size < array_length(arr)) { array_resize(arr, size); return arr; @@ -35,14 +42,14 @@ function array_resize_fill(arr, size, fill = 0) { for(; i < size; i++) arr[i] = fill; return arr; -} +} #endregion enum ARRAY_OVERFLOW { _default, loop } -function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) { +function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) { #region INLINE if(!is_array(arr)) return def; if(is_array(index)) return def; @@ -57,17 +64,17 @@ function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default) if(index < 0) return def; if(index >= array_length(arr)) return def; return arr[index] == undefined? def : arr[index]; -} +} #endregion -function array_push_create(arr, val) { +function array_push_create(arr, val) { #region INLINE if(!is_array(arr)) return [ val ]; array_push(arr, val); return arr; -} +} #endregion -function array_get_decimal(arr, index, color = false) { +function array_get_decimal(arr, index, color = false) { #region INLINE if(!is_array(arr)) return 0; @@ -79,9 +86,9 @@ function array_get_decimal(arr, index, color = false) { return color? merge_color(v0, v1, frac(index)) : lerp(v0, v1, frac(index)); -} +} #endregion -function array_exists(arr, val) { +function array_exists(arr, val) { #region INLINE self.__temp_val = val; @@ -89,9 +96,9 @@ function array_exists(arr, val) { return array_any(arr, function(_val, _ind) { return isEqual(_val, self.__temp_val); }); -} +} #endregion -function array_overlap(arr0, arr1) { +function array_overlap(arr0, arr1) { #region INLINE self.__temp_arr = arr1; @@ -101,14 +108,14 @@ function array_overlap(arr0, arr1) { return array_any(arr0, function(_val, _ind) { return array_exists(self.__temp_arr, _val); }); -} +} #endregion -function array_empty(arr) { +function array_empty(arr) { #region INLINE return is_array(arr) && array_length(arr) == 0; -} +} #endregion -function array_find(arr, val) { +function array_find(arr, val) { #region INLINE self.__temp_val = val; @@ -116,35 +123,34 @@ function array_find(arr, val) { return array_find_index(arr, function(_val, _ind) { return isEqual(_val, self.__temp_val); }); -} +} #endregion -function array_remove(arr, val) { +function array_remove(arr, val) { #region INLINE if(!is_array(arr)) return; if(!array_exists(arr, val)) return; var ind = array_find(arr, val); array_delete(arr, ind, 1); -} +} #endregion -function array_push_unique(arr, val) { +function array_push_unique(arr, val) { #region INLINE if(!is_array(arr)) return; if(array_exists(arr, val)) return; array_push(arr, val); -} +} #endregion - -function array_insert_unique(arr, ind, val) { +function array_insert_unique(arr, ind, val) { #region INLINE if(!is_array(arr)) return; if(array_exists(arr, val)) return; array_insert(arr, ind, val); -} +} #endregion -function array_append(arr, arr0) { +function array_append(arr, arr0) { #region INLINE if(!is_array(arr)) return arr; @@ -153,9 +159,9 @@ function array_append(arr, arr0) { for( var i = 0, n = array_length(arr0); i < n; i++ ) array_push(arr, arr0[i]); return arr; -} +} #endregion -function array_merge() { +function array_merge() { #region INLINE var arr = []; @@ -163,9 +169,9 @@ function array_merge() { array_append(arr, argument[i]); return arr; -} +} #endregion -function array_clone(arr) { +function array_clone(arr) { #region INLINE if(!is_array(arr)) return arr; @@ -174,9 +180,9 @@ function array_clone(arr) { for( var i = 0, n = array_length(arr); i < n; i++ ) _res[i] = array_clone(arr[i]); return _res; -} +} #endregion -function array_min(arr) { +function array_min(arr) { #region INLINE if(!is_array(arr) || array_length(arr) == 0) return 0; @@ -185,9 +191,9 @@ function array_min(arr) { for( var i = 0, n = array_length(arr); i < n; i++ ) mn = min(mn, arr[i]); return mn; -} +} #endregion -function array_max(arr) { +function array_max(arr) { #region INLINE if(!is_array(arr) || array_length(arr) == 0) return 0; @@ -196,15 +202,15 @@ function array_max(arr) { for( var i = 0, n = array_length(arr); i < n; i++ ) mx = max(mx, arr[i]); return mx; -} +} #endregion -function array_get_dimension(arr) { +function array_get_dimension(arr) { #region INLINE return is_array(arr)? array_length(arr) : 1; -} +} #endregion -function array_shape(arr, first = true, isSurface = false) { +function array_shape(arr, first = true, isSurface = false) { #region if(!is_array(arr)) { if(isSurface && is_surface(arr)) return (first? "" : " x ") + string(surface_get_width_safe(arr)) + " x " + string(surface_get_height_safe(arr)) + " px"; @@ -217,9 +223,9 @@ function array_shape(arr, first = true, isSurface = false) { dim += array_shape(arr[0], false, isSurface); return (first? "" : " x ") + dim; -} +} #endregion -function array_get_depth(arr) { +function array_get_depth(arr) { #region INLINE if(!is_array(arr)) return 0; @@ -232,9 +238,9 @@ function array_get_depth(arr) { } return d; -} +} #endregion -function array_spread(arr, _arr = [], _minDepth = 0) { +function array_spread(arr, _arr = [], _minDepth = 0) { #region INLINE if(array_get_depth(arr) == _minDepth) { @@ -246,9 +252,9 @@ function array_spread(arr, _arr = [], _minDepth = 0) { array_spread(arr[i], _arr, _minDepth); return _arr; -} +} #endregion -function array_verify(arr, length) { +function array_verify(arr, length) { #region INLINE if(!is_array(arr)) return array_create(length); @@ -256,4 +262,4 @@ function array_verify(arr, length) { array_resize(arr, length); return arr; -} \ No newline at end of file +} #endregion \ No newline at end of file diff --git a/scripts/node_3d_transform_image/node_3d_transform_image.gml b/scripts/node_3d_transform_image/node_3d_transform_image.gml index 059437d6c..7a92f18ab 100644 --- a/scripts/node_3d_transform_image/node_3d_transform_image.gml +++ b/scripts/node_3d_transform_image/node_3d_transform_image.gml @@ -11,9 +11,9 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, objectPreview.materials[0] = materialPreview; camera = camera_create(); - viewMat = matrix_build_lookat(0, 0, 1, - 0, 0, 0, - 1, 0, 0); + viewMat = matrix_build_lookat(0, 0, 1, + 0, 0, 0, + 1, 0, 0); projMat = matrix_build_projection_ortho(1, 1, 0.001, 10); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index c21a93130..56d7e9e09 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -405,11 +405,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x targ.setFrom(junctionFrom); } #endregion - static isActiveDynamic = function() { #region + static isActiveDynamic = function(frame = CURRENT_FRAME) { #region if(update_on_frame) return true; for(var i = 0; i < ds_list_size(inputs); i++) - if(inputs[| i].isActiveDynamic()) return true; + if(inputs[| i].isActiveDynamic(frame)) return true; return false; } #endregion @@ -898,6 +898,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var hover = noone; var amo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list); var jun; + gpu_set_texfilter(true); for(var i = 0; i < amo; i++) { var ind = getInputJunctionIndex(i); @@ -928,6 +929,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x } onDrawJunctions(_x, _y, _mx, _my, _s); + gpu_set_texfilter(false); + return hover; } #endregion diff --git a/scripts/node_group_input/node_group_input.gml b/scripts/node_group_input/node_group_input.gml index 2b6511500..ee9628f79 100644 --- a/scripts/node_group_input/node_group_input.gml +++ b/scripts/node_group_input/node_group_input.gml @@ -165,10 +165,13 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru switch(_dtype) { case "Range" : + if(!is_array(_val) || array_length(_val) != 2) + inParent.animator = new valueAnimator([0, 0], inParent); inParent.setDisplay(VALUE_DISPLAY.range); break; case "Slider" : + if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent); inParent.setDisplay(VALUE_DISPLAY.slider, { range: [_range[0], _range[1], _step] }); break; case "Slider range" : @@ -178,6 +181,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru break; case "Rotation" : + if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent); inParent.setDisplay(VALUE_DISPLAY.rotation); break; @@ -219,8 +223,15 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru else if(_dtype == "Vector range") inParent.setDisplay(VALUE_DISPLAY.vector_range); break; - case "Enum button" : inParent.setDisplay(VALUE_DISPLAY.enum_button, string_splice(_enum_label, ",")); break; - case "Menu scroll" : inParent.setDisplay(VALUE_DISPLAY.enum_scroll, string_splice(_enum_label, ",")); break; + case "Enum button" : + if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent); + inParent.setDisplay(VALUE_DISPLAY.enum_button, string_splice(_enum_label, ",")); + break; + + case "Menu scroll" : + if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent); + inParent.setDisplay(VALUE_DISPLAY.enum_scroll, string_splice(_enum_label, ",")); + break; case "Palette" : if(!is_array(_val)) @@ -242,6 +253,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru break; default: + if(is_array(_val)) inParent.animator = new valueAnimator(0, inParent); inParent.setDisplay(VALUE_DISPLAY._default); break; } diff --git a/scripts/node_keyframe/node_keyframe.gml b/scripts/node_keyframe/node_keyframe.gml index 1d61d3d34..21ced6662 100644 --- a/scripts/node_keyframe/node_keyframe.gml +++ b/scripts/node_keyframe/node_keyframe.gml @@ -76,10 +76,36 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor { prop = _prop; y = 0; + animate_frames = []; + if(_prop.type != VALUE_TYPE.trigger) ds_list_add(values, new valueKey(0, _val, self)); #endregion + static refreshAnimation = function() { #region + animate_frames = array_verify(animate_frames, TOTAL_FRAMES); + + var _anim = false; + var _fr = noone; + + for( var i = 0, n = ds_list_size(values); i < n; i++ ) { + var _key = values[| i]; + + if(_fr == noone) { + array_fill(animate_frames, 0, _key.time, 0); + } else { + if(array_equals(_fr.ease_out, [0, 0]) && array_equals(_fr.ease_in, [0, 1]) && isEqual(_fr.value, _key.value)) + array_fill(animate_frames, _fr.time, _key.time, 0); + else + array_fill(animate_frames, _fr.time, _key.time, 1); + } + + _fr = _key; + } + + if(_fr) array_fill(animate_frames, _fr.time, TOTAL_FRAMES, 0); + } #endregion + static interpolate = function(from, to, rat) { #region if(prop.type == VALUE_TYPE.boolean) return 0; diff --git a/scripts/node_pc_balls/node_pc_balls.gml b/scripts/node_pc_balls/node_pc_balls.gml index f895f4a90..9ebdc2084 100644 --- a/scripts/node_pc_balls/node_pc_balls.gml +++ b/scripts/node_pc_balls/node_pc_balls.gml @@ -42,7 +42,7 @@ function Node_PC_Balls(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) input_display_list = [ 8, ["Input", true], 0, 1, ["Movement", false], 5, 2, 3, - ["Color", true], 4, 6, 7 + ["Color", true], 4, 6, 7, ] outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); diff --git a/scripts/node_transform/node_transform.gml b/scripts/node_transform/node_transform.gml index d0708bfd3..38105b61d 100644 --- a/scripts/node_transform/node_transform.gml +++ b/scripts/node_transform/node_transform.gml @@ -141,8 +141,8 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } #endregion static step = function() { #region - var pos = getInputData(2); - var anc = getInputData(3); + var pos = getSingleValue(2); + var anc = getSingleValue(3); var _b = inputs[| 3].editWidget.side_button; var _a = anc[0] * 2 + anc[1] * 20; @@ -335,16 +335,16 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) _surf_out = _surf_out[preview_index]; } - var __pos = getInputData(2); + var __pos = getSingleValue(2); var pos = [ __pos[0], __pos[1] ]; var _pos = [ __pos[0], __pos[1] ]; - var __anc = getInputData(3); + var __anc = getSingleValue(3); var anc = [ __anc[0], __anc[1] ]; var _anc = [ __anc[0], __anc[1] ]; - var rot = getInputData(5); - var sca = getInputData(6); + var rot = getSingleValue(5); + var sca = getSingleValue(6); var srw = surface_get_width_safe(_surf); var srh = surface_get_height_safe(_surf); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 22714b35a..6940e86e7 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -1404,7 +1404,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru global.cache_call++; if(useCache && use_cache) { var cache_hit = cache_value[0]; - cache_hit &= !isActiveDynamic() || cache_value[1] == _time; + cache_hit &= !isActiveDynamic(_time) || cache_value[1] == _time; cache_hit &= cache_value[2] != undefined; cache_hit &= cache_value[3] == applyUnit; cache_hit &= connect_type == JUNCTION_CONNECT.input; @@ -1592,7 +1592,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru node.refreshTimeline(); } #endregion - static isActiveDynamic = function() { #region + static isActiveDynamic = function(frame = CURRENT_FRAME) { #region INLINE if(value_from != noone) return false; diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index 43278ac7b..b36c6e08f 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -469,10 +469,11 @@ function Panel_Animation() : PanelContent() constructor { getTimelineContentFolder(_cont, _context_folder, _depth + 1, _show && _cont.show); } else if(is_instanceof(_cont, timelineItemNode)) { var _node = _cont.node; - //if(_node != PROJECT.globalNode && !show_node_outside_context && _node.group != PANEL_GRAPH.getCurrentContext()) continue; + if(!is_struct(_node)) continue; + var _anim = []; var _prop = []; - + for( var j = 0, m = ds_list_size(_node.inputs); j < m; j++ ) { var prop = _node.inputs[| j]; if(!prop.is_anim || prop.value_from != noone) continue; diff --git a/scripts/pcx_ast/pcx_ast.gml b/scripts/pcx_ast/pcx_ast.gml index 4f6dd599e..7b28263c6 100644 --- a/scripts/pcx_ast/pcx_ast.gml +++ b/scripts/pcx_ast/pcx_ast.gml @@ -395,7 +395,7 @@ res = v1; } else if(symbol == "【") { // array builder res = array_create(array_length(v1)); - for( var i = 0, n = array_length(res); i < n; i++ ) + for( var i = 0, n = array_length(v1); i < n; i++ ) res[i] = getVal(v1[i], params); } else if(symbol == "@") { // array getter if(isLeft) diff --git a/scripts/pcx_parse/pcx_parse.gml b/scripts/pcx_parse/pcx_parse.gml index 8ca66f2bd..3f4c7b5dd 100644 --- a/scripts/pcx_parse/pcx_parse.gml +++ b/scripts/pcx_parse/pcx_parse.gml @@ -81,6 +81,8 @@ fx = string_replace_all(fx, "-=", "⊖"); fx = string_replace_all(fx, "*=", "⊗"); fx = string_replace_all(fx, "/=", "⊘"); + + fx = string_replace_all(fx, "]", ",]"); fx = string_trim(fx); @@ -199,7 +201,7 @@ } function evaluateFunctionTree(fx) { - static __BRACKETS = [ "(", ")", "[", "]" ]; + static __BRACKETS = [ "(", ")", "[", "]", "]" ]; var pres = global.EQUATION_PRES; var vl = ds_stack_create(); @@ -219,7 +221,7 @@ while(l <= len) { ch = string_char_at(fx, l); - //print($"Analyzing {ch}"); + printIf(global.LOG_EXPRESSION, $"Analyzing {ch}"); if(ds_map_exists(pres, ch)) { //symbol is operator last_push = "op"; @@ -261,15 +263,15 @@ last_push = "vl"; l++; } else if (ch == "[") { - if(last_push == "vl") { + if(last_push == "vl") { // Get array member | a[1] ds_stack_push(op, "@"); ds_stack_push(op, ch); - } else + } else // Create array member | a = [1] ds_stack_push(op, [ "{", ds_stack_size(vl) ]); last_push = "op"; l++; - } else if (ch == "]") { + } else if (ch == "]") { while(!ds_stack_empty(op)) { var _top = ds_stack_pop(op); if(_top == "[") break; @@ -277,6 +279,7 @@ var arr = []; while(ds_stack_size(vl) > _top[1]) array_insert(arr, 0, ds_stack_pop(vl)); + ds_stack_push(vl, new __funcTree("【", arr)); break; } @@ -291,10 +294,11 @@ var _top = ds_stack_top(op); if(_top == "[" || _top == "(" || (is_array(_top) && _top[0] == "{")) break; + var _top = ds_stack_pop(op); ds_stack_push(vl, buildFuncTree(_top, vl)); } - last_push = "vl"; + last_push = "op"; l++; } else { var vsl = ""; @@ -302,10 +306,8 @@ while(l <= len) { cch = string_char_at(fx, l); if(ds_map_exists(pres, cch) || array_exists(__BRACKETS, cch)) break; - if(cch == ",") { - l++; + if(cch == ",") break; - } vsl += cch; l++; @@ -329,7 +331,7 @@ } } - //print($"op: {ds_stack_size(op)}; vl: {ds_stack_size(vl)}"); + printIf(global.LOG_EXPRESSION, $"\tvl = {ds_stack_to_array(vl)}\n\top = {ds_stack_to_array(op)}"); _ch = ch; } diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 77c8e2136..2b54e8d77 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -8,6 +8,8 @@ enum RENDER_TYPE { globalvar UPDATE, RENDER_QUEUE, RENDER_ORDER, UPDATE_RENDER_ORDER; UPDATE_RENDER_ORDER = false; global.FLAG.render = 0; + global.FLAG.renderTime = false; + global.group_io = [ "Node_Group_Input", "Node_Group_Output", "Node_Feedback_Input", "Node_Feedback_Output", @@ -228,7 +230,7 @@ function Render(partial = false, runAction = false) { #region _render_time /= 1000; - LOG_IF(global.FLAG.render >= 1, $"=== RENDER COMPLETE IN {(get_timer() - t1) / 1000} ms ===\n"); + LOG_IF(global.FLAG.renderTime || global.FLAG.render >= 1, $"=== RENDER FRAME {CURRENT_FRAME} COMPLETE IN {(get_timer() - t1) / 1000} ms ===\n"); LOG_IF(global.FLAG.render > 1, $"=== RENDER SUMMARY STA ==="); LOG_IF(global.FLAG.render > 1, $" total time: {(get_timer() - t1) / 1000} ms"); LOG_IF(global.FLAG.render > 1, $" leaf: {_leaf_time / 1000} ms"); diff --git a/scripts/scrollBox/scrollBox.gml b/scripts/scrollBox/scrollBox.gml index 066eec59e..27f5d8adc 100644 --- a/scripts/scrollBox/scrollBox.gml +++ b/scripts/scrollBox/scrollBox.gml @@ -12,7 +12,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor onModify = _onModify; data_list = _data; self.update_hover = update_hover; - data = []; + data = _data; curr_text = 0; font = f_p0; @@ -55,10 +55,12 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor if(is_method(data_list)) data = data_list(); else data = data_list; - if(is_array(_val)) return 0; - if(is_real(_val)) _val = array_safe_get(data, _val); + var _selVal = _val; - var _text = is_instanceof(_val, scrollItem)? _val.name : _val; + if(is_array(_val)) return 0; + if(is_numeric(_val)) _selVal = array_safe_get(data, _val); + + var _text = is_instanceof(_selVal, scrollItem)? _selVal.name : _selVal; curr_text = _text; w = _w; @@ -96,7 +98,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor } var _arw = sprite_get_width(arrow_spr) + ui(8); - var _spr = is_instanceof(_val, scrollItem) && _val.spr; + var _spr = is_instanceof(_selVal, scrollItem) && _selVal.spr; draw_set_text(font, align, fa_center, COLORS._main_text); draw_set_alpha(0.5 + 0.5 * interactable); @@ -104,7 +106,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor else if(align == fa_left) draw_text(_x + ui(8) + _spr * _h, _y + _h / 2 - ui(2), _text); draw_set_alpha(1); - if(_spr) draw_sprite_ext(_val.spr, 0, _x + ui(8) + _h / 2, _y + _h / 2, 1, 1, 0, _val.spr_blend, 1); + if(_spr) draw_sprite_ext(_selVal.spr, 0, _x + ui(8) + _h / 2, _y + _h / 2, 1, 1, 0, _selVal.spr_blend, 1); draw_sprite_ui_uniform(arrow_spr, arrow_ind, _x + w - _arw / 2, _y + _h / 2, 1, COLORS._main_icon, 0.5 + 0.5 * interactable); diff --git a/scripts/stack_functions/stack_functions.gml b/scripts/stack_functions/stack_functions.gml new file mode 100644 index 000000000..854d330be --- /dev/null +++ b/scripts/stack_functions/stack_functions.gml @@ -0,0 +1,12 @@ +function ds_stack_to_array(stack) { + var len = ds_stack_size(stack); + var _st = array_create(len); + + for( var i = 0; i < len; i++ ) + _st[len - i - 1] = ds_stack_pop(stack); + + for( var i = 0; i < len; i++ ) + ds_stack_push(stack, _st[i]); + + return _st; +} \ No newline at end of file diff --git a/scripts/stack_functions/stack_functions.yy b/scripts/stack_functions/stack_functions.yy new file mode 100644 index 000000000..c417b6bc2 --- /dev/null +++ b/scripts/stack_functions/stack_functions.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "stack_functions", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "ds", + "path": "folders/functions/ds.yy", + }, +} \ No newline at end of file diff --git a/scripts/timeline_data/timeline_data.gml b/scripts/timeline_data/timeline_data.gml index df369709d..8709770c0 100644 --- a/scripts/timeline_data/timeline_data.gml +++ b/scripts/timeline_data/timeline_data.gml @@ -109,7 +109,7 @@ function timelineItemNode(node) : timelineItem() constructor { _map.type = "Node"; _map.show = show; - _map.node_id = node.node_id; + _map.node_id = is_struct(node)? node.node_id : -4; return _map; } #endregion