From c0ddfda834ba750b939cfcefd1721ef84dd0dd0b Mon Sep 17 00:00:00 2001 From: Tanasart Date: Fri, 17 Jan 2025 11:44:14 +0700 Subject: [PATCH] node manager --- PixelComposer.resource_order | 1 + PixelComposer.yyp | 13 +-- datafiles/data/Nodes/Internal.zip | Bin 9092560 -> 9092560 bytes scripts/panel_menu/panel_menu.gml | 3 +- .../panel_node_manager/panel_node_manager.gml | 106 ++++++++++++++++++ .../panel_node_manager/panel_node_manager.yy | 14 +++ 6 files changed, 126 insertions(+), 11 deletions(-) create mode 100644 scripts/panel_node_manager/panel_node_manager.gml create mode 100644 scripts/panel_node_manager/panel_node_manager.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index b251f7020..6ff97b96c 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -2168,6 +2168,7 @@ {"name":"s_node_mirror_polar","order":25,"path":"sprites/s_node_mirror_polar/s_node_mirror_polar.yy",}, {"name":"s_node_mirror","order":3,"path":"sprites/s_node_mirror/s_node_mirror.yy",}, {"name":"s_node_mk_blinker","order":10,"path":"sprites/s_node_mk_blinker/s_node_mk_blinker.yy",}, + {"name":"panel_node_manager","order":6,"path":"scripts/panel_node_manager/panel_node_manager.yy",}, {"name":"s_node_mk_brownian","order":8,"path":"sprites/s_node_mk_brownian/s_node_mk_brownian.yy",}, {"name":"s_node_mk_delay_machine","order":12,"path":"sprites/s_node_mk_delay_machine/s_node_mk_delay_machine.yy",}, {"name":"s_node_mk_fall","order":9,"path":"sprites/s_node_mk_fall/s_node_mk_fall.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index b660bbd14..db4ab8311 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -1242,11 +1242,7 @@ {"$GMIncludedFile":"","%Name":"Update.ps1","CopyToMask":-1,"filePath":"datafiles/data/Nodes","name":"Update.ps1","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"tileset_gamemaker2_room.yy","CopyToMask":-1,"filePath":"datafiles/data/TemplateStrings","name":"tileset_gamemaker2_room.yy","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"Theme.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Theme.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, - {"$GMIncludedFile":"","%Name":"dllcredits.txt","ConfigValues":{ - "Itch":{ - "CopyToMask":"0", - }, - },"CopyToMask":0,"filePath":"datafiles","name":"dllcredits.txt","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"dllcredits.txt","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":0,"filePath":"datafiles","name":"dllcredits.txt","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"dlltest1.dll","CopyToMask":-1,"filePath":"datafiles","name":"dlltest1.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"ffmpeg.exe","CopyToMask":-1,"filePath":"datafiles/ffmpeg/bin","name":"ffmpeg.exe","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"LICENSE","CopyToMask":-1,"filePath":"datafiles/ffmpeg","name":"LICENSE","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, @@ -1265,11 +1261,7 @@ {"$GMIncludedFile":"","%Name":"mf.dll","CopyToMask":-1,"filePath":"datafiles","name":"mf.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles","name":"mfcore.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles","name":"mfplat.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, - {"$GMIncludedFile":"","%Name":"PixelComposer_profile-2.provisionprofile","ConfigValues":{ - "Itch":{ - "CopyToMask":"2", - }, - },"CopyToMask":-1,"filePath":"datafiles","name":"PixelComposer_profile-2.provisionprofile","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"PixelComposer_profile-2.provisionprofile","ConfigValues":{"Itch":{"CopyToMask":"2",},},"CopyToMask":-1,"filePath":"datafiles","name":"PixelComposer_profile-2.provisionprofile","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"data.win","CopyToMask":-1,"filePath":"datafiles/report","name":"data.win","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"execute_shell_simple_ext_x64.dll","CopyToMask":-1,"filePath":"datafiles/report","name":"execute_shell_simple_ext_x64.dll","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"options.ini","CopyToMask":-1,"filePath":"datafiles/report","name":"options.ini","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, @@ -2697,6 +2689,7 @@ {"id":{"name":"sh_blend_replace","path":"shaders/sh_blend_replace/sh_blend_replace.yy",},}, {"id":{"name":"sh_blend_sat","path":"shaders/sh_blend_sat/sh_blend_sat.yy",},}, {"id":{"name":"sh_blend_screen","path":"shaders/sh_blend_screen/sh_blend_screen.yy",},}, + {"id":{"name":"panel_node_manager","path":"scripts/panel_node_manager/panel_node_manager.yy",},}, {"id":{"name":"sh_blend_soft_light","path":"shaders/sh_blend_soft_light/sh_blend_soft_light.yy",},}, {"id":{"name":"sh_blend_subtract","path":"shaders/sh_blend_subtract/sh_blend_subtract.yy",},}, {"id":{"name":"sh_blend_vivid_light","path":"shaders/sh_blend_vivid_light/sh_blend_vivid_light.yy",},}, diff --git a/datafiles/data/Nodes/Internal.zip b/datafiles/data/Nodes/Internal.zip index 64b50ae3b236ecc0072ee46fdb36264c05214c19..c73c49f3436872319c955b5ccdfb8696937126ec 100644 GIT binary patch delta 1312 zcmZ9~OH5Q}6bJA+LPteN=b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Q@OjRKj(i^37B;QKVyF=D;v1D>ww3yW?(#UG(^zSy)Z6EbZ9t)X`l4BurD>KGJPZvw$pKf!bWc=Mbd(0v!`g+Xz qMDy{#O-&Vs&BDawVAwj&&u)^Y*2|k;hRtHT&|ja7_4JxeHLn0e^yv}+ diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index ea6a5015a..68163e5fb 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -262,7 +262,8 @@ function Panel_Menu() : PanelContent() constructor { -1, menuItem(__txt("Collection Manager"), function() /*=>*/ { dialogPanelCall(new Panel_Collection_Manager());}), - menuItem(__txtx("panel_menu_test_load_nodes", "Load all nodes"), function() /*=>*/ { __test_load_all_nodes(); }), + menuItem(__txt("Nodes Manager"), function() /*=>*/ { dialogPanelCall(new Panel_Nodes_Manager()); }), + // menuItem(__txtx("panel_menu_test_load_nodes", "Load all nodes"), () => { __test_load_all_nodes(); }), // menuItem(__txtx("panel_menu_test_gen_guide", "Generate node guide"), () => { dialogPanelCall(new Panel_Node_Data_Gen()); }), // menuItem(__txtx("panel_menu_test_gen_theme", "Generate theme object"), () => { __test_generate_theme(); }), -1, diff --git a/scripts/panel_node_manager/panel_node_manager.gml b/scripts/panel_node_manager/panel_node_manager.gml new file mode 100644 index 000000000..985bba856 --- /dev/null +++ b/scripts/panel_node_manager/panel_node_manager.gml @@ -0,0 +1,106 @@ +function Panel_Nodes_Manager() : PanelContent() constructor { + w = ui(600); + h = ui(480); + + title = "Nodes Manager"; + auto_pin = true; + padding = ui(4); + content_w = w - ui(200); + + stack = ds_stack_create(); + internalDir = new DirectoryObject("D:/Project/MakhamDev/LTS-PixelComposer/PixelComposer/datafiles/data/Nodes/Internal") + .scan(["NodeObject"]); + + sc_content = new scrollPane(content_w, h, function(_y, _m) { + draw_clear_alpha(COLORS.panel_bg_clear_inner, 1); + var _h = 0; + var hg = ui(20); + var yy = _y; + var ww = sc_content.surface_w; + + var _hover = sc_content.hover; + var _focus = sc_content.active; + + ds_stack_clear(stack); + + var _list = internalDir.subDir; + for( var i = 0, n = ds_list_size(_list); i < n; i++ ) + ds_stack_push(stack, [ _list[| i], 0]); + + while(!ds_stack_empty(stack)) { + var _stack = ds_stack_pop(stack); + var st = _stack[0]; + var ly = _stack[1]; + + var _list = st.subDir; + for( var i = 0, n = ds_list_size(_list); i < n; i++ ) + ds_stack_push(stack, [ _list[| i], ly + 1]); + + var cc = COLORS._main_text_sub; + if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, ww, yy + hg - 1)) { + cc = COLORS._main_text; + + } + + draw_set_text(f_p2, fa_left, fa_center, cc); + draw_text_add(ui(8 + ly * 16 + 8), yy + hg / 2, st.name); + + _h += hg; + yy += hg; + + if(!st.open) continue; + + var _list = st.content; + for( var i = 0, n = ds_list_size(_list); i < n; i++ ) { + var _con = _list[| i]; + + draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text); + draw_text_add(ui(8 + ly * 16), yy + hg / 2, _con.name); + + _h += hg; + yy += hg; + } + } + + return _h; + }); + + function drawContent(panel) { + draw_clear_alpha(COLORS.panel_bg_clear, 1); + + content_w = w - ui(200); + + // Lists + + var _pd = padding; + var ndx = _pd; + var ndy = _pd; + var ndw = content_w + ui(16); + var ndh = h - _pd * 2; + + draw_sprite_stretched(THEME.ui_panel_bg, 1, ndx, ndy, ndw, ndh); + + sc_content.verify(content_w, ndh - ui(16)); + sc_content.setFocusHover(pFOCUS, pHOVER); + sc_content.drawOffset(ndx + ui(8), ndy + ui(8), mx, my); + + // Button + + var lx = ndx + ndw + ui(8); + + var bw = w - _pd - lx; + var bh = TEXTBOX_HEIGHT; + var bx = lx; + var by = _pd; + + if(buttonInstant(THEME.button_def, bx, by, bw, bh, [ mx, my ], pHOVER, pFOCUS) == 2) + __test_load_all_nodes(); + + draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text); + draw_text_add(bx + bw / 2, by + bh / 2, "Load All Nodes"); + + by += bh + ui(4); + + } + +} \ No newline at end of file diff --git a/scripts/panel_node_manager/panel_node_manager.yy b/scripts/panel_node_manager/panel_node_manager.yy new file mode 100644 index 000000000..081e87df6 --- /dev/null +++ b/scripts/panel_node_manager/panel_node_manager.yy @@ -0,0 +1,14 @@ +{ + "$GMScript":"v1", + "%Name":"panel_node_manager", + "isCompatibility":false, + "isDnD":false, + "name":"panel_node_manager", + "parent":{ + "name":"debug", + "path":"folders/panels/_others/debug.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", + "tags":[], +} \ No newline at end of file