From 1e320bd24ba4a50c8df83004b7b95a63215099bf Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Mon, 8 May 2023 19:14:30 +0200 Subject: [PATCH] Node align panel, debug console --- PixelComposer.resource_order | 9 ++- PixelComposer.yyp | 4 +- objects/o_dialog_menubox/Create_0.gml | 2 + objects/o_dialog_menubox/Draw_64.gml | 10 +++ objects/o_main/Create_0.gml | 5 +- objects/o_main/Draw_75.gml | 8 ++ objects/o_main/Step_0.gml | 4 +- scripts/__strandSim/__strandSim.gml | 2 +- scripts/ase_reader/ase_reader.gml | 28 +++---- .../contextMenu_controller.gml | 1 + scripts/globals/globals.gml | 4 + scripts/node_collection/node_collection.gml | 8 +- scripts/node_data/node_data.gml | 14 ++-- .../node_group_output/node_group_output.gml | 14 ++-- scripts/node_iterate/node_iterate.gml | 8 +- .../node_iterate_each/node_iterate_each.gml | 8 +- .../node_iterate_filter.gml | 4 +- .../node_iterator_each_output.gml | 8 +- .../node_iterator_filter_output.gml | 10 +-- .../node_iterator_output.gml | 6 +- scripts/panel_console/panel_console.gml | 73 +++++++++++++++++++ scripts/panel_console/panel_console.yy | 11 +++ scripts/panel_function/panel_function.gml | 2 + scripts/panel_graph/panel_graph.gml | 4 +- scripts/panel_history/panel_history.yy | 4 +- scripts/panel_inspector/panel_inspector.gml | 2 +- scripts/panel_menu/panel_menu.gml | 6 ++ scripts/panel_menu/panel_menu.yy | 4 +- scripts/panel_node_align/panel_node_align.gml | 41 +++++++++++ scripts/panel_node_align/panel_node_align.yy | 11 +++ scripts/panel_workspace/panel_workspace.gml | 2 +- scripts/panel_workspace/panel_workspace.yy | 4 +- scripts/render_data/render_data.gml | 46 ++++++------ 33 files changed, 272 insertions(+), 95 deletions(-) create mode 100644 scripts/panel_console/panel_console.gml create mode 100644 scripts/panel_console/panel_console.yy create mode 100644 scripts/panel_node_align/panel_node_align.gml create mode 100644 scripts/panel_node_align/panel_node_align.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index b77d5c062..c461cde51 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -123,7 +123,6 @@ {"name":"graph","order":1,"path":"folders/panels/graph.yy",}, {"name":"inspectors","order":2,"path":"folders/panels/inspectors.yy",}, {"name":"components","order":3,"path":"folders/panels/inspectors/components.yy",}, - {"name":"menu","order":3,"path":"folders/panels/menu.yy",}, {"name":"preview","order":4,"path":"folders/panels/preview.yy",}, {"name":"overlay","order":2,"path":"folders/panels/preview/overlay.yy",}, {"name":"sprites","order":3,"path":"folders/panels/preview/sprites.yy",}, @@ -150,6 +149,7 @@ {"name":"sprites","order":12,"path":"folders/sprites.yy",}, {"name":"gameframe","order":2,"path":"folders/sprites/gameframe.yy",}, {"name":"widgets","order":5,"path":"folders/widgets.yy",}, + {"name":"Audio","order":21,"path":"folders/nodes/data/Audio.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",}, @@ -326,6 +326,7 @@ {"name":"s_workshop_badge","order":1,"path":"sprites/s_workshop_badge/s_workshop_badge.yy",}, {"name":"node_compare","order":16,"path":"scripts/node_compare/node_compare.yy",}, {"name":"node_iterator_each_size","order":3,"path":"scripts/node_iterator_each_size/node_iterator_each_size.yy",}, + {"name":"panel_console","order":8,"path":"scripts/panel_console/panel_console.yy",}, {"name":"s_node_HSV_combine","order":44,"path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",}, {"name":"o_dialog_release_note","order":8,"path":"objects/o_dialog_release_note/o_dialog_release_note.yy",}, {"name":"sh_fd_advect_material_rgba_16_glsl","order":4,"path":"shaders/sh_fd_advect_material_rgba_16_glsl/sh_fd_advect_material_rgba_16_glsl.yy",}, @@ -722,7 +723,7 @@ {"name":"node_checkerboard","order":13,"path":"scripts/node_checkerboard/node_checkerboard.yy",}, {"name":"node_gradient_output","order":5,"path":"scripts/node_gradient_output/node_gradient_output.yy",}, {"name":"display_refresh","order":17,"path":"scripts/display_refresh/display_refresh.yy",}, - {"name":"panel_workspace","order":1,"path":"scripts/panel_workspace/panel_workspace.yy",}, + {"name":"panel_workspace","order":6,"path":"scripts/panel_workspace/panel_workspace.yy",}, {"name":"fd_rectangle_assure_surfaces_exist","order":2,"path":"scripts/fd_rectangle_assure_surfaces_exist/fd_rectangle_assure_surfaces_exist.yy",}, {"name":"fd_rectangle_material_surface_was_created","order":13,"path":"scripts/fd_rectangle_material_surface_was_created/fd_rectangle_material_surface_was_created.yy",}, {"name":"s_node_fluidSim_apply_velocity","order":2,"path":"sprites/s_node_fluidSim_apply_velocity/s_node_fluidSim_apply_velocity.yy",}, @@ -925,6 +926,7 @@ {"name":"draw_circle_angle","order":15,"path":"scripts/draw_circle_angle/draw_circle_angle.yy",}, {"name":"node_wrap_mesh","order":6,"path":"scripts/node_wrap_mesh/node_wrap_mesh.yy",}, {"name":"sh_alpha_hash","order":43,"path":"shaders/sh_alpha_hash/sh_alpha_hash.yy",}, + {"name":"panel_node_align","order":3,"path":"scripts/panel_node_align/panel_node_align.yy",}, {"name":"sh_blur_alpha","order":1,"path":"shaders/sh_blur_alpha/sh_blur_alpha.yy",}, {"name":"value_snap","order":10,"path":"scripts/value_snap/value_snap.yy",}, {"name":"file_dropper","order":1,"path":"extensions/file_dropper/file_dropper.yy",}, @@ -1037,6 +1039,7 @@ {"name":"sh_level","order":11,"path":"shaders/sh_level/sh_level.yy",}, {"name":"sh_grid_tri","order":20,"path":"shaders/sh_grid_tri/sh_grid_tri.yy",}, {"name":"s_node_text","order":1,"path":"sprites/s_node_text/s_node_text.yy",}, + {"name":"panel_menu","order":7,"path":"scripts/panel_menu/panel_menu.yy",}, {"name":"s_node_ase_file","order":18,"path":"sprites/s_node_ase_file/s_node_ase_file.yy",}, {"name":"draw_line_round","order":4,"path":"scripts/draw_line_round/draw_line_round.yy",}, {"name":"vectorBox","order":18,"path":"scripts/vectorBox/vectorBox.yy",}, @@ -1065,7 +1068,7 @@ {"name":"s_node_shadow_cast","order":49,"path":"sprites/s_node_shadow_cast/s_node_shadow_cast.yy",}, {"name":"path_function","order":4,"path":"scripts/path_function/path_function.yy",}, {"name":"fd_rectangle_set_velocity_dissipation_value","order":14,"path":"scripts/fd_rectangle_set_velocity_dissipation_value/fd_rectangle_set_velocity_dissipation_value.yy",}, - {"name":"panel_history","order":2,"path":"scripts/panel_history/panel_history.yy",}, + {"name":"panel_history","order":7,"path":"scripts/panel_history/panel_history.yy",}, {"name":"sh_channel_H","order":3,"path":"shaders/sh_channel_H/sh_channel_H.yy",}, {"name":"s_node_RGB","order":34,"path":"sprites/s_node_RGB/s_node_RGB.yy",}, {"name":"fd_rectangle_draw","order":9,"path":"scripts/fd_rectangle_draw/fd_rectangle_draw.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 58507ff6a..ee89c3942 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -156,7 +156,6 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"graph","folderPath":"folders/panels/graph.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"inspectors","folderPath":"folders/panels/inspectors.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"components","folderPath":"folders/panels/inspectors/components.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"menu","folderPath":"folders/panels/menu.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"preview","folderPath":"folders/panels/preview.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"overlay","folderPath":"folders/panels/preview/overlay.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/panels/preview/sprites.yy",}, @@ -186,6 +185,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Steamworks","folderPath":"folders/Steamworks.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"UGC","folderPath":"folders/Steamworks/UGC.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Audio","folderPath":"folders/nodes/data/Audio.yy",}, ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, @@ -1057,6 +1057,7 @@ {"id":{"name":"node_iterator_each_size","path":"scripts/node_iterator_each_size/node_iterator_each_size.yy",},}, {"id":{"name":"sh_trans_node_prev_drop","path":"shaders/sh_trans_node_prev_drop/sh_trans_node_prev_drop.yy",},}, {"id":{"name":"fd_draw_self_to_collision_mask_surface","path":"scripts/fd_draw_self_to_collision_mask_surface/fd_draw_self_to_collision_mask_surface.yy",},}, + {"id":{"name":"panel_console","path":"scripts/panel_console/panel_console.yy",},}, {"id":{"name":"spr_gameframe_border","path":"sprites/spr_gameframe_border/spr_gameframe_border.yy",},}, {"id":{"name":"s_node_HSV_combine","path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},}, {"id":{"name":"node_normal_light","path":"scripts/node_normal_light/node_normal_light.yy",},}, @@ -1730,6 +1731,7 @@ {"id":{"name":"node_wrap_mesh","path":"scripts/node_wrap_mesh/node_wrap_mesh.yy",},}, {"id":{"name":"node_curve","path":"scripts/node_curve/node_curve.yy",},}, {"id":{"name":"sh_alpha_hash","path":"shaders/sh_alpha_hash/sh_alpha_hash.yy",},}, + {"id":{"name":"panel_node_align","path":"scripts/panel_node_align/panel_node_align.yy",},}, {"id":{"name":"sh_blur_alpha","path":"shaders/sh_blur_alpha/sh_blur_alpha.yy",},}, {"id":{"name":"node_render_sprite_sheet","path":"scripts/node_render_sprite_sheet/node_render_sprite_sheet.yy",},}, {"id":{"name":"textArrayBox","path":"scripts/textArrayBox/textArrayBox.yy",},}, diff --git a/objects/o_dialog_menubox/Create_0.gml b/objects/o_dialog_menubox/Create_0.gml index 5d4b028ef..5d93d367c 100644 --- a/objects/o_dialog_menubox/Create_0.gml +++ b/objects/o_dialog_menubox/Create_0.gml @@ -2,6 +2,8 @@ event_inherited(); #region data + menu_id = ""; + draggable = false; destroy_on_click_out = false; selecting = -1; diff --git a/objects/o_dialog_menubox/Draw_64.gml b/objects/o_dialog_menubox/Draw_64.gml index ccca62745..d5dad6e4b 100644 --- a/objects/o_dialog_menubox/Draw_64.gml +++ b/objects/o_dialog_menubox/Draw_64.gml @@ -150,4 +150,14 @@ if(!ready) exit; } draw_sprite_stretched(THEME.textbox, 1, dialog_x, dialog_y, dialog_w, dialog_h); +#endregion + +#region debug + if(global.DEBUG_FLAG[$ "context_menu_id"]) { + draw_set_color(c_white); + draw_rectangle_border(dialog_x, dialog_y, dialog_x + dialog_w, dialog_y + dialog_h, 2); + + draw_set_text(f_p0, fa_left, fa_bottom); + draw_text(dialog_x, dialog_y - ui(2), menu_id); + } #endregion \ No newline at end of file diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index 190522dde..56f1a1a6f 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -80,8 +80,9 @@ UPDATE |= RENDER_TYPE.full; }); - globalvar HOTKEY_MOD; + globalvar HOTKEY_MOD, HOTKEY_BLOCK; HOTKEY_MOD = 0; + HOTKEY_BLOCK = false; #endregion #region Loader @@ -275,4 +276,4 @@ tweenInit(); physics_world_update_iterations(100); -#endregion \ No newline at end of file +#endregion diff --git a/objects/o_main/Draw_75.gml b/objects/o_main/Draw_75.gml index 521f38347..e8871861e 100644 --- a/objects/o_main/Draw_75.gml +++ b/objects/o_main/Draw_75.gml @@ -133,6 +133,14 @@ if(OS == os_windows && gameframe_is_minimized()) exit; PANEL_MAIN.drawGUI(); #endregion +#region debug + if(global.DEBUG_FLAG[$ "hover_element"]) { + draw_set_text(f_p0, fa_right, fa_bottom, COLORS._main_text); + if(HOVERING_ELEMENT) + draw_text(WIN_W, WIN_H, $"[{instanceof(HOVERING_ELEMENT)}]"); + } +#endregion + #region frame draw_set_color(merge_color(COLORS._main_icon, COLORS._main_icon_dark, 0.95)); draw_rectangle(1, 1, WIN_W - 2, WIN_H - 2, true); diff --git a/objects/o_main/Step_0.gml b/objects/o_main/Step_0.gml index dd703a6cf..00607b976 100644 --- a/objects/o_main/Step_0.gml +++ b/objects/o_main/Step_0.gml @@ -37,7 +37,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit; if(SHIFT == KEYBOARD_STATUS.pressing) HOTKEY_MOD |= MOD_KEY.shift; if(ALT == KEYBOARD_STATUS.pressing) HOTKEY_MOD |= MOD_KEY.alt; - if(!instance_exists(o_dialog_preference)) { + if(!instance_exists(o_dialog_preference) && !HOTKEY_BLOCK) { if(ds_map_exists(HOTKEYS, "")) { var l = HOTKEYS[? ""]; for(var i = 0; i < ds_list_size(l); i++) { @@ -64,6 +64,8 @@ if(OS == os_windows && gameframe_is_minimized()) exit; } } } + + HOTKEY_BLOCK = false; #endregion #region coroutine diff --git a/scripts/__strandSim/__strandSim.gml b/scripts/__strandSim/__strandSim.gml index 03cadd79d..9ef69a1cb 100644 --- a/scripts/__strandSim/__strandSim.gml +++ b/scripts/__strandSim/__strandSim.gml @@ -398,7 +398,7 @@ function StrandMesh() constructor { hairs[i].draw(_x, _y, _s, drawAngle, baked); } - static store = function(_x, _y, _s, drawAngle = false, baked = false) { + static store = function() { for( var i = 0; i < array_length(hairs); i++ ) hairs[i].store(); } diff --git a/scripts/ase_reader/ase_reader.gml b/scripts/ase_reader/ase_reader.gml index b9e022759..e655e06eb 100644 --- a/scripts/ase_reader/ase_reader.gml +++ b/scripts/ase_reader/ase_reader.gml @@ -45,7 +45,7 @@ enum _BIN_TYPE { //Subtract = 17 //Divide = 18 -global.ASE_LOG = true; +global.DEBUG_FLAG.ase_import = false; globalvar __ase_format_header; __ase_format_header = [ @@ -343,17 +343,17 @@ function read_format_array(bin, formatArr, outMap) { continue; var pos = file_bin_position(bin); var val = read_format(bin, formatArr[i], outMap); - //printIf(global.ASE_LOG, "Pos " + dec_to_hex(pos) + " - " + dec_to_hex(file_bin_position(bin))); + //printIf(global.DEBUG_FLAG.ase_import, "Pos " + dec_to_hex(pos) + " - " + dec_to_hex(file_bin_position(bin))); if(formatArr[i][1] == "Type") - printIf(global.ASE_LOG, "\t" + formatArr[i][1] + ":\t 0x" + dec_to_hex(val, 4)); + printIf(global.DEBUG_FLAG.ase_import, "\t" + formatArr[i][1] + ":\t 0x" + dec_to_hex(val, 4)); else - printIf(global.ASE_LOG, "\t" + formatArr[i][1] + ":\t " + string(val)); + printIf(global.DEBUG_FLAG.ase_import, "\t" + formatArr[i][1] + ":\t " + string(val)); } } function read_ase(path, fileMap) { - printIf(global.ASE_LOG, "===== Reading: " + path + " ====="); + printIf(global.DEBUG_FLAG.ase_import, "===== Reading: " + path + " ====="); var file = file_bin_open(path, 0); file_bin_seek(file, 0); @@ -363,7 +363,7 @@ function read_ase(path, fileMap) { var frames = []; var frameAmo = ds_map_exists(fileMap, "Frame amount")? fileMap[? "Frame amount"] : 0; for( var i = 0; i < frameAmo; i++ ) { - printIf(global.ASE_LOG, "\n=== Reading frame " + string(i) + " ==="); + printIf(global.DEBUG_FLAG.ase_import, "\n=== Reading frame " + string(i) + " ==="); array_push(frames, read_ase_frame(file)); } fileMap[? "Frames"] = frames; @@ -384,7 +384,7 @@ function read_ase_frame(file) { chunkAmo = ds_map_exists(frame, "Chunk amount new")? frame[? "Chunk amount new"] : chunkAmo; for( var i = 0; i < chunkAmo; i++ ) { - printIf(global.ASE_LOG, "\n=== Reading chunk " + string(i) + " ==="); + printIf(global.DEBUG_FLAG.ase_import, "\n=== Reading chunk " + string(i) + " ==="); array_push(chunks, read_ase_chunk(file)); } frame[? "Chunks"] = chunks; @@ -403,7 +403,7 @@ function read_ase_chunk(file) { switch(chunk[? "Type"]) { case 0x0004: //old palette case 0x0011: //old palette - printIf(global.ASE_LOG, "\n -- Reading chunk [Old palette] -- "); + printIf(global.DEBUG_FLAG.ase_import, "\n -- Reading chunk [Old palette] -- "); read_format_array(file, __ase_format_chunk_old_palette, chunk); var cc = []; for( var i = 0; i < chunk[? "Packet amount"]; i++ ) { @@ -413,11 +413,11 @@ function read_ase_chunk(file) { chunk[? "Packets"] = cc; break; case 0x2004: //layer - printIf(global.ASE_LOG, "\n -- Reading chunk [Layer] -- "); + printIf(global.DEBUG_FLAG.ase_import, "\n -- Reading chunk [Layer] -- "); read_format_array(file, __ase_format_chunk_layer, chunk); break; case 0x2005: //cel - printIf(global.ASE_LOG, "\n -- Reading chunk [Cel] -- "); + printIf(global.DEBUG_FLAG.ase_import, "\n -- Reading chunk [Cel] -- "); read_format_array(file, __ase_format_chunk_cel, chunk); var type = chunk[? "Cel type"]; @@ -443,7 +443,7 @@ function read_ase_chunk(file) { var _rawBuff = buffer_decompress(_compBuff); if(_rawBuff != -1) chunk[? "Buffer"] = _rawBuff; - printIf(global.ASE_LOG, " Buffer size: " + string(compressLength)); + printIf(global.DEBUG_FLAG.ase_import, " Buffer size: " + string(compressLength)); buffer_delete(_compBuff); break; @@ -456,7 +456,7 @@ function read_ase_chunk(file) { case 0x2006: //cel extra break; case 0x2007: //color profile - printIf(global.ASE_LOG, "\n -- Reading chunk [Color profile] -- "); + printIf(global.DEBUG_FLAG.ase_import, "\n -- Reading chunk [Color profile] -- "); read_format_array(file, __ase_format_chunk_color_profile, chunk); break; case 0x2008: //external file @@ -466,7 +466,7 @@ function read_ase_chunk(file) { case 0x2017: //path break; case 0x2018: //tag - printIf(global.ASE_LOG, "\n -- Reading chunk [Tag] -- "); + printIf(global.DEBUG_FLAG.ase_import, "\n -- Reading chunk [Tag] -- "); read_format_array(file, __ase_format_chunk_tag, chunk); var amo = chunk[? "Tag amount"] var tags = []; @@ -478,7 +478,7 @@ function read_ase_chunk(file) { chunk[? "Tags"] = tags; break; case 0x2019: //palette - printIf(global.ASE_LOG, "\n -- Reading chunk [Palette] -- "); + printIf(global.DEBUG_FLAG.ase_import, "\n -- Reading chunk [Palette] -- "); read_format_array(file, __ase_format_chunk_palette, chunk); var cc = []; for( var i = 0; i < chunk[? "Color amount"]; i++ ) { diff --git a/scripts/contextMenu_controller/contextMenu_controller.gml b/scripts/contextMenu_controller/contextMenu_controller.gml index 54381b008..a65578b55 100644 --- a/scripts/contextMenu_controller/contextMenu_controller.gml +++ b/scripts/contextMenu_controller/contextMenu_controller.gml @@ -11,6 +11,7 @@ array_append(menu, callbacks[i].populate()); } + dia.menu_id = menu_id; dia.context = context; dia.setMenu(menu, align); return dia; diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 11c879b30..d358dc4ab 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -171,4 +171,8 @@ #region PATCH #macro PATCH_STATIC static _doUpdate = function() { doUpdate() }; +#endregion + +#region debug + global.DEBUG_FLAG = {}; #endregion \ No newline at end of file diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index 1e4c9662a..c51d04373 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -143,7 +143,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc if(!_in.renderActive) continue; array_push(nodes, _in); - LOG_IF(global.RENDER_LOG, "Check complete, push " + _in.name + " to stack."); + LOG_IF(global.DEBUG_FLAG.render, "Check complete, push " + _in.name + " to stack."); } LOG_BLOCK_END(); @@ -152,7 +152,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc static setRenderStatus = function(result) { LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Set render status for " + name + " : " + string(result)); + LOG_IF(global.DEBUG_FLAG.render, "Set render status for " + name + " : " + string(result)); LOG_BLOCK_END(); rendered = result; @@ -376,10 +376,10 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc static resetRender = function() { LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Reset Render for collection " + name); + LOG_IF(global.DEBUG_FLAG.render, "Reset Render for collection " + name); for( var i = 0; i < ds_list_size(nodes); i++ ) { - LOG_IF(global.RENDER_LOG, "Reset Render for " + nodes[| i].name); + LOG_IF(global.DEBUG_FLAG.render, "Reset Render for " + nodes[| i].name); nodes[| i].rendered = false; } diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 30a5c26f6..371a4500c 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -291,7 +291,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(SAFE_MODE) return; var sBase = surface_get_target(); LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "DoUpdate called from " + name); + LOG_IF(global.DEBUG_FLAG.render, "DoUpdate called from " + name); for( var i = 0; i < ds_list_size(inputs); i++ ) { if(inputs[| i].type != VALUE_TYPE.trigger) continue; @@ -342,7 +342,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static triggerRender = function() { LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Trigger render for " + name + " (" + display_name + ")"); + LOG_IF(global.DEBUG_FLAG.render, "Trigger render for " + name + " (" + display_name + ")"); setRenderStatus(false); UPDATE |= RENDER_TYPE.partial; @@ -368,7 +368,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(!val_from.node.active) continue; if(!val_from.node.renderActive) continue; if(!val_from.node.rendered && !val_from.node.update_on_frame) { - //LOG_LINE_IF(global.RENDER_LOG && name == "Tunnel Out", "Non renderable because: " + string(val_from.node.name)); + //LOG_LINE_IF(global.DEBUG_FLAG.render && name == "Tunnel Out", "Non renderable because: " + string(val_from.node.name)); return false; } } @@ -382,7 +382,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var nodes = []; LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Call get next node from: " + name); + LOG_IF(global.DEBUG_FLAG.render, "Call get next node from: " + name); LOG_BLOCK_START(); for(var i = 0; i < ds_list_size(outputs); i++) { @@ -392,10 +392,10 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var _to = _ot.value_to[| j]; if(!_to.node.active || _to.value_from == noone) continue; - LOG_IF(global.RENDER_LOG, "Check render " + _to.node.name + " from " + _to.value_from.node.name); + LOG_IF(global.DEBUG_FLAG.render, "Check render " + _to.node.name + " from " + _to.value_from.node.name); if(_to.value_from.node != self) continue; - LOG_IF(global.RENDER_LOG, "Check complete, push " + _to.node.name + " to stack."); + LOG_IF(global.DEBUG_FLAG.render, "Check complete, push " + _to.node.name + " to stack."); array_push(nodes, _to.node); } } @@ -408,7 +408,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static onInspect = function() {} static setRenderStatus = function(result) { - LOG_LINE_IF(global.RENDER_LOG, "Set render status for " + name + " : " + string(result)); + LOG_LINE_IF(global.DEBUG_FLAG.render, "Set render status for " + name + " : " + string(result)); rendered = result; } diff --git a/scripts/node_group_output/node_group_output.gml b/scripts/node_group_output/node_group_output.gml index 0683ab727..a01981a8e 100644 --- a/scripts/node_group_output/node_group_output.gml +++ b/scripts/node_group_output/node_group_output.gml @@ -19,7 +19,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr output_index = -1; static setRenderStatus = function(result) { - LOG_LINE_IF(global.RENDER_LOG, "Set render status for " + name + " : " + string(result)); + LOG_LINE_IF(global.DEBUG_FLAG.render, "Set render status for " + name + " : " + string(result)); rendered = result; if(group) group.setRenderStatus(result); @@ -34,29 +34,29 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr static getNextNodes = function() { if(is_undefined(outParent)) return []; //group.setRenderStatus(true); - //printIf(global.RENDER_LOG, "Value to amount " + string(ds_list_size(outParent.value_to))); + //printIf(global.DEBUG_FLAG.render, "Value to amount " + string(ds_list_size(outParent.value_to))); LOG_BLOCK_START(); var nodes = []; for(var j = 0; j < ds_list_size(outParent.value_to); j++) { var _to = outParent.value_to[| j]; if(!_to.node.renderActive) continue; - //printIf(global.RENDER_LOG, "Value to " + _to.name); + //printIf(global.DEBUG_FLAG.render, "Value to " + _to.name); if(!_to.node.active || _to.value_from == noone) { - //printIf(global.RENDER_LOG, "no value from"); + //printIf(global.DEBUG_FLAG.render, "no value from"); continue; } if(_to.value_from.node != group) { - //printIf(global.RENDER_LOG, "value from not equal group"); + //printIf(global.DEBUG_FLAG.render, "value from not equal group"); continue; } - //printIf(global.RENDER_LOG, "Group output ready " + string(_to.node.isRenderable())); + //printIf(global.DEBUG_FLAG.render, "Group output ready " + string(_to.node.isRenderable())); array_push(nodes, _to.node); - LOG_IF(global.RENDER_LOG, "Check complete, push " + _to.node.name + " to stack."); + LOG_IF(global.DEBUG_FLAG.render, "Check complete, push " + _to.node.name + " to stack."); } LOG_BLOCK_END(); diff --git a/scripts/node_iterate/node_iterate.gml b/scripts/node_iterate/node_iterate.gml index cc02a4ecf..c2a9424b8 100644 --- a/scripts/node_iterate/node_iterate.gml +++ b/scripts/node_iterate/node_iterate.gml @@ -39,7 +39,7 @@ function Node_Iterate(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) n.initLoop(); } - LOG_LINE_IF(global.RENDER_LOG, "Loop begin"); + LOG_LINE_IF(global.DEBUG_FLAG.render, "Loop begin"); } static getNextNodes = function() { @@ -73,13 +73,13 @@ function Node_Iterate(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) iterated++; LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Iteration update: " + string(iterated) + "/" + string(maxIter)); + LOG_IF(global.DEBUG_FLAG.render, "Iteration update: " + string(iterated) + "/" + string(maxIter)); if(iterated >= maxIter) { - LOG_IF(global.RENDER_LOG, "Iteration complete"); + LOG_IF(global.DEBUG_FLAG.render, "Iteration complete"); render_time = get_timer() - loop_start_time; } else { - LOG_IF(global.RENDER_LOG, "Iteration not completed, reset render status."); + LOG_IF(global.DEBUG_FLAG.render, "Iteration not completed, reset render status."); resetRender(); } diff --git a/scripts/node_iterate_each/node_iterate_each.gml b/scripts/node_iterate_each/node_iterate_each.gml index 20f6c7dae..da3d20bbe 100644 --- a/scripts/node_iterate_each/node_iterate_each.gml +++ b/scripts/node_iterate_each/node_iterate_each.gml @@ -50,7 +50,7 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr outputs[| 0].setValue([]) } - LOG_LINE_IF(global.RENDER_LOG, "Loop begin"); + LOG_LINE_IF(global.DEBUG_FLAG.render, "Loop begin"); } static getIterationCount = function() { @@ -72,13 +72,13 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr iterated++; LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Iteration update: " + string(iterated) + "/" + string(maxIter)); + LOG_IF(global.DEBUG_FLAG.render, "Iteration update: " + string(iterated) + "/" + string(maxIter)); if(iterated >= maxIter) { - LOG_IF(global.RENDER_LOG, "Iteration complete"); + LOG_IF(global.DEBUG_FLAG.render, "Iteration complete"); render_time = get_timer() - loop_start_time; } else { - LOG_IF(global.RENDER_LOG, "Iteration not completed, reset render status."); + LOG_IF(global.DEBUG_FLAG.render, "Iteration not completed, reset render status."); resetRender(); } diff --git a/scripts/node_iterate_filter/node_iterate_filter.gml b/scripts/node_iterate_filter/node_iterate_filter.gml index 3da1e57f4..dd217443b 100644 --- a/scripts/node_iterate_filter/node_iterate_filter.gml +++ b/scripts/node_iterate_filter/node_iterate_filter.gml @@ -46,9 +46,9 @@ function Node_Iterate_Filter(_x, _y, _group = noone) : Node_Collection(_x, _y, _ surface_array_free(arrOut); outputs[| 0].setValue([]) - LOG_LINE_IF(global.RENDER_LOG, "Loop begin"); + LOG_LINE_IF(global.DEBUG_FLAG.render, "Loop begin"); var _val = outputs[| 0].getValue(); - LOG_LINE_IF(global.RENDER_LOG, "Output original value " + string(_val)); + LOG_LINE_IF(global.DEBUG_FLAG.render, "Output original value " + string(_val)); } static getIterationCount = function() { diff --git a/scripts/node_iterator_each_output/node_iterator_each_output.gml b/scripts/node_iterator_each_output/node_iterator_each_output.gml index 7a852feda..6bf3a38ea 100644 --- a/scripts/node_iterator_each_output/node_iterator_each_output.gml +++ b/scripts/node_iterator_each_output/node_iterator_each_output.gml @@ -33,17 +33,17 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group var nodes = []; LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Call get next node from loop output."); + LOG_IF(global.DEBUG_FLAG.render, "Call get next node from loop output."); if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside? - LOG_IF(global.RENDER_LOG, "Loop restart: iteration " + string(group.iterated)); + LOG_IF(global.DEBUG_FLAG.render, "Loop restart: iteration " + string(group.iterated)); nodes = array_append(nodes, __nodeLeafList(group.getNodeList())); } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop - LOG_IF(global.RENDER_LOG, "Loop completed"); + LOG_IF(global.DEBUG_FLAG.render, "Loop completed"); group.setRenderStatus(true); nodes = getNextNodesRaw(); } else - LOG_IF(global.RENDER_LOG, "Loop not ready"); + LOG_IF(global.DEBUG_FLAG.render, "Loop not ready"); LOG_BLOCK_END(); diff --git a/scripts/node_iterator_filter_output/node_iterator_filter_output.gml b/scripts/node_iterator_filter_output/node_iterator_filter_output.gml index 1413856c7..a5cf46bb9 100644 --- a/scripts/node_iterator_filter_output/node_iterator_filter_output.gml +++ b/scripts/node_iterator_filter_output/node_iterator_filter_output.gml @@ -33,17 +33,17 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro var nodes = []; LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Call get next node from loop output."); + LOG_IF(global.DEBUG_FLAG.render, "Call get next node from loop output."); if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside? - LOG_IF(global.RENDER_LOG, "Loop restart: iteration " + string(group.iterated)); + LOG_IF(global.DEBUG_FLAG.render, "Loop restart: iteration " + string(group.iterated)); nodes = array_append(nodes, __nodeLeafList(group.getNodeList())); } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop - LOG_IF(global.RENDER_LOG, "Loop completed"); + LOG_IF(global.DEBUG_FLAG.render, "Loop completed"); group.setRenderStatus(true); nodes = getNextNodesRaw(); } else - LOG_IF(global.RENDER_LOG, "Loop not ready"); + LOG_IF(global.DEBUG_FLAG.render, "Loop not ready"); LOG_BLOCK_END(); @@ -84,7 +84,7 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro array_push(_val, _new_val); } - LOG_IF(global.RENDER_LOG, "Value " + string(val) + " filter result " + string(res) + " to array " + string(_val)); + LOG_IF(global.DEBUG_FLAG.render, "Value " + string(val) + " filter result " + string(res) + " to array " + string(_val)); group.outputs[| 0].setValue(_val); group.iterationUpdate(); diff --git a/scripts/node_iterator_output/node_iterator_output.gml b/scripts/node_iterator_output/node_iterator_output.gml index 1bbad275e..0f2b54eda 100644 --- a/scripts/node_iterator_output/node_iterator_output.gml +++ b/scripts/node_iterator_output/node_iterator_output.gml @@ -57,14 +57,14 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y LOG_BLOCK_START(); if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside? - LOG_IF(global.RENDER_LOG, "Loop restart: iteration " + string(group.iterated)); + LOG_IF(global.DEBUG_FLAG.render, "Loop restart: iteration " + string(group.iterated)); nodes = array_append(nodes, __nodeLeafList(group.getNodeList())); } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop - LOG_IF(global.RENDER_LOG, "Loop completed"); + LOG_IF(global.DEBUG_FLAG.render, "Loop completed"); group.setRenderStatus(true); nodes = getNextNodesRaw(); } else - LOG_IF(global.RENDER_LOG, "Loop not ready"); + LOG_IF(global.DEBUG_FLAG.render, "Loop not ready"); LOG_BLOCK_END(); diff --git a/scripts/panel_console/panel_console.gml b/scripts/panel_console/panel_console.gml new file mode 100644 index 000000000..8e02443e3 --- /dev/null +++ b/scripts/panel_console/panel_console.gml @@ -0,0 +1,73 @@ +function Panel_Console() : PanelContent() constructor { + title = "Console"; + w = ui(640); + h = ui(320); + + command = ""; + history = []; + cmd_history = []; + + cmd_index = 0; + + keyboard_string = ""; + + static submit_command = function() { + if(command == "") return; + array_push(history, { txt: command, color: COLORS._main_text_sub }); + array_push(cmd_history, command); + + var cmd = string_splice(command, " "); + + switch(cmd[0]) { + case "flag": + if(array_length(cmd) < 2) break; + var flg = array_safe_get(cmd, 1, ""); + global.DEBUG_FLAG[$ flg] = !global.DEBUG_FLAG[$ flg]; + + array_push(history, { txt: $"Toggled debug flag: {flg} = {global.DEBUG_FLAG[$ flg]? "True" : "False"}", color: COLORS._main_value_positive }); + break; + } + + keyboard_string = ""; + command = ""; + } + + function drawContent(panel) { + HOTKEY_BLOCK = true; + command = keyboard_string; + + draw_clear_alpha(CDEF.main_dkblack, 1); + + draw_set_color(c_black); + draw_set_alpha(0.75); + draw_rectangle(0, h - ui(28), w, h, false); + draw_set_alpha(1); + + draw_set_text(f_code, fa_left, fa_bottom, COLORS._main_text); + draw_text(ui(8), h - ui(4), command); + draw_set_color(COLORS._main_text_sub); + draw_text(ui(8) + string_width(command), h - ui(4), "_"); + + var hy = h - ui(32); + for( var i = 0; i < array_length(history); i++ ) { + var his = history[array_length(history) - i - 1]; + var txt = his.txt; + + draw_set_color(his.color); + draw_text_ext(ui(8), hy, txt, -1, w - ui(16)); + hy -= string_height_ext(txt, -1, w - ui(16)); + + if(hy <= 0) break; + } + + if(keyboard_check_pressed(vk_enter)) + submit_command(); + + if(keyboard_check_pressed(vk_up)) { + cmd_index = max(0, cmd_index - 1); + keyboard_string = array_safe_get(cmd_history, cmd_index, ""); + command = keyboard_string; + } else if(keyboard_check_pressed(vk_anykey)) + cmd_index = array_length(cmd_history); + } +} \ No newline at end of file diff --git a/scripts/panel_console/panel_console.yy b/scripts/panel_console/panel_console.yy new file mode 100644 index 000000000..b636f44f0 --- /dev/null +++ b/scripts/panel_console/panel_console.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_console", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "_others", + "path": "folders/panels/_others.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_function/panel_function.gml b/scripts/panel_function/panel_function.gml index a0ebc90e4..c208a06a1 100644 --- a/scripts/panel_function/panel_function.gml +++ b/scripts/panel_function/panel_function.gml @@ -58,10 +58,12 @@ case "Panel_Notification" : return new Panel_Notification(); case "Panel_Nodes" : return new Panel_Nodes(); case "Panel_Globalvar" : return new Panel_Globalvar(); + case "Panel_Node_Align" : return new Panel_Node_Align(); case "Panel_Color" : return new Panel_Color(); case "Panel_Palette" : return new Panel_Palette(); case "Panel_Gradient" : return new Panel_Gradient(); + case "Panel_Console" : return new Panel_Console(); } return noone; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index c0d390408..aeedbca59 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -582,12 +582,14 @@ function Panel_Graph() : PanelContent() constructor { [ [THEME.inspector_surface_halign, 0], function() { node_halign(nodes_select_list, fa_left); } ], [ [THEME.inspector_surface_halign, 1], function() { node_halign(nodes_select_list, fa_center); } ], [ [THEME.inspector_surface_halign, 2], function() { node_halign(nodes_select_list, fa_right); } ], - [ [THEME.obj_distribute_h, 0], function() { node_hdistribute(nodes_select_list); } ], ]), menuItemGroup(get_text("vertical", "Vertical"), [ [ [THEME.inspector_surface_valign, 0], function() { node_valign(nodes_select_list, fa_top); } ], [ [THEME.inspector_surface_valign, 1], function() { node_valign(nodes_select_list, fa_middle); } ], [ [THEME.inspector_surface_valign, 2], function() { node_valign(nodes_select_list, fa_bottom); } ], + ]), + menuItemGroup(get_text("distribute", "Distribute"), [ + [ [THEME.obj_distribute_h, 0], function() { node_hdistribute(nodes_select_list); } ], [ [THEME.obj_distribute_v, 0], function() { node_vdistribute(nodes_select_list); } ], ]), ]); diff --git a/scripts/panel_history/panel_history.yy b/scripts/panel_history/panel_history.yy index c895faa9c..4bab310ac 100644 --- a/scripts/panel_history/panel_history.yy +++ b/scripts/panel_history/panel_history.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "menu", - "path": "folders/panels/menu.yy", + "name": "_others", + "path": "folders/panels/_others.yy", }, } \ No newline at end of file diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 78c9ebd3d..514026485 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -578,7 +578,7 @@ function Panel_Inspector() : PanelContent() constructor { } function drawContent(panel) { - draw_clear(COLORS.panel_bg_clear); + draw_clear_alpha(COLORS.panel_bg_clear, 0); lineBreak = w < PREF_MAP[? "inspector_line_break_width"]; draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(8), top_bar_h - ui(8), w - ui(16), h - top_bar_h); diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index 65ed1aded..f54c0b9a6 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -190,6 +190,7 @@ function Panel_Menu() : PanelContent() constructor { menuItem(get_text("panel_menu_nodes", "Nodes"), function(_dat) { return submenuCall(_dat, [ + menuItem(get_text("panel_menu_node_align", "Align nodes"), function() { panelAdd("Panel_Node_Align", true) },,, function() { return findPanel("Panel_Node_Align") != noone; } ), menuItem(get_text("panel_menu_nodes", "Nodes"), function() { panelAdd("Panel_Nodes", true) },,, function() { return findPanel("Panel_Nodes") != noone; } ), menuItem(get_text("tunnels", "Tunnels"), function() { panelAdd("Panel_Tunnels", true) },,, function() { return findPanel("Panel_Tunnels") != noone; } ), ]); @@ -208,6 +209,11 @@ function Panel_Menu() : PanelContent() constructor { if(TESTING) { array_push(menus, [ get_text("panel_menu_test", "Test"), [ + menuItem(get_text("panel_menu_toggle_terminal", "Debug console"), function() { + panelAdd("Panel_Console", true) + }), + -1, + menuItem(get_text("panel_menu_test_load_all", "Load all current collections"), function() { __test_load_current_collections(); }), diff --git a/scripts/panel_menu/panel_menu.yy b/scripts/panel_menu/panel_menu.yy index 06a871417..ff24fbef4 100644 --- a/scripts/panel_menu/panel_menu.yy +++ b/scripts/panel_menu/panel_menu.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "menu", - "path": "folders/panels/menu.yy", + "name": "panels", + "path": "folders/panels.yy", }, } \ No newline at end of file diff --git a/scripts/panel_node_align/panel_node_align.gml b/scripts/panel_node_align/panel_node_align.gml new file mode 100644 index 000000000..ff32604cc --- /dev/null +++ b/scripts/panel_node_align/panel_node_align.gml @@ -0,0 +1,41 @@ +function Panel_Node_Align() : PanelContent() constructor { + title = "Align"; + w = ui(200); + h = ui(200); + + function drawContent(panel) { + draw_clear_alpha(COLORS.panel_bg_clear, 0); + + var xc = w / 2; + var yy = 12; + + draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub); + draw_text(xc, yy, "Align"); + + yy += ui(24); + if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_halign, 0, c_white) == 2) + node_halign(PANEL_GRAPH.nodes_select_list, fa_left); + if(buttonInstant(THEME.button_hide, xc - ui(16), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_halign, 1, c_white) == 2) + node_halign(PANEL_GRAPH.nodes_select_list, fa_center); + if(buttonInstant(THEME.button_hide, xc - ui(16) + ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_halign, 2, c_white) == 2) + node_halign(PANEL_GRAPH.nodes_select_list, fa_right); + + yy += ui(40); + if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_valign, 0, c_white) == 2) + node_valign(PANEL_GRAPH.nodes_select_list, fa_top); + if(buttonInstant(THEME.button_hide, xc - ui(16), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_valign, 1, c_white) == 2) + node_valign(PANEL_GRAPH.nodes_select_list, fa_middle); + if(buttonInstant(THEME.button_hide, xc - ui(16) + ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_valign, 2, c_white) == 2) + node_valign(PANEL_GRAPH.nodes_select_list, fa_bottom); + + yy += ui(44); + draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub); + draw_text(xc, yy, "Distribute"); + + yy += ui(24); + if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(20), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_h, 0, c_white) == 2) + node_hdistribute(PANEL_GRAPH.nodes_select_list); + if(buttonInstant(THEME.button_hide, xc - ui(16) + ui(20), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_v, 0, c_white) == 2) + node_vdistribute(PANEL_GRAPH.nodes_select_list); + } +} \ No newline at end of file diff --git a/scripts/panel_node_align/panel_node_align.yy b/scripts/panel_node_align/panel_node_align.yy new file mode 100644 index 000000000..77b363d76 --- /dev/null +++ b/scripts/panel_node_align/panel_node_align.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_node_align", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "graph", + "path": "folders/panels/graph.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_workspace/panel_workspace.gml b/scripts/panel_workspace/panel_workspace.gml index 5a1e49e00..2e86be341 100644 --- a/scripts/panel_workspace/panel_workspace.gml +++ b/scripts/panel_workspace/panel_workspace.gml @@ -24,7 +24,7 @@ function Panel_Workspace() : PanelContent() constructor { function onFocusBegin() { refreshContent(); } function drawContent(panel) { - draw_clear(COLORS.panel_bg_clear); + draw_clear_alpha(COLORS.panel_bg_clear, 0); var _hori = hori; hori = w > h; diff --git a/scripts/panel_workspace/panel_workspace.yy b/scripts/panel_workspace/panel_workspace.yy index 833683667..e3bf11744 100644 --- a/scripts/panel_workspace/panel_workspace.yy +++ b/scripts/panel_workspace/panel_workspace.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "menu", - "path": "folders/panels/menu.yy", + "name": "_others", + "path": "folders/panels/_others.yy", }, } \ No newline at end of file diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 091cfafe3..05fb6b26d 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -5,8 +5,7 @@ enum RENDER_TYPE { } #region globalvar - global.RENDER_DEBUG = false; - global.RENDER_LOG = false; + global.DEBUG_FLAG.render = false; global.group_inputs = [ "Node_Group_Input", "Node_Feedback_Input", "Node_Iterator_Input", "Node_Iterator_Each_Input" ]; #endregion @@ -22,7 +21,7 @@ function __nodeLeafList(_list) { var _startNode = _node.isRenderable(); if(_startNode) { array_push(nodes, _node); - LOG_IF(global.RENDER_LOG, "Push node " + _node.name + " to stack"); + LOG_IF(global.DEBUG_FLAG.render, "Push node " + _node.name + " to stack"); } } @@ -53,7 +52,7 @@ function __nodeInLoop(_node) { function Render(partial = false, runAction = false) { var t = current_time; LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ==="); + LOG_IF(global.DEBUG_FLAG.render, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ==="); try { var rendering = noone; @@ -85,7 +84,7 @@ function Render(partial = false, runAction = false) { if(!_node.active) continue; if(!_node.renderActive) continue; if(_node.rendered) { - LOG_IF(global.RENDER_LOG, "Skip rendered " + _node.name + " (" + _node.display_name + ")"); + LOG_IF(global.DEBUG_FLAG.render, "Skip rendered " + _node.name + " (" + _node.display_name + ")"); continue; } @@ -93,20 +92,20 @@ function Render(partial = false, runAction = false) { LOG_BLOCK_START(); - var _startNode = _node.isRenderable(global.RENDER_LOG); + var _startNode = _node.isRenderable(global.DEBUG_FLAG.render); if(_startNode) { - LOG_IF(global.RENDER_LOG, "Found leaf " + _node.name + " (" + _node.display_name + ")"); + LOG_IF(global.DEBUG_FLAG.render, "Found leaf " + _node.name + " (" + _node.display_name + ")"); _node.triggerRender(); ds_queue_enqueue(RENDER_QUEUE, _node); } else - LOG_IF(global.RENDER_LOG, "Skip non-leaf " + _node.name + " (" + _node.display_name + ")"); + LOG_IF(global.DEBUG_FLAG.render, "Skip non-leaf " + _node.name + " (" + _node.display_name + ")"); LOG_BLOCK_END(); } - LOG_IF(global.RENDER_LOG, "Get leaf complete: found " + string(ds_queue_size(RENDER_QUEUE)) + " leaves."); - LOG_IF(global.RENDER_LOG, "Start rendering..."); + LOG_IF(global.DEBUG_FLAG.render, "Get leaf complete: found " + string(ds_queue_size(RENDER_QUEUE)) + " leaves."); + LOG_IF(global.DEBUG_FLAG.render, "Start rendering..."); // render forward while(!ds_queue_empty(RENDER_QUEUE)) { @@ -114,7 +113,7 @@ function Render(partial = false, runAction = false) { var renderable = rendering.isRenderable(); LOG_BLOCK_START(); - LOG_IF(global.RENDER_LOG, "Rendering " + rendering.name + " (" + rendering.display_name + ") "); + LOG_IF(global.DEBUG_FLAG.render, "Rendering " + rendering.name + " (" + rendering.display_name + ") "); if(renderable) { rendering.doUpdate(); @@ -127,14 +126,14 @@ function Render(partial = false, runAction = false) { rendering.inspector1Update(); } - LOG_IF(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + (renderable? " [Update]" : " [Skip]")); + LOG_IF(global.DEBUG_FLAG.render, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + (renderable? " [Update]" : " [Skip]")); LOG_BLOCK_END(); } } catch(e) { noti_warning(exception_print(e)); } - LOG_IF(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n"); + LOG_IF(global.DEBUG_FLAG.render, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n"); LOG_END(); } @@ -148,9 +147,8 @@ function __renderListReset(list) { } function RenderList(list) { - var log = false; LOG_BLOCK_START(); - LOG_IF(log, "=== RENDER LIST START ==="); + LOG_IF(global.DEBUG_FLAG.render, "=== RENDER LIST START ==="); var queue = ds_queue_create(); try { @@ -175,8 +173,8 @@ function RenderList(list) { ds_queue_enqueue(queue, _node); } - LOG_IF(log, "Get leaf complete: found " + string(ds_queue_size(queue)) + " leaves."); - LOG_IF(log, "Start rendering..."); + LOG_IF(global.DEBUG_FLAG.render, "Get leaf complete: found " + string(ds_queue_size(queue)) + " leaves."); + LOG_IF(global.DEBUG_FLAG.render, "Start rendering..."); // render forward while(!ds_queue_empty(queue)) { @@ -185,7 +183,7 @@ function RenderList(list) { rendering.doUpdate(); - LOG_LINE_IF(log, "Rendering " + rendering.name + " (" + rendering.display_name + ") "); + LOG_LINE_IF(global.DEBUG_FLAG.render, "Rendering " + rendering.name + " (" + rendering.display_name + ") "); var nextNodes = rendering.getNextNodes(); for( var i = 0; i < array_length(nextNodes); i++ ) @@ -196,14 +194,14 @@ function RenderList(list) { noti_warning(exception_print(e)); } - LOG_IF(log, "=== RENDER COMPLETE ===\n"); + LOG_IF(global.DEBUG_FLAG.render, "=== RENDER COMPLETE ===\n"); LOG_END(); ds_queue_destroy(queue); } function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) { - printIf(global.RENDER_LOG, "=== RENDER LIST ACTION START [frame " + string(ANIMATOR.current_frame) + "] ==="); + printIf(global.DEBUG_FLAG.render, "=== RENDER LIST ACTION START [frame " + string(ANIMATOR.current_frame) + "] ==="); try { var rendering = noone; @@ -226,7 +224,7 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) { if(_node.isRenderable()) { ds_queue_enqueue(RENDER_QUEUE, _node); - printIf(global.RENDER_LOG, " > Push " + _node.name + " (" + _node.display_name + ") node to stack"); + printIf(global.DEBUG_FLAG.render, " > Push " + _node.name + " (" + _node.display_name + ") node to stack"); } } @@ -241,7 +239,7 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) { rendering.doUpdate(); if(rendering.hasInspector1Update()) { rendering.inspector1Update(); - printIf(global.RENDER_LOG, " > Toggle manual execution " + rendering.name + " (" + rendering.display_name + ")"); + printIf(global.DEBUG_FLAG.render, " > Toggle manual execution " + rendering.name + " (" + rendering.display_name + ")"); } var nextNodes = rendering.getNextNodes(); @@ -249,10 +247,10 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) { ds_queue_enqueue(RENDER_QUEUE, nextNodes[i]); } - printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + txt); + printIf(global.DEBUG_FLAG.render, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + txt); } - printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n"); + printIf(global.DEBUG_FLAG.render, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n"); } catch(e) { noti_waning(exception_print(e)); }