From 5589a07be6a17dd999eb56c7d365f9101ac1068c Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 30 Oct 2024 15:09:52 +0700 Subject: [PATCH] - [Add node] Sections are now collapsible. - [Add node, inspector panel] Double click on section to collapses/expands all. --- PixelComposer.resource_order | 13 +- PixelComposer.yyp | 10 +- objects/o_dialog_add_node/Create_0.gml | 106 ++++- objects/o_dialog_add_node/Destroy_0.gml | 1 + objects/o_main/Draw_75.gml | 18 + scripts/__tiler_rule/__tiler_rule.gml | 377 +++++++++++++++++ scripts/binder_gamemaker/binder_gamemaker.gml | 113 ++++- scripts/canvas_tool_node/canvas_tool_node.gml | 4 +- .../draw_sprite_ext_override.gml | 6 +- scripts/gamemakerPathBox/gamemakerPathBox.gml | 52 +++ scripts/gamemakerPathBox/gamemakerPathBox.yy | 13 + scripts/globals/globals.gml | 2 +- scripts/node_composite/node_composite.gml | 5 +- scripts/node_data/node_data.gml | 3 +- scripts/node_registry/node_registry.gml | 7 +- scripts/node_tiler/node_tiler.gml | 70 +--- .../node_tiler_render/node_tiler_render.gml | 51 +++ .../node_tiler_render/node_tiler_render.yy | 13 + scripts/node_tiler_rule/node_tiler_rule.gml | 82 ++++ scripts/node_tiler_rule/node_tiler_rule.yy | 13 + .../node_tiler_tileset/node_tiler_tileset.gml | 396 +++--------------- scripts/node_value/node_value.gml | 6 +- .../node_value_dimension.gml | 11 +- scripts/panel_addon/panel_addon.gml | 6 +- .../panel_gm_explorer/panel_gm_explorer.gml | 141 +++++++ .../panel_gm_explorer/panel_gm_explorer.yy | 13 + scripts/panel_graph/panel_graph.gml | 9 + scripts/panel_inspector/panel_inspector.gml | 68 ++- scripts/pathnodeBox/pathnodeBox.gml | 4 +- scripts/project_data/project_data.gml | 18 +- scripts/tilesetBox/tilesetBox.gml | 6 +- .../a88c0c6e-7b5b-4d21-9e05-efa98490498f.png | Bin 0 -> 407 bytes .../cc462eeb-166f-485a-8e0a-f62059f49d24.png | Bin 0 -> 407 bytes sprites/s_gamemaker/s_gamemaker.yy | 90 ++++ sprites/s_node_tileset/s_node_tileset.yy | 4 +- .../s_node_tileset_drawer.yy | 4 +- .../41ad1ef4-812c-4234-873f-50652a2e18cb.png | Bin 1476 -> 0 bytes .../fab849f5-5a5b-45e3-b20b-6e6adf4ef06a.png | Bin 0 -> 1117 bytes .../fc03369a-caa3-4b07-9134-abc0293d62e6.png | Bin 1476 -> 0 bytes .../b15d1c5b-5a69-4cde-a6bd-4a2d5d4b6872.png | Bin 0 -> 1117 bytes .../s_node_tileset_export.yy | 16 +- .../e3ed7e8b-cdba-4e78-ad91-517384a46d66.png | Bin 0 -> 1288 bytes .../1edcfe67-256c-45b7-a151-3e2c838774e2.png | Bin 0 -> 1288 bytes .../s_node_tileset_render.yy | 90 ++++ .../a6dd42e2-e4cd-4977-bf7f-1b896802b5cd.png | Bin 0 -> 1325 bytes .../02fd5ff2-e948-44f5-b5b4-c922da3a0973.png | Bin 0 -> 1325 bytes .../s_node_tileset_rule.yy | 90 ++++ 47 files changed, 1449 insertions(+), 482 deletions(-) create mode 100644 scripts/gamemakerPathBox/gamemakerPathBox.gml create mode 100644 scripts/gamemakerPathBox/gamemakerPathBox.yy create mode 100644 scripts/node_tiler_render/node_tiler_render.gml create mode 100644 scripts/node_tiler_render/node_tiler_render.yy create mode 100644 scripts/node_tiler_rule/node_tiler_rule.gml create mode 100644 scripts/node_tiler_rule/node_tiler_rule.yy create mode 100644 scripts/panel_gm_explorer/panel_gm_explorer.gml create mode 100644 scripts/panel_gm_explorer/panel_gm_explorer.yy create mode 100644 sprites/s_gamemaker/a88c0c6e-7b5b-4d21-9e05-efa98490498f.png create mode 100644 sprites/s_gamemaker/layers/a88c0c6e-7b5b-4d21-9e05-efa98490498f/cc462eeb-166f-485a-8e0a-f62059f49d24.png create mode 100644 sprites/s_gamemaker/s_gamemaker.yy delete mode 100644 sprites/s_node_tileset_export/41ad1ef4-812c-4234-873f-50652a2e18cb.png create mode 100644 sprites/s_node_tileset_export/fab849f5-5a5b-45e3-b20b-6e6adf4ef06a.png delete mode 100644 sprites/s_node_tileset_export/layers/41ad1ef4-812c-4234-873f-50652a2e18cb/fc03369a-caa3-4b07-9134-abc0293d62e6.png create mode 100644 sprites/s_node_tileset_export/layers/fab849f5-5a5b-45e3-b20b-6e6adf4ef06a/b15d1c5b-5a69-4cde-a6bd-4a2d5d4b6872.png create mode 100644 sprites/s_node_tileset_render/e3ed7e8b-cdba-4e78-ad91-517384a46d66.png create mode 100644 sprites/s_node_tileset_render/layers/e3ed7e8b-cdba-4e78-ad91-517384a46d66/1edcfe67-256c-45b7-a151-3e2c838774e2.png create mode 100644 sprites/s_node_tileset_render/s_node_tileset_render.yy create mode 100644 sprites/s_node_tileset_rule/a6dd42e2-e4cd-4977-bf7f-1b896802b5cd.png create mode 100644 sprites/s_node_tileset_rule/layers/a6dd42e2-e4cd-4977-bf7f-1b896802b5cd/02fd5ff2-e948-44f5-b5b4-c922da3a0973.png create mode 100644 sprites/s_node_tileset_rule/s_node_tileset_rule.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index f10d5f4d5..d6d4e3104 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -127,6 +127,7 @@ {"name":"blur","order":60,"path":"folders/nodes/icons/filter/blur.yy",}, {"name":"fluidSim","order":3,"path":"folders/nodes/icons/fluidSim.yy",}, {"name":"generator","order":4,"path":"folders/nodes/icons/generator.yy",}, + {"name":"tiler","order":17,"path":"folders/nodes/icons/tiler.yy",}, {"name":"IO","order":5,"path":"folders/nodes/icons/IO.yy",}, {"name":"misc","order":6,"path":"folders/nodes/icons/misc.yy",}, {"name":"MK effects","order":7,"path":"folders/nodes/icons/MK effects.yy",}, @@ -671,6 +672,7 @@ {"name":"function_register","order":2,"path":"scripts/function_register/function_register.yy",}, {"name":"fx_controller","order":1,"path":"scripts/fx_controller/fx_controller.yy",}, {"name":"gameframe","order":3,"path":"scripts/gameframe/gameframe.yy",}, + {"name":"gamemakerPathBox","order":1,"path":"scripts/gamemakerPathBox/gamemakerPathBox.yy",}, {"name":"getGradientData","order":1,"path":"scripts/getGradientData/getGradientData.yy",}, {"name":"gif_reader","order":4,"path":"scripts/gif_reader/gif_reader.yy",}, {"name":"globals","order":2,"path":"scripts/globals/globals.yy",}, @@ -1177,6 +1179,8 @@ {"name":"node_tile_random","order":16,"path":"scripts/node_tile_random/node_tile_random.yy",}, {"name":"node_tile","order":5,"path":"scripts/node_tile/node_tile.yy",}, {"name":"node_tiler_export","order":5,"path":"scripts/node_tiler_export/node_tiler_export.yy",}, + {"name":"node_tiler_render","order":7,"path":"scripts/node_tiler_render/node_tiler_render.yy",}, + {"name":"node_tiler_rule","order":6,"path":"scripts/node_tiler_rule/node_tiler_rule.yy",}, {"name":"node_tiler_tileset","order":3,"path":"scripts/node_tiler_tileset/node_tiler_tileset.yy",}, {"name":"node_time_remap","order":3,"path":"scripts/node_time_remap/node_time_remap.yy",}, {"name":"node_timeline_preview","order":2,"path":"scripts/node_timeline_preview/node_timeline_preview.yy",}, @@ -1298,6 +1302,7 @@ {"name":"panel_file_explorer","order":12,"path":"scripts/panel_file_explorer/panel_file_explorer.yy",}, {"name":"panel_function","order":1,"path":"scripts/panel_function/panel_function.yy",}, {"name":"panel_globalvar","order":1,"path":"scripts/panel_globalvar/panel_globalvar.yy",}, + {"name":"panel_gm_explorer","order":13,"path":"scripts/panel_gm_explorer/panel_gm_explorer.yy",}, {"name":"panel_gradient","order":2,"path":"scripts/panel_gradient/panel_gradient.yy",}, {"name":"panel_graph_connection_settings","order":6,"path":"scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy",}, {"name":"panel_graph_export_image_dialog","order":5,"path":"scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.yy",}, @@ -1971,6 +1976,7 @@ {"name":"s_folder_add","order":66,"path":"sprites/s_folder_add/s_folder_add.yy",}, {"name":"s_folder_content","order":67,"path":"sprites/s_folder_content/s_folder_content.yy",}, {"name":"s_frame_range","order":68,"path":"sprites/s_frame_range/s_frame_range.yy",}, + {"name":"s_gamemaker","order":2,"path":"sprites/s_gamemaker/s_gamemaker.yy",}, {"name":"s_gear_16","order":230,"path":"sprites/s_gear_16/s_gear_16.yy",}, {"name":"s_gear_24","order":69,"path":"sprites/s_gear_24/s_gear_24.yy",}, {"name":"s_gizmo","order":4,"path":"sprites/s_gizmo/s_gizmo.yy",}, @@ -2581,9 +2587,10 @@ {"name":"s_node_texture_map","order":53,"path":"sprites/s_node_texture_map/s_node_texture_map.yy",}, {"name":"s_node_threshold","order":54,"path":"sprites/s_node_threshold/s_node_threshold.yy",}, {"name":"s_node_tile_random","order":22,"path":"sprites/s_node_tile_random/s_node_tile_random.yy",}, - {"name":"s_node_tileset_drawer","order":41,"path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",}, - {"name":"s_node_tileset_export","order":42,"path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",}, - {"name":"s_node_tileset","order":40,"path":"sprites/s_node_tileset/s_node_tileset.yy",}, + {"name":"s_node_tileset_drawer","order":2,"path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",}, + {"name":"s_node_tileset_export","order":3,"path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",}, + {"name":"s_node_tileset_rule","order":4,"path":"sprites/s_node_tileset_rule/s_node_tileset_rule.yy",}, + {"name":"s_node_tileset","order":1,"path":"sprites/s_node_tileset/s_node_tileset.yy",}, {"name":"s_node_time_map","order":55,"path":"sprites/s_node_time_map/s_node_time_map.yy",}, {"name":"s_node_timeline_preview","order":2,"path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",}, {"name":"s_node_to_number","order":11,"path":"sprites/s_node_to_number/s_node_to_number.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 6382a36db..ee1d23449 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -114,8 +114,8 @@ {"$GMFolder":"","%Name":"vector","folderPath":"folders/functions/vector.yy","name":"vector","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"window","folderPath":"folders/functions/window.yy","name":"window","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"main","folderPath":"folders/main.yy","name":"main","resourceType":"GMFolder","resourceVersion":"2.0",}, - {"$GMFolder":"","%Name":"components","folderPath":"folders/main/components.yy","name":"components","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"binder","folderPath":"folders/main/binder.yy","name":"binder","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"components","folderPath":"folders/main/components.yy","name":"components","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"misc","folderPath":"folders/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"fx","folderPath":"folders/misc/fx.yy","name":"fx","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"nodes","folderPath":"folders/nodes.yy","name":"nodes","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -227,6 +227,7 @@ {"$GMFolder":"","%Name":"blur","folderPath":"folders/nodes/icons/filter/blur.yy","name":"blur","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"fluidSim","folderPath":"folders/nodes/icons/fluidSim.yy","name":"fluidSim","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"generator","folderPath":"folders/nodes/icons/generator.yy","name":"generator","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"tiler","folderPath":"folders/nodes/icons/tiler.yy","name":"tiler","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"IO","folderPath":"folders/nodes/icons/IO.yy","name":"IO","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"misc","folderPath":"folders/nodes/icons/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"MK effects","folderPath":"folders/nodes/icons/MK effects.yy","name":"MK effects","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -1204,6 +1205,7 @@ {"id":{"name":"function_register","path":"scripts/function_register/function_register.yy",},}, {"id":{"name":"fx_controller","path":"scripts/fx_controller/fx_controller.yy",},}, {"id":{"name":"gameframe","path":"scripts/gameframe/gameframe.yy",},}, + {"id":{"name":"gamemakerPathBox","path":"scripts/gamemakerPathBox/gamemakerPathBox.yy",},}, {"id":{"name":"getGradientData","path":"scripts/getGradientData/getGradientData.yy",},}, {"id":{"name":"gif_reader","path":"scripts/gif_reader/gif_reader.yy",},}, {"id":{"name":"globals","path":"scripts/globals/globals.yy",},}, @@ -1783,6 +1785,8 @@ {"id":{"name":"node_tile_random","path":"scripts/node_tile_random/node_tile_random.yy",},}, {"id":{"name":"node_tile","path":"scripts/node_tile/node_tile.yy",},}, {"id":{"name":"node_tiler_export","path":"scripts/node_tiler_export/node_tiler_export.yy",},}, + {"id":{"name":"node_tiler_render","path":"scripts/node_tiler_render/node_tiler_render.yy",},}, + {"id":{"name":"node_tiler_rule","path":"scripts/node_tiler_rule/node_tiler_rule.yy",},}, {"id":{"name":"node_tiler_tileset","path":"scripts/node_tiler_tileset/node_tiler_tileset.yy",},}, {"id":{"name":"node_tiler","path":"scripts/node_tiler/node_tiler.yy",},}, {"id":{"name":"node_time_remap","path":"scripts/node_time_remap/node_time_remap.yy",},}, @@ -1922,6 +1926,7 @@ {"id":{"name":"panel_file_explorer","path":"scripts/panel_file_explorer/panel_file_explorer.yy",},}, {"id":{"name":"panel_function","path":"scripts/panel_function/panel_function.yy",},}, {"id":{"name":"panel_globalvar","path":"scripts/panel_globalvar/panel_globalvar.yy",},}, + {"id":{"name":"panel_gm_explorer","path":"scripts/panel_gm_explorer/panel_gm_explorer.yy",},}, {"id":{"name":"panel_gradient","path":"scripts/panel_gradient/panel_gradient.yy",},}, {"id":{"name":"panel_graph_connection_settings","path":"scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy",},}, {"id":{"name":"panel_graph_export_image_dialog","path":"scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.yy",},}, @@ -2690,6 +2695,7 @@ {"id":{"name":"s_folder_content","path":"sprites/s_folder_content/s_folder_content.yy",},}, {"id":{"name":"s_frame_range","path":"sprites/s_frame_range/s_frame_range.yy",},}, {"id":{"name":"s_fx_pixel","path":"sprites/s_fx_pixel/s_fx_pixel.yy",},}, + {"id":{"name":"s_gamemaker","path":"sprites/s_gamemaker/s_gamemaker.yy",},}, {"id":{"name":"s_gear_16","path":"sprites/s_gear_16/s_gear_16.yy",},}, {"id":{"name":"s_gear_24","path":"sprites/s_gear_24/s_gear_24.yy",},}, {"id":{"name":"s_gizmo","path":"sprites/s_gizmo/s_gizmo.yy",},}, @@ -3336,6 +3342,8 @@ {"id":{"name":"s_node_tile_random","path":"sprites/s_node_tile_random/s_node_tile_random.yy",},}, {"id":{"name":"s_node_tileset_drawer","path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",},}, {"id":{"name":"s_node_tileset_export","path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",},}, + {"id":{"name":"s_node_tileset_render","path":"sprites/s_node_tileset_render/s_node_tileset_render.yy",},}, + {"id":{"name":"s_node_tileset_rule","path":"sprites/s_node_tileset_rule/s_node_tileset_rule.yy",},}, {"id":{"name":"s_node_tileset","path":"sprites/s_node_tileset/s_node_tileset.yy",},}, {"id":{"name":"s_node_time_map","path":"sprites/s_node_time_map/s_node_time_map.yy",},}, {"id":{"name":"s_node_timeline_preview","path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",},}, diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 1e06ce929..1fbdafc8c 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -40,7 +40,8 @@ event_inherited(); tooltip_surface = -1; content_hoverable = true; - canvas = false; + canvas = false; + collapsed = ds_map_create(); #region ---- category ---- category = NODE_CATEGORY; @@ -48,7 +49,7 @@ event_inherited(); case "Node_Pixel_Builder" : category = NODE_PB_CATEGORY; break; case "Node_DynaSurf" : category = NODE_PCX_CATEGORY; break; } - + draw_set_font(f_p0); var maxLen = 0; for(var i = 0; i < ds_list_size(category); i++) { @@ -388,6 +389,7 @@ event_inherited(); content_pane = new scrollPane(dialog_w - category_width - ui(8), dialog_h - ui(66), function(_y, _m) { draw_clear_alpha(c_white, 0); var _hover = sHOVER && content_pane.hover; + var _focus = sFOCUS && content_pane.active; var _list = node_list; var ww = content_pane.surface_w; var hh = 0; @@ -489,16 +491,26 @@ event_inherited(); if(is_string(_node)) { if(!PREFERENCES.dialog_add_node_grouping) continue; + hh += curr_height; yy += curr_height; cProg = 0; curr_height = 0; + var _key = $"{ADD_NODE_PAGE}:{index}"; - array_push(group_labels, { y: yy, text: __txt(_node) }); + array_push(group_labels, { y: yy, text: __txt(_node), key: _key }); - hh += ui(24 + 12); - yy += ui(24 + 12); + if(ds_map_exists(collapsed, _key)) { + hh += ui(24 + 4); + yy += ui(24 + 4); + + while(index + 1 < node_count && !is_string(_list[| index + 1])) + index++; + } else { + hh += ui(24 + 12); + yy += ui(24 + 12); + } continue; } @@ -583,17 +595,42 @@ event_inherited(); content_hoverable &= !point_in_rectangle(_m[0], _m[1], 0, 0, ww, ui(36)); } + var _lbh = ui(24); + var _cAll = 0; + for( var i = 0; i < len; i++ ) { - var lb = group_labels[i]; - var _yy = max(lb.y, i == len - 1? ui(8) : min(ui(8), group_labels[i + 1].y - ui(32))); + var lb = group_labels[i]; + var _name = lb.text; + var _key = lb.key; + var _coll = ds_map_exists(collapsed, _key); + + var _yy = max(lb.y, i == len - 1? ui(8) : min(ui(8), group_labels[i + 1].y - ui(32))); BLEND_OVERRIDE; - draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, ui(16), _yy, ww - ui(32), ui(24), c_white, 0.3); + if(_hover && point_in_rectangle(_m[0], _m[1], 0, _yy, ww, _yy + _lbh)) { + draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, ui(16), _yy, ww - ui(32), _lbh, COLORS.panel_inspector_group_hover, 1); + if(_focus) { + if(DOUBLE_CLICK) { + _cAll = _coll? -1 : 1; + + } else if(mouse_press(mb_left)) { + if(_coll) ds_map_delete(collapsed, _key); + else ds_map_add(collapsed, _key, 1); + } + } + + } else + draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, ui(16), _yy, ww - ui(32), _lbh, COLORS.panel_inspector_group_bg, 1); BLEND_NORMAL; + draw_sprite_ui(THEME.arrow, _coll? 0 : 3, ui(16 + 16), _yy + _lbh / 2, 1, 1, 0, CDEF.main_ltgrey, 1); + draw_set_text(f_p2, fa_left, fa_center, CDEF.main_ltgrey); - draw_text_add(ui(16 + 16), _yy + ui(12), lb.text); + draw_text_add(ui(16 + 28), _yy + _lbh / 2, _name); } + + if(_cAll == 1) { for( var i = 0; i < len; i++ ) ds_map_delete(collapsed, group_labels[i].key); } + else if(_cAll == -1) { for( var i = 0; i < len; i++ ) ds_map_add(collapsed, group_labels[i].key, 1); } } hh += curr_height; @@ -627,13 +664,20 @@ event_inherited(); hh += ui(8); yy += ui(8); - array_push(group_labels, { - y: yy, - text: __txt(_node) - }); + var _key = $"{ADD_NODE_PAGE}:{i}"; - hh += ui(32); - yy += ui(32); + array_push(group_labels, { y: yy, text: __txt(_node), key: _key }); + + if(ds_map_exists(collapsed, _key)) { + hh += ui(24); + yy += ui(24); + + while(i + 1 < node_count && !is_string(_list[| i + 1])) + i++; + } else { + hh += ui(32); + yy += ui(32); + } continue; } @@ -698,17 +742,41 @@ event_inherited(); content_hoverable &= !point_in_rectangle(_m[0], _m[1], 0, 0, ww, ui(36)); } + var _lbh = ui(24); + var _cAll = 0; + for( var i = 0; i < len; i++ ) { var lb = group_labels[i]; + var _name = lb.text; + var _key = lb.key; + var _coll = ds_map_exists(collapsed, _key); var _yy = max(lb.y, i == len - 1? ui(8) : min(ui(8), group_labels[i + 1].y - ui(32))); BLEND_OVERRIDE; - draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, ui(16), _yy, ww - ui(32), ui(24), c_white, 0.3); + if(_hover && point_in_rectangle(_m[0], _m[1], 0, _yy, ww, _yy + _lbh)) { + draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, ui(16), _yy, ww - ui(32), _lbh, COLORS.panel_inspector_group_hover, 1); + if(_focus) { + if(DOUBLE_CLICK) { + _cAll = _coll? -1 : 1; + + } else if(mouse_press(mb_left)) { + if(_coll) ds_map_delete(collapsed, _key); + else ds_map_add(collapsed, _key, 1); + } + } + + } else + draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, ui(16), _yy, ww - ui(32), _lbh, COLORS.panel_inspector_group_bg, 1); BLEND_NORMAL; + draw_sprite_ui(THEME.arrow, _coll? 0 : 3, ui(16 + 16), _yy + _lbh / 2, 1, 1, 0, CDEF.main_ltgrey, 1); + draw_set_text(f_p2, fa_left, fa_center, CDEF.main_ltgrey); - draw_text_add(ui(16 + 16), _yy + ui(12), lb.text); + draw_text_add(ui(16 + 28), _yy + _lbh / 2, _name); } + + if(_cAll == 1) { for( var i = 0; i < len; i++ ) ds_map_delete(collapsed, group_labels[i].key); } + else if(_cAll == -1) { for( var i = 0; i < len; i++ ) ds_map_add(collapsed, group_labels[i].key, 1); } } if(sHOVER && key_mod_press(CTRL)) { @@ -724,8 +792,6 @@ event_inherited(); return hh; }); - - function setPage(pageIndex) { ADD_NODE_PAGE = min(pageIndex, ds_list_size(category) - 1); node_list = pageIndex < 0? noone : category[| ADD_NODE_PAGE].list; @@ -1097,4 +1163,4 @@ event_inherited(); return hh; }); -#endregion +#endregion \ No newline at end of file diff --git a/objects/o_dialog_add_node/Destroy_0.gml b/objects/o_dialog_add_node/Destroy_0.gml index 57c5dc646..fa37d199a 100644 --- a/objects/o_dialog_add_node/Destroy_0.gml +++ b/objects/o_dialog_add_node/Destroy_0.gml @@ -1,4 +1,5 @@ /// @description event_inherited(); +ds_map_destroy(collapsed); WIDGET_CURRENT = noone; \ No newline at end of file diff --git a/objects/o_main/Draw_75.gml b/objects/o_main/Draw_75.gml index bfa5ff777..7faf3fc7c 100644 --- a/objects/o_main/Draw_75.gml +++ b/objects/o_main/Draw_75.gml @@ -157,6 +157,24 @@ if(winMan_isMinimized()) exit; } break; + case "GMSprite" : + var _spr = DRAGGING.data.thumbnail; + if(_spr) { + var ss = ui(48) / max(sprite_get_width(_spr), sprite_get_height(_spr)) + draw_sprite_ext(_spr, 0, mx, my, ss, ss, 0, c_white, 1); + } + break; + + case "GMTileSet" : + var _spm = struct_try_get(DRAGGING.data.gmBinder.resourcesMap, DRAGGING.data.sprite, noone); + var _spr = _spm == noone? noone : _spm.thumbnail; + + if(_spr) { + var ss = ui(48) / max(sprite_get_width(_spr), sprite_get_height(_spr)) + draw_sprite_ext(_spr, 0, mx, my, ss, ss, 0, c_white, 1); + } + break; + default: draw_set_alpha(0.5); draw_set_text(f_h3, fa_center, fa_center, COLORS._main_text); diff --git a/scripts/__tiler_rule/__tiler_rule.gml b/scripts/__tiler_rule/__tiler_rule.gml index e9b35ae6b..cf0adfc50 100644 --- a/scripts/__tiler_rule/__tiler_rule.gml +++ b/scripts/__tiler_rule/__tiler_rule.gml @@ -97,4 +97,381 @@ function tiler_rule() constructor { return self; } +} + +function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constructor { + name = "Tile Riles"; + tileset = _tileset; + ruleTiles = []; + + rule_dragging = noone; + rule_selector_h = 0; + + renaming = noone; + rename_text = ""; + tb_rename = new textBox(TEXTBOX_INPUT.text, function(_name) { + if(renaming == noone) return; + renaming.name = _name; + renaming = noone; + }); + tb_rename.font = f_p2; + tb_rename.hide = true; + + temp_surface = [ 0, 0, 0 ]; + + function setTileset(_tileset) { tileset = _tileset; return self; } + + function draw(_x, _y, _w, _m, _hover, _focus, _panel = noone) { + var _yy = _y; + var _h = 0; + + var _tileSet = tileset.texture; + var _tileSiz = tileset.tileSize; + + if(!is_surface(_tileSet)) return _h; + var _tdim = surface_get_dimension(_tileSet); + var _tileAmo = [ floor(_tdim[0] / _tileSiz[0]), floor(_tdim[1] / _tileSiz[1]) ]; + + var bx = _x; + var by = _yy; + var bs = ui(24); + + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "New rule", THEME.add_16, 0, COLORS._main_value_positive) == 2) { + var _new_rl = new tiler_rule(); + _new_rl.name = $"rule {array_length(ruleTiles)}" + _new_rl.open = true; + array_push(ruleTiles, _new_rl); + tileset.triggerRender(); + } + + _h += bs + ui(4); + _yy += bs + ui(4); + + var _pd = ui(4); + var _ah = _pd * 2; + var del = -1; + var rl_iHover = 0; + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, rule_selector_h, COLORS.node_composite_bg_blend, 1); + + _yy += _pd; + + for( var i = 0, n = array_length(ruleTiles); i < n; i++ ) { + var _hg = ui(32); + var _rl = ruleTiles[i]; + + var _pw = ui(24); + var _ph = ui(24); + var _px = _x + ui(8); + var _py = _yy + ui(4); + + if(_m[1] > _yy) rl_iHover = i; + + var _prin = array_safe_get(_rl.replacements, 0, undefined); + + if(_prin == undefined) + draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon); + else if(is(_prin, tiler_rule_replacement)) { + var _ind = array_safe_get(_prin.index, 0); + tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _ind, _px, _py, _pw, _ph); + } + + var _tx = _px + _pw + ui(8); + var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1); + + if(renaming == _rl) { + tb_rename.setFocusHover(_focus, _hover); + tb_rename.draw(_tx, _yy, _w - _pw - ui(8), _hg, rename_text, _m); + + } else { + var _cc = _hov? COLORS._main_text : COLORS._main_text_sub; + if(rule_dragging == _rl) _cc = COLORS._main_accent; + + draw_set_text(f_p2, fa_left, fa_center, _cc); + draw_text_add(_tx, _yy + _hg / 2, _rl.name); + + var bs = ui(24); + var bx = _w - bs - ui(4); + var by = _yy + _hg / 2 - bs / 2; + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2) + del = i; + } + + if(_hov && _m[0] < _x + _w - ui(32 + 160)) { + if(_m[0] > _tx) { + + if(mouse_press(mb_left, _focus)) { + rule_dragging = _rl; + + } else if(DOUBLE_CLICK && _focus) { + renaming = _rl; + rename_text = _rl.name; + + tb_rename._current_text = _rl.name; + tb_rename.activate(); + } + + } else { + draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent); + + if(mouse_press(mb_left, _focus)) + _rl.open = !_rl.open; + } + } + + var _atWid = _rl.sl_prop; + var _scw = ui(120); + var _sch = ui(20); + var _scx = _x + _w - _scw - ui(32 + 8); + var _scy = _yy + _hg / 2 - _sch / 2; + + _atWid.setFocusHover(_focus, _hover); + _atWid.rx = rx; + _atWid.ry = ry; + _atWid.draw(_scx, _scy, _scw, _sch, _rl.probability, _m); + if(_rl.probability != _rl._probability) { + _rl._probability = _rl.probability; + tileset.triggerRender(); + } + + var _acw = ui(20); + var _ach = ui(20); + var _acx = _scx - _acw - ui(8); + var _acy = _yy + _hg / 2 - _sch / 2; + var _ahv = _hover && point_in_rectangle(_m[0], _m[1], _acx, _acy, _acx + _acw, _acy + _ach); + + if(_ahv) { + TOOLTIP = "Active"; + if(mouse_press(mb_left, _focus)) { + _rl.active = !_rl.active; + tileset.triggerRender(); + } + } + + draw_sprite_stretched_ext(THEME.checkbox_def, _ahv, _acx, _acy, _acw, _ach, c_white); + if(_rl.active) draw_sprite_stretched_ext(THEME.checkbox_def, 2, _acx, _acy, _acw, _ach, COLORS._main_accent); + + _yy += _hg; + _ah += _hg; + + if(_rl.open) { + _yy += ui(4); + _ah += ui(4); + + var _sls = ui(28); + var _radw = _rl.size[0] + _rl.range * 2; + var _radh = _rl.size[1] + _rl.range * 2; + var _slw = ui(16) + _radw * _sls; + var _slh = ui(16) + _radh * _sls; + var _hh0 = _slh; + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x + ui(8), _yy, _slw, _slh, COLORS.node_composite_bg_blend, 1); + + for( var j = 0, m = array_length(_rl.selection_rules); j < m; j++ ) { + var _rl_sel = _rl.selection_rules[j]; + var _rl_col = j % _radw; + var _rl_row = floor(j / _radw); + + var _cen = _rl_col >= _rl.range && _rl_col < _rl.range + _rl.size[0] && + _rl_row >= _rl.range && _rl_row < _rl.range + _rl.size[1]; + + var _rl_x = _x + ui(16) + _rl_col * _sls; + var _rl_y = _yy + ui( 8) + _rl_row * _sls; + + var _rl_selected = tileset.object_selecting == _rl && tileset.object_select_id == j; + var _rl_hov = _hover && point_in_rectangle(_m[0], _m[1], _rl_x, _rl_y, _rl_x + _sls - 1, _rl_y + _sls - 1); + var _pad = ui(2); + + var _cc = _rl_selected? COLORS._main_accent : COLORS._main_icon; + var _aa = _rl_selected? 1 : .5 + _rl_hov * .5; + + if(is_array(_rl_sel)) { + var _autt = tileset.autoterrain[_rl_sel[1]]; + tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _autt.index[0], _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); + draw_sprite_uniform(THEME.circle, 0, _rl_x + _sls - ui(8), _rl_y + _sls - ui(8), 1, COLORS._main_accent); + + } else if (_rl_sel == -10000) { + draw_sprite_uniform(THEME.cross, 0, _rl_x + _sls / 2, _rl_y + _sls / 2, 1, _cc, _aa); + + } else if(_rl_sel != -1) { + tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _rl_sel, _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); + + } else if(!_cen) _pad = ui(10); + + draw_sprite_stretched_ext(THEME.ui_panel, 1 + _cen, _rl_x + _pad, _rl_y + _pad, _sls - _pad * 2, _sls - _pad * 2, _cc, _aa); + + if(_rl_hov) { + if(mouse_press(mb_left, _focus)) { + tileset.object_selecting = _rl_selected? noone : _rl; + tileset.object_select_id = j; + tileset.triggerRender(); + } + + if(mouse_press(mb_right, _focus)) { + _rl.selection_rules[j] = -1; + tileset.object_selecting = noone; + tileset.object_select_id = noone; + tileset.triggerRender(); + } + } + } + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + var _rep = _rl.replacements; + var _siz = _rl.size; + + var _rpw = _sls * _siz[0]; + var _rph = _sls * _siz[1]; + + var _dx = ui(8) + _slw + ui(16); + var _slw = _w - _dx - ui(8); + var _rx; + + if((_rpw + ui(4)) * 2 > _slw - ui(16)) { + _yy += _slh + ui(8); + _ah += _slh + ui(8); + + draw_sprite_uniform(THEME.arrow, 0, _x + _w / 2, _yy + ui(6), 1, COLORS._main_icon, 1); + + _rx = _x + ui(8); + _slw = _w - ui(16); + _hh0 = 0; + + } else { + draw_sprite_uniform(THEME.arrow, 0, _x + ui(8) + _slw + ui(8), _yy + _slh / 2, 1, COLORS._main_icon, 1); + + _rx = _x + _dx; + _slw = _w - _dx - ui(8); + } + + var _col = max(1, floor((_slw - ui(16)) / (_rpw + ui(4)))); + var _row = ceil((array_length(_rep) + 1) / _col); + var _slh = ui(16) + _row * _rph; + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _rx, _yy, _slw, max(_hh0, _slh), COLORS.node_composite_bg_blend, 1); + + var del_rep = -1; + + for( var j = 0, m = array_length(_rep) + 1; j < m; j++ ) { + var _rcl = j % _col; + var _rrw = floor(j / _col); + + var _rpx = _rx + ui(8) + _rcl * (_rpw + ui(4)); + var _rpy = _yy + ui(8) + _rrw * _rph; + var _rl_hov = _hover && point_in_rectangle(_m[0], _m[1], _rpx, _rpy, _rpx + _rpw, _rpy + _rph); + + if(j == 0) { + var _cc = _rl_hov? COLORS._main_value_positive : COLORS._main_icon; + draw_sprite_uniform(THEME.add_16, 0, _rpx + _rpw / 2, _rpy + _rph / 2, 1, _cc); + + if(_rl_hov && mouse_press(mb_left, _focus)) { + var _new_rep = new tiler_rule_replacement([-1]); + array_push(_rl.replacements, _new_rep); + tileset.object_selecting = _new_rep; + tileset.object_select_id = _rl; + } + continue; + } + + var _replace = _rep[j - 1]; + var _repIndex = _replace.index; + if(!is_array(_repIndex)) continue; + + for( var k = 0, q = array_length(_repIndex); k < q; k++ ) { + var _repBlockCol = k % _siz[0]; + var _repBlockRow = floor(k / _siz[0]); + var _rpbx = _rpx + _repBlockCol * _sls; + var _rpby = _rpy + _repBlockRow * _sls; + + if(_replace.index[k] != -1) tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _replace.index[k], _rpbx, _rpby, _sls, _sls); + } + + var _rl_selected = tileset.object_selecting == _replace; + var _cc = _rl_selected? COLORS._main_accent : COLORS._main_icon; + var _aa = _rl_selected? 1 : .5 + _rl_hov * .5; + draw_sprite_stretched_ext(THEME.ui_panel, 1, _rpx, _rpy, _rpw, _rph, _cc, _aa); + + if(_rl_hov) { + if(mouse_press(mb_left, _focus)) { + tileset.object_selecting = tileset.object_selecting == _replace? noone : _replace; + tileset.object_select_id = _rl; + tileset.triggerRender(); + } + + if(mouse_press(mb_right, _focus)) { + del_rep = j; + tileset.triggerRender(); + } + } + } + + if(del_rep != -1) { + array_delete(_rep, del_rep, 1); + tileset.triggerRender(); + } + + _yy += max(_hh0, _slh) + ui(8); + _ah += max(_hh0, _slh) + ui(8); + + } + } + + if(rule_dragging != noone) { + array_remove(_rules, rule_dragging); + array_insert(_rules, rl_iHover, rule_dragging); + + if(mouse_release(mb_left)) { + rule_dragging = noone; + tileset.triggerRender(); + } + } + + if(del != -1) { + array_delete(_rules, del, 1); + tileset.triggerRender(); + } + + rule_selector_h = max(ui(12), _ah); + return _h + _ah; + } + + function apply(_tilemap, _seed) { + var _mapSize = surface_get_dimension(_tilemap); + temp_surface[0] = surface_verify(temp_surface[0], _mapSize[0], _mapSize[1], surface_rgba16float); + temp_surface[1] = surface_verify(temp_surface[1], _mapSize[0], _mapSize[1], surface_rgba16float); + temp_surface[2] = surface_verify(temp_surface[2], _mapSize[0], _mapSize[1], surface_r16float); + + var bg = 0; + surface_set_shader(temp_surface[1], sh_sample, true, BLEND.over); + draw_surface(_tilemap, 0, 0); + surface_reset_shader(); + + for( var i = 0, n = array_length(ruleTiles); i < n; i++ ) { + var _rule = ruleTiles[i]; + + if(!_rule.active) continue; + if(array_empty(_rule.replacements)) continue; + + surface_set_shader(temp_surface[2], sh_tile_rule_select, true, BLEND.over); + shader_set_2("dimension", _mapSize); + _rule.shader_select(tileset); + + draw_surface(_tilemap, 0, 0); + surface_reset_shader(); + + surface_set_shader(temp_surface[bg], sh_tile_rule_apply, true, BLEND.over); + shader_set_2("dimension", _mapSize); + shader_set_f("seed", _seed); + shader_set_surface("group", temp_surface[2]); + _rule.shader_submit(tileset); + + draw_surface(temp_surface[!bg], 0, 0); + surface_reset_shader(); + + bg = !bg; + } + + return temp_surface[!bg]; + } } \ No newline at end of file diff --git a/scripts/binder_gamemaker/binder_gamemaker.gml b/scripts/binder_gamemaker/binder_gamemaker.gml index 4ce50bd9a..21bbefb62 100644 --- a/scripts/binder_gamemaker/binder_gamemaker.gml +++ b/scripts/binder_gamemaker/binder_gamemaker.gml @@ -1,3 +1,114 @@ -function __Binder_Gamemaker(path) constructor { +function Binder_Gamemaker(path) { + if(!file_exists_empty(path)) return noone; + if(filename_ext(path) != ".yyp") return noone; + return new __Binder_Gamemaker(path); +} + +function GMSprite(_gm, _path, _info) constructor { + gmBinder = _gm; + path = $"{_gm.dir}/{_path}"; + key = _path; + raw = _info; + type = _info.resourceType; + thumbnail = noone; + + var _dirr = filename_dir(path); + var _frame = raw.frames; + var _layers = raw.layers; + + thumbnailPath = ""; + if(array_empty(_frame) || array_empty(_layers)) return; + + thumbnailPath = $"{_dirr}/layers/{_frame[0].name}/{_layers[0].name}.png"; + if(file_exists(thumbnailPath)) { + var _th = sprite_add(thumbnailPath, 0, 0, 0, 0, 0); + thumbnail = _th; + } +} + +function GMTileset(_gm, _path, _info) constructor { + gmBinder = _gm; + path = $"{_gm.dir}/{_path}"; + key = _path; + raw = _info; + type = _info.resourceType; + thumbnail = noone; + + sprite = raw.spriteId.path; +} + +function GMRoom(_gm, _path, _info) constructor { + gmBinder = _gm; + path = $"{_gm.dir}/{_path}"; + key = _path; + raw = _info; + type = _info.resourceType; + thumbnail = noone; + +} + +function __Binder_Gamemaker(path) constructor { + self.path = path; + name = filename_name_only(path); + dir = filename_dir(path); + projectName = ""; + + resourcesRaw = []; + resourcesMap = {}; + resources = [ + { name: "sprites", data : [], closed : false, }, + { name: "tileset", data : [], closed : false, }, + { name: "rooms", data : [], closed : false, }, + ]; + + static readYY = function(path) { + var _res = file_read_all(path); + var _resMap = json_try_parse(_res, -1); + + if(_resMap == -1) return noone; + return _resMap; + } + + static refreshResources = function() { + if(!file_exists(path)) return; + + var _res = file_read_all(path); + var _resMap = json_try_parse(_res, -1); + + if(_resMap == -1) return; + + projectName = _resMap.name; + resourcesRaw = _resMap.resources; + resourcesMap = {}; + + var sprites = []; + var tileset = []; + var rooms = []; + + for( var i = 0, n = array_length(resourcesRaw); i < n; i++ ) { + var _res = resourcesRaw[i].id; + var _name = _res.name; + var _path = _res.path; + + var _info = readYY($"{dir}/{_path}"); + if(_info == noone) continue; + + var _asset = noone; + + switch(_info.resourceType) { + case "GMSprite": _asset = new GMSprite(self, _path, _info); array_push(sprites, _asset); break; + case "GMTileSet": _asset = new GMTileset(self, _path, _info); array_push(tileset, _asset); break; + case "GMRoom": _asset = new GMRoom(self, _path, _info); array_push(rooms, _asset); break; + } + + resourcesMap[$ _path] = _asset; + } + + resources[0].data = sprites; + resources[1].data = tileset; + resources[2].data = rooms; + } + + refreshResources(); } \ No newline at end of file diff --git a/scripts/canvas_tool_node/canvas_tool_node.gml b/scripts/canvas_tool_node/canvas_tool_node.gml index 0f57a3c66..6cd336c02 100644 --- a/scripts/canvas_tool_node/canvas_tool_node.gml +++ b/scripts/canvas_tool_node/canvas_tool_node.gml @@ -89,9 +89,7 @@ function canvas_tool_node(canvas, node) : canvas_tool() constructor { return noone; } - panel = panelAdd("Panel_Inspector", true, false); - panel.content.setInspecting(nodeObject, true, false); - panel.destroy_on_click_out = false; + New_Inspect_Node_Panel(nodeObject); return self; } diff --git a/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml b/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml index e7fb092a2..0024ace07 100644 --- a/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml +++ b/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml @@ -58,9 +58,11 @@ function draw_sprite_bbox(spr, ind, _bbox) { function draw_sprite_bbox_uniform(spr, ind, _bbox, _col = c_white, _alp = 1) { INLINE if(_bbox == noone) return; - var _minS = min(_bbox.w, _bbox.h); + var _sw = sprite_get_width(spr); + var _sh = sprite_get_height(spr); + var _minS = min(_bbox.w / _sw, _bbox.h / _sh); - __draw_sprite_stretched_ext(spr, ind, _bbox.xc - _minS / 2, _bbox.yc - _minS / 2, _minS, _minS, _col, _alp); + __draw_sprite_ext(spr, ind, _bbox.xc - _sw * _minS / 2, _bbox.yc - _sh * _minS / 2, _minS, _minS, 0, _col, _alp); } function draw_sprite_uniform(spr, ind, _x, _y, scale, color = c_white, alpha = 1) { diff --git a/scripts/gamemakerPathBox/gamemakerPathBox.gml b/scripts/gamemakerPathBox/gamemakerPathBox.gml new file mode 100644 index 000000000..ff9a182aa --- /dev/null +++ b/scripts/gamemakerPathBox/gamemakerPathBox.gml @@ -0,0 +1,52 @@ +function gamemakerPathBox(project) : widget() constructor { + self.project = project; + + static trigger = function() { } + + static drawParam = function(params) { + setParam(params); + return draw(params.x, params.y, params.w, params.h, params.data, params.m); + } + + static draw = function(_x, _y, _w, _h, _gmPath, _m) { + x = _x; + y = _y; + w = _w; + h = _h; + + if(project.bind_gamemaker == noone) { + if(buttonInstant(THEME.button_def, _x, _y, _w, _h, _m, active, hover) == 2) { + var path = get_open_filename("GameMaker project|*.yyp", ""); key_release(); + if(path == "") return noone; + + project.attributes.bind_gamemaker_path = path; + project.bind_gamemaker = Binder_Gamemaker(project.attributes.bind_gamemaker_path); + if(project.bind_gamemaker == noone) project.attributes.bind_gamemaker_path = ""; + else dialogPanelCall(new Panel_GM_Explore(project.bind_gamemaker)); + } + + draw_sprite_uniform(s_gamemaker, 0, _x + ui(16), _y + _h / 2, 1, COLORS._main_icon, 1); + + draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text); + draw_text_add(_x + _w / 2, _y + _h / 2, "Link .yyp"); + + } else { + var _gm = project.bind_gamemaker; + + draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h); + + if(buttonInstant(THEME.button_def, _x, _y, ui(32), _h, _m, active, hover, "Explore project", s_gamemaker, 0, COLORS._main_icon) == 2) + dialogPanelCall(new Panel_GM_Explore(_gm)); + + draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text); + draw_text_add(_x + ui(40), _y + _h / 2, _gm.projectName); + + if(buttonInstant(THEME.button_def, _x + _w - ui(32), _y, ui(32), _h, _m, active, hover, "Disconnect", THEME.cross_12, 0, [ COLORS._main_icon, COLORS._main_value_negative ]) == 2) { + project.attributes.bind_gamemaker_path = ""; + project.bind_gamemaker = noone; + } + } + + return h; + } +} \ No newline at end of file diff --git a/scripts/gamemakerPathBox/gamemakerPathBox.yy b/scripts/gamemakerPathBox/gamemakerPathBox.yy new file mode 100644 index 000000000..58dc5c629 --- /dev/null +++ b/scripts/gamemakerPathBox/gamemakerPathBox.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"gamemakerPathBox", + "isCompatibility":false, + "isDnD":false, + "name":"gamemakerPathBox", + "parent":{ + "name":"binder", + "path":"folders/main/binder.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index fdd1cfe80..3b6b1b619 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -42,7 +42,7 @@ LATEST_VERSION = 1_18_00_0; VERSION = 1_18_01_0; SAVE_VERSION = 1_18_02_0; - VERSION_STRING = MAC? "1.18.003m" : "1.18.3.007"; + VERSION_STRING = MAC? "1.18.003m" : "1.18.3.008"; BUILD_NUMBER = 1_18_03_0; HOTKEYS = ds_map_create(); diff --git a/scripts/node_composite/node_composite.gml b/scripts/node_composite/node_composite.gml index f00b8a266..a3dbb9d88 100644 --- a/scripts/node_composite/node_composite.gml +++ b/scripts/node_composite/node_composite.gml @@ -220,10 +220,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) _icc = COLORS._main_icon_light; _ica = 1; - if(DOUBLE_CLICK) { - var pan = panelAdd("Panel_Inspector", true); - pan.content.setInspecting(_junc_canvas, true); - } + if(DOUBLE_CLICK) New_Inspect_Node_Panel(_junc_canvas, false); } draw_sprite_ui_uniform(THEME.icon_canvas, 0, _icx, _icy, 1, _icc, _ica); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index af1142aca..255ada1ba 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -1452,7 +1452,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { if(icon) { tx += _s * 6; - draw_sprite_ui_uniform(icon, 0, round(tx), round(yy + nh / 2), _s, c_white, aa); + draw_sprite_ui_uniform(icon, 0, round(tx) + 1, round(yy + nh / 2) + 1, _s, c_black, 1); + draw_sprite_ui_uniform(icon, 0, round(tx), round(yy + nh / 2), _s, c_white, 1); tx += _s * 12; tw -= _s * (12 + 6); } diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 9781c8f07..2f2ef6542 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -524,12 +524,16 @@ function __initNodes() { addNodeObject(input, "SVG", s_node_svg, "Node_SVG", [1, Node_SVG],, "Load a SVG file."); if(!DEMO) addNodeObject(input, "Export", s_node_export, "Node_Export", [0, Node_create_Export],, "Export image, image array to file, image sequence, animation."); - ds_list_add(input, "Draw"); + ds_list_add(input, "Canvas"); addNodeObject(input, "Canvas", s_node_canvas, "Node_Canvas", [1, Node_Canvas], ["draw"], "Draw on surface using brush, eraser, etc."); addNodeObject(input, "Canvas Group", s_node_canvas_group, "Node_Canvas_Group", [1, Node_Canvas_Group],, "Create a group that combines multiple canvas nodes a layers.").setVersion(11740); addNodeObject(input, "Active Canvas", s_node_active_canvas, "Node_Active_Canvas", [1, Node_Active_Canvas], ["draw"], "Draw using parameterized brush.").setVersion(11570); + + ds_list_add(input, "Tileset"); addNodeObject(input, "Tileset", s_node_tileset, "Node_Tile_Tileset", [1, Node_Tile_Tileset],, "Create tileset object.").setVersion(1_18_03_0); addNodeObject(input, "Tile Drawer", s_node_tileset_drawer, "Node_Tile_Drawer", [1, Node_Tile_Drawer],, "Draw using tileset.").setVersion(1_18_03_0); + addNodeObject(input, "Tile Rule", s_node_tileset_rule, "Node_Tile_Rule", [1, Node_Tile_Rule],, "Apply tileset rules.").setVersion(1_18_03_0); + addNodeObject(input, "Render Tilemap", s_node_tileset_render, "Node_Tile_Render", [1, Node_Tile_Render],, "Render tilemap to image.").setVersion(1_18_03_0); addNodeObject(input, "Export Tilemap", s_node_tileset_export, "Node_Tile_Tilemap_Export", [1, Node_Tile_Tilemap_Export],, "Export tilemap to file.").setVersion(1_18_03_0); ds_list_add(input, "Files"); @@ -767,6 +771,7 @@ function __initNodes() { addNodeObject(generator, "Draw Cross Section", s_node_cross_section, "Node_Cross_Section", [1, Node_Cross_Section],, "Map the brightness of pixels on a linear axis into a surface.").setVersion(11710); addNodeObject(generator, "Interpret Number", s_node_interpret_number, "Node_Interpret_Number", [1, Node_Interpret_Number],, "Convert array of number into surface.").setVersion(11530); addNodeObject(generator, "Pixel Builder", s_node_pixel_builder, "Node_Pixel_Builder", [1, Node_Pixel_Builder],, "Will break, do not create. please. Why is it here??").setVersion(11540); + addNodeObject(generator, "Tile Drawer", s_node_tileset_drawer, "Node_Tile_Drawer", [1, Node_Tile_Drawer]).setVersion(1_18_03_0); ds_list_add(generator, "Noises"); addNodeObject(generator, "Noise", s_node_noise, "Node_Noise", [1, Node_Noise],, "Generate white noise."); diff --git a/scripts/node_tiler/node_tiler.gml b/scripts/node_tiler/node_tiler.gml index 4e11d91d0..6ed0051d4 100644 --- a/scripts/node_tiler/node_tiler.gml +++ b/scripts/node_tiler/node_tiler.gml @@ -20,14 +20,13 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou input_display_list_animated = ["Animated tiles",true, 2, noone]; input_display_list_rule = ["Rules", true, noone, noone]; - newOutput(0, nodeValue_Output("Tile output", self, VALUE_TYPE.surface, noone)); + newOutput(0, nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone)); - newOutput(1, nodeValue_Output("Tile map", self, VALUE_TYPE.surface, noone)); + newOutput(1, nodeValue_Output("Tilemap", self, VALUE_TYPE.surface, noone)); - // newOutput(2, nodeValue_Output("Index array", self, VALUE_TYPE.integer, [])) - // .setArrayDepth(1); + newOutput(2, nodeValue_Output("Tileset", self, VALUE_TYPE.tileset, noone)); - output_display_list = [ 0, 1 ]; + output_display_list = [ 2, 1, 0 ]; #region ++++ data ++++ canvas_surface = surface_create_empty(1, 1, surface_rgba16float); @@ -255,24 +254,25 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou static processData = function(_outData, _data, _output_index, _array_index) { tileset = _data[0]; + _outData[2] = tileset; if(tileset == noone) { input_display_list = [ 3, 1, 0 ]; return _outData; } - input_display_list_tileset[3] = tileset.tile_selector_toggler; - input_display_list_autoterrains[3] = tileset.autoterrain_selector_toggler; - input_display_list_palette[3] = tileset.palette_viewer_toggler; - input_display_list_animated[3] = tileset.animated_viewer_toggler; - input_display_list_rule[3] = tileset.rules_viewer_toggler; + input_display_list_tileset[3] = tileset.tile_selector.b_toggle; + input_display_list_autoterrains[3] = tileset.autoterrain_selector.b_toggle; + input_display_list_palette[3] = tileset.palette_viewer.b_toggle; + input_display_list_animated[3] = tileset.animated_viewer.b_toggle; + input_display_list_rule[3] = tileset.rules.b_toggle; input_display_list = [ 3, 1, 0, input_display_list_tileset, tileset.tile_selector, input_display_list_autoterrains, tileset.autoterrain_selector, input_display_list_palette, tileset.palette_viewer, input_display_list_animated, tileset.animated_viewer, - input_display_list_rule, tileset.rules_viewer, + input_display_list_rule, tileset.rules, ] var _tileSet = tileset.texture; @@ -302,51 +302,16 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou var _tileOut = surface_verify(_outData[0], _outDim[0], _outDim[1]); var _tileMap = surface_verify(_outData[1], _mapSize[0], _mapSize[1], surface_rgba16float); - // var _arrIndx = array_verify( _outData[2], _mapSize[0] * _mapSize[1]); canvas_buffer = buffer_verify(canvas_buffer, _mapSize[0] * _mapSize[1] * 8); buffer_get_surface(canvas_buffer, canvas_surface, 0); - #region rules - surface_set_shader(temp_surface[1], sh_sample, true, BLEND.over); - draw_surface(canvas_surface, 0, 0); - surface_reset_shader(); - - var bg = 0; - - for( var i = 0, n = array_length(tileset.ruleTiles); i < n; i++ ) { - var _rule = tileset.ruleTiles[i]; - - if(!_rule.active) continue; - if(array_empty(_rule.replacements)) continue; - - surface_set_shader(temp_surface[2], sh_tile_rule_select, true, BLEND.over); - shader_set_2("dimension", _mapSize); - _rule.shader_select(tileset); - - draw_surface(canvas_surface, 0, 0); - surface_reset_shader(); - - surface_set_shader(temp_surface[bg], sh_tile_rule_apply, true, BLEND.over); - shader_set_2("dimension", _mapSize); - shader_set_f("seed", _seed); - shader_set_surface("group", temp_surface[2]); - _rule.shader_submit(tileset); - - draw_surface(temp_surface[!bg], 0, 0); - surface_reset_shader(); - - bg = !bg; - } - - #endregion + var _applied = tileset.rules.apply(canvas_surface, _seed); surface_set_shader(_tileMap, sh_sample, true, BLEND.over); - draw_surface(temp_surface[!bg], 0, 0); + draw_surface(_applied, 0, 0); surface_reset_shader(); - var _tileSetDim = surface_get_dimension(_tileSet); - surface_set_shader(_tileOut, sh_draw_tile_map, true, BLEND.over); shader_set_2("dimension", _outDim); @@ -359,16 +324,9 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou draw_empty(); surface_reset_shader(); - return [ _tileOut, _tileMap ]; + return [ _tileOut, _tileMap, tileset ]; } - // static getPreviewValues = function() { - // return getSingleValue(0, preview_index, true); - // return preview_drawing_tile; - // } - - // static getGraphPreviewSurface = function() { return getSingleValue(0, preview_index, true); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static attributeSerialize = function() { diff --git a/scripts/node_tiler_render/node_tiler_render.gml b/scripts/node_tiler_render/node_tiler_render.gml new file mode 100644 index 000000000..31c8b494a --- /dev/null +++ b/scripts/node_tiler_render/node_tiler_render.gml @@ -0,0 +1,51 @@ +function Node_Tile_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "Render Tilemap"; + + newInput( 0, nodeValue_Tileset("Tileset", self, noone)) + .setVisible(true, true); + + newInput( 1, nodeValue_Surface("Tilemap", self, noone)); + + newInput( 2, nodeValue_Bool("Animated", self, false)); + + newOutput(0, nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone)); + + input_display_list = [ + ["Tile data", false], 0, 1, 2, + ]; + + output_display_list = [ 0 ]; + + static update = function(frame = CURRENT_FRAME) { + var tileset = inputs[0].getValue(); + var tilemap = inputs[1].getValue(); + + if(tileset == noone) return; + if(!is_surface(tilemap)) return; + + var _tileSiz = tileset.tileSize; + var _mapSize = surface_get_dimension(tilemap); + + var _outDim = [ _tileSiz[0] * _mapSize[0], _tileSiz[1] * _mapSize[1] ]; + var _tileOut = surface_verify(outputs[0].getValue(), _outDim[0], _outDim[1]); + var _tileMap = surface_verify(outputs[1].getValue(), _mapSize[0], _mapSize[1], surface_rgba16float); + + surface_set_shader(_tileMap, sh_sample, true, BLEND.over); + draw_surface(_applied, 0, 0); + surface_reset_shader(); + + surface_set_shader(_tileOut, sh_draw_tile_map, true, BLEND.over); + shader_set_2("dimension", _outDim); + + shader_set_surface("indexTexture", _tileMap); + shader_set_2("indexTextureDim", surface_get_dimension(_tileMap)); + + shader_set_f("frame", CURRENT_FRAME); + tileset.shader_submit(); + + draw_empty(); + surface_reset_shader(); + + outputs[0].setValue(_tileOut); + } +} \ No newline at end of file diff --git a/scripts/node_tiler_render/node_tiler_render.yy b/scripts/node_tiler_render/node_tiler_render.yy new file mode 100644 index 000000000..494d85b80 --- /dev/null +++ b/scripts/node_tiler_render/node_tiler_render.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"node_tiler_render", + "isCompatibility":false, + "isDnD":false, + "name":"node_tiler_render", + "parent":{ + "name":"tiler", + "path":"folders/nodes/data/tiler.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/node_tiler_rule/node_tiler_rule.gml b/scripts/node_tiler_rule/node_tiler_rule.gml new file mode 100644 index 000000000..7cdfada20 --- /dev/null +++ b/scripts/node_tiler_rule/node_tiler_rule.gml @@ -0,0 +1,82 @@ +function Node_Tile_Rule(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "Tileset Rule"; + + newInput( 0, nodeValue_Tileset("Tileset", self, noone)) + .setVisible(true, true); + + newInput( 1, nodeValue_Surface("Tilemap", self, noone)); + + newInput( 2, nodeValueSeed(self, VALUE_TYPE.float)); + + newInput( 3, nodeValue_Bool("Animated", self, false)); + + newOutput(0, nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone)); + + newOutput(1, nodeValue_Output("Tilemap", self, VALUE_TYPE.surface, noone)); + + newOutput(2, nodeValue_Output("Tileset", self, VALUE_TYPE.tileset, noone)); + + rules = new Tileset_Rule(noone); + + input_display_list = [ 2, + ["Tile data", false], 0, 1, 3, + ["Rules", false, noone, rules.b_toggle ], rules, + ]; + + output_display_list = [ 2, 1, 0 ]; + + static update = function(frame = CURRENT_FRAME) { + var tileset = inputs[0].getValue(); + var tilemap = inputs[1].getValue(); + var _seed = inputs[2].getValue(); + + outputs[2].setValue(tileset); + if(tileset == noone) return; + + rules.setTileset(tileset); + if(!is_surface(tilemap)) return; + + var _tileSiz = tileset.tileSize; + var _mapSize = surface_get_dimension(tilemap); + + var _outDim = [ _tileSiz[0] * _mapSize[0], _tileSiz[1] * _mapSize[1] ]; + var _tileOut = surface_verify(outputs[0].getValue(), _outDim[0], _outDim[1]); + var _tileMap = surface_verify(outputs[1].getValue(), _mapSize[0], _mapSize[1], surface_rgba16float); + var _applied = rules.apply(tilemap, _seed); + + surface_set_shader(_tileMap, sh_sample, true, BLEND.over); + draw_surface(_applied, 0, 0); + surface_reset_shader(); + + surface_set_shader(_tileOut, sh_draw_tile_map, true, BLEND.over); + shader_set_2("dimension", _outDim); + + shader_set_surface("indexTexture", _tileMap); + shader_set_2("indexTextureDim", surface_get_dimension(_tileMap)); + + shader_set_f("frame", CURRENT_FRAME); + tileset.shader_submit(); + + draw_empty(); + surface_reset_shader(); + + outputs[0].setValue(_tileOut); + outputs[1].setValue(_tileMap); + } + + static attributeSerialize = function() { + var _attr = { + ruleTiles: rules.ruleTiles, + }; + + return _attr; + } + + static attributeDeserialize = function(attr) { + var _rule = struct_try_get(attr, "ruleTiles", []); + + for( var i = 0, n = array_length(_rule); i < n; i++ ) + rules.ruleTiles[i] = new tiler_rule().deserialize(_rule[i]); + } + +} \ No newline at end of file diff --git a/scripts/node_tiler_rule/node_tiler_rule.yy b/scripts/node_tiler_rule/node_tiler_rule.yy new file mode 100644 index 000000000..418b91f26 --- /dev/null +++ b/scripts/node_tiler_rule/node_tiler_rule.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"node_tiler_rule", + "isCompatibility":false, + "isDnD":false, + "name":"node_tiler_rule", + "parent":{ + "name":"tiler", + "path":"folders/nodes/data/tiler.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/node_tiler_tileset/node_tiler_tileset.gml b/scripts/node_tiler_tileset/node_tiler_tileset.gml index 32e7948ee..6e379f6eb 100644 --- a/scripts/node_tiler_tileset/node_tiler_tileset.gml +++ b/scripts/node_tiler_tileset/node_tiler_tileset.gml @@ -1,6 +1,5 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Tileset"; - min_h = 128; bypass_grid = true; renaming = noone; @@ -73,8 +72,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr brush = new tiler_brush(self); tile_selector = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) { - var _tileSet = getInputData(0); - var _tileSiz = getInputData(1); + var _tileSet = texture; + var _tileSiz = tileSize; var _pd = ui(4); var _yy = _y; @@ -448,6 +447,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr return _h; }); + + tile_selector.setName("Tileset"); #endregion #region ++++ auto terrain ++++ @@ -458,8 +459,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _yy = _y; var _h = 0; - var _tileSet = getInputData(0); - var _tileSiz = getInputData(1); + var _tileSet = texture; + var _tileSiz = tileSize; if(!is_surface(_tileSet)) return _h; var _tdim = surface_get_dimension(_tileSet); @@ -730,6 +731,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr autoterrain_selector_h = max(ui(12), _ah); return _h + _ah; }); + + autoterrain_selector.setName("Autoterrain"); #endregion #region ++++ brush palette ++++ @@ -768,8 +771,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _h = 0; var _pd = ui(4); - var _tileSet = getInputData(0); - var _tileSiz = getInputData(1); + var _tileSet = texture; + var _tileSiz = tileSize; var bx = _x; var by = _yy; @@ -1132,6 +1135,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr return _h; }); + + palette_viewer.setName("Tile Palette"); #endregion #region ++++ animated tiles ++++ @@ -1160,8 +1165,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _yy = _y; var _h = 0; - var _tileSet = getInputData(0); - var _tileSiz = getInputData(1); + var _tileSet = texture; + var _tileSiz = tileSize; if(!is_surface(_tileSet)) return _h; var _tdim = surface_get_dimension(_tileSet); @@ -1390,330 +1395,21 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr animated_selector_h = max(ui(12), _ah); return _h + _ah; }); + + animated_viewer.setName("Animated Tile"); #endregion - #region ++++ rules ++++ - ruleTiles = []; - rule_selector_h = 0; - - rule_dragging = noone; - - rules_viewer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) { - var _yy = _y; - var _h = 0; - - var _tileSet = getInputData(0); - var _tileSiz = getInputData(1); - - if(!is_surface(_tileSet)) return _h; - var _tdim = surface_get_dimension(_tileSet); - var _tileAmo = [ floor(_tdim[0] / _tileSiz[0]), floor(_tdim[1] / _tileSiz[1]) ]; - - var bx = _x; - var by = _yy; - var bs = ui(24); - - if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "New rule", THEME.add_16, 0, COLORS._main_value_positive) == 2) { - var _new_rl = new tiler_rule(); - _new_rl.name = $"rule {array_length(ruleTiles)}" - _new_rl.open = true; - array_push(ruleTiles, _new_rl); - triggerRender(); - } - - _h += bs + ui(4); - _yy += bs + ui(4); - - var _pd = ui(4); - var _ah = _pd * 2; - var del = -1; - var rl_iHover = 0; - - draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, rule_selector_h, COLORS.node_composite_bg_blend, 1); - - _yy += _pd; - - for( var i = 0, n = array_length(ruleTiles); i < n; i++ ) { - var _hg = ui(32); - var _rl = ruleTiles[i]; - - var _pw = ui(24); - var _ph = ui(24); - var _px = _x + ui(8); - var _py = _yy + ui(4); - - if(_m[1] > _yy) rl_iHover = i; - - var _prin = array_safe_get(_rl.replacements, 0, undefined); - - if(_prin == undefined) - draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon); - else if(is(_prin, tiler_rule_replacement)) { - var _ind = array_safe_get(_prin.index, 0); - drawTile(_tileSet, _tileAmo, _tileSiz, _ind, _px, _py, _pw, _ph); - } - - var _tx = _px + _pw + ui(8); - var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1); - - if(renaming == _rl) { - tb_rename.setFocusHover(_focus, _hover); - tb_rename.draw(_tx, _yy, _w - _pw - ui(8), _hg, rename_text, _m); - - } else { - var _cc = _hov? COLORS._main_text : COLORS._main_text_sub; - if(rule_dragging == _rl) _cc = COLORS._main_accent; - - draw_set_text(f_p2, fa_left, fa_center, _cc); - draw_text_add(_tx, _yy + _hg / 2, _rl.name); - - var bs = ui(24); - var bx = _w - bs - ui(4); - var by = _yy + _hg / 2 - bs / 2; - if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2) - del = i; - } - - if(_hov && _m[0] < _x + _w - ui(32 + 160)) { - if(_m[0] > _tx) { - - if(mouse_press(mb_left, _focus)) { - rule_dragging = _rl; - - } else if(DOUBLE_CLICK && _focus) { - renaming = _rl; - rename_text = _rl.name; - - tb_rename._current_text = _rl.name; - tb_rename.activate(); - } - - } else { - draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent); - - if(mouse_press(mb_left, _focus)) - _rl.open = !_rl.open; - } - } - - var _atWid = _rl.sl_prop; - var _scw = ui(120); - var _sch = ui(20); - var _scx = _x + _w - _scw - ui(32 + 8); - var _scy = _yy + _hg / 2 - _sch / 2; - - _atWid.setFocusHover(_focus, _hover); - _atWid.rx = rules_viewer.rx; _atWid.ry = rules_viewer.ry; - _atWid.draw(_scx, _scy, _scw, _sch, _rl.probability, _m); - if(_rl.probability != _rl._probability) { - _rl._probability = _rl.probability; - triggerRender(); - } - - var _acw = ui(20); - var _ach = ui(20); - var _acx = _scx - _acw - ui(8); - var _acy = _yy + _hg / 2 - _sch / 2; - var _ahv = _hover && point_in_rectangle(_m[0], _m[1], _acx, _acy, _acx + _acw, _acy + _ach); - - if(_ahv) { - TOOLTIP = "Active"; - if(mouse_press(mb_left, _focus)) { - _rl.active = !_rl.active; - triggerRender(); - } - } - - draw_sprite_stretched_ext(THEME.checkbox_def, _ahv, _acx, _acy, _acw, _ach, c_white); - if(_rl.active) draw_sprite_stretched_ext(THEME.checkbox_def, 2, _acx, _acy, _acw, _ach, COLORS._main_accent); - - _yy += _hg; - _ah += _hg; - - if(_rl.open) { - _yy += ui(4); - _ah += ui(4); - - var _sls = ui(28); - var _radw = _rl.size[0] + _rl.range * 2; - var _radh = _rl.size[1] + _rl.range * 2; - var _slw = ui(16) + _radw * _sls; - var _slh = ui(16) + _radh * _sls; - var _hh0 = _slh; - - draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x + ui(8), _yy, _slw, _slh, COLORS.node_composite_bg_blend, 1); - - for( var j = 0, m = array_length(_rl.selection_rules); j < m; j++ ) { - var _rl_sel = _rl.selection_rules[j]; - var _rl_col = j % _radw; - var _rl_row = floor(j / _radw); - - var _cen = _rl_col >= _rl.range && _rl_col < _rl.range + _rl.size[0] && - _rl_row >= _rl.range && _rl_row < _rl.range + _rl.size[1]; - - var _rl_x = _x + ui(16) + _rl_col * _sls; - var _rl_y = _yy + ui( 8) + _rl_row * _sls; - - var _rl_selected = object_selecting == _rl && object_select_id == j; - var _rl_hov = _hover && point_in_rectangle(_m[0], _m[1], _rl_x, _rl_y, _rl_x + _sls - 1, _rl_y + _sls - 1); - var _pad = ui(2); - - var _cc = _rl_selected? COLORS._main_accent : COLORS._main_icon; - var _aa = _rl_selected? 1 : .5 + _rl_hov * .5; - - if(is_array(_rl_sel)) { - var _autt = autoterrain[_rl_sel[1]]; - drawTile(_tileSet, _tileAmo, _tileSiz, _autt.index[0], _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); - draw_sprite_uniform(THEME.circle, 0, _rl_x + _sls - ui(8), _rl_y + _sls - ui(8), 1, COLORS._main_accent); - - } else if (_rl_sel == -10000) { - draw_sprite_uniform(THEME.cross, 0, _rl_x + _sls / 2, _rl_y + _sls / 2, 1, _cc, _aa); - - } else if(_rl_sel != -1) { - drawTile(_tileSet, _tileAmo, _tileSiz, _rl_sel, _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); - - } else if(!_cen) _pad = ui(10); - - draw_sprite_stretched_ext(THEME.ui_panel, 1 + _cen, _rl_x + _pad, _rl_y + _pad, _sls - _pad * 2, _sls - _pad * 2, _cc, _aa); - - if(_rl_hov) { - if(mouse_press(mb_left, _focus)) { - object_selecting = _rl_selected? noone : _rl; - object_select_id = j; - - triggerRender(); - } - - if(mouse_press(mb_right, _focus)) { - _rl.selection_rules[j] = -1; - object_selecting = noone; - object_select_id = noone; - - triggerRender(); - } - } - } - - draw_sprite_uniform(THEME.arrow, 0, _x + ui(8) + _slw + ui(8), _yy + _slh / 2, 1, COLORS._main_icon, 1); - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - var _rep = _rl.replacements; - var _siz = _rl.size; - - var _rpw = _sls * _siz[0]; - var _rph = _sls * _siz[1]; - - var _dx = ui(8) + _slw + ui(16); - var _rx = _x + _dx; - var _slw = _w - _dx - ui(8); - var _col = max(1, floor((_slw - ui(16)) / _rpw)); - var _row = ceil((array_length(_rep) + 1) / _col); - var _slh = ui(16) + _row * _rph; - - draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _rx, _yy, _slw, max(_hh0, _slh), COLORS.node_composite_bg_blend, 1); - - var del_rep = -1; - - for( var j = 0, m = array_length(_rep) + 1; j < m; j++ ) { - var _rcl = j % _col; - var _rrw = floor(j / _col); - - var _rpx = _rx + ui(8) + _rcl * _rpw; - var _rpy = _yy + ui(8) + _rrw * _rph; - var _rl_hov = _hover && point_in_rectangle(_m[0], _m[1], _rpx, _rpy, _rpx + _rpw, _rpy + _rph); - - if(j == 0) { - var _cc = _rl_hov? COLORS._main_value_positive : COLORS._main_icon; - draw_sprite_uniform(THEME.add_16, 0, _rpx + _rpw / 2, _rpy + _rph / 2, 1, _cc); - - if(_rl_hov && mouse_press(mb_left, _focus)) { - var _new_rep = new tiler_rule_replacement([-1]); - array_push(_rl.replacements, _new_rep); - object_selecting = _new_rep; - object_select_id = _rl; - } - continue; - } - - var _replace = _rep[j - 1]; - var _repIndex = _replace.index; - if(!is_array(_repIndex)) continue; - - for( var k = 0, q = array_length(_repIndex); k < q; k++ ) { - var _repBlockCol = k % _siz[0]; - var _repBlockRow = floor(k / _siz[0]); - var _rpbx = _rpx + _repBlockCol * _sls; - var _rpby = _rpy + _repBlockRow * _sls; - - if(_replace.index[k] != -1) drawTile(_tileSet, _tileAmo, _tileSiz, _replace.index[k], _rpbx + ui(2), _rpby + ui(2), _sls - ui(4), _sls - ui(4)); - } - - var _rl_selected = object_selecting == _replace; - var _cc = _rl_selected? COLORS._main_accent : COLORS._main_icon; - var _aa = _rl_selected? 1 : .5 + _rl_hov * .5; - draw_sprite_stretched_ext(THEME.ui_panel, 1, _rpx + ui(2), _rpy + ui(2), _rpw - ui(4), _rph - ui(4), _cc, _aa); - - if(_rl_hov) { - if(mouse_press(mb_left, _focus)) { - object_selecting = object_selecting == _replace? noone : _replace; - object_select_id = _rl; - triggerRender(); - } - - if(mouse_press(mb_right, _focus)) { - del_rep = j; - triggerRender(); - } - } - } - - if(del_rep != -1) { - array_delete(_rep, del_rep, 1); - triggerRender(); - } - - _yy += max(_hh0, _slh) + ui(8); - _ah += max(_hh0, _slh) + ui(8); - - } - } - - if(rule_dragging != noone) { - array_remove(ruleTiles, rule_dragging); - array_insert(ruleTiles, rl_iHover, rule_dragging); - - if(mouse_release(mb_left)) { - rule_dragging = noone; - triggerRender(); - } - } - - if(del != -1) { - array_delete(ruleTiles, del, 1); - triggerRender(); - } - - rule_selector_h = max(ui(12), _ah); - return _h + _ah; - }); - #endregion - + gmTile = noone; texture = noone; tileSize = [ 1, 1 ]; - - tile_selector_toggler = button(function() /*=>*/ { tile_selector.togglePopup("Tileset"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75); - autoterrain_selector_toggler = button(function() /*=>*/ { autoterrain_selector.togglePopup("Autoterrain"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75); - palette_viewer_toggler = button(function() /*=>*/ { palette_viewer.togglePopup("Tile Palette"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75); - animated_viewer_toggler = button(function() /*=>*/ { animated_viewer.togglePopup("Animated Tile"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75); - rules_viewer_toggler = button(function() /*=>*/ { rules_viewer.togglePopup("Tile Riles"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75); + rules = new Tileset_Rule(self); input_display_list = [ 1, 0, - ["Tileset", false, noone, tile_selector_toggler ], tile_selector, - ["Autoterrains", true, noone, autoterrain_selector_toggler ], autoterrain_selector, - ["Palette", true, noone, palette_viewer_toggler ], palette_viewer, - ["Animated tiles",true, 2, animated_viewer_toggler ], animated_viewer, - ["Rules", true, noone, rules_viewer_toggler ], rules_viewer, + ["Tileset", false, noone, tile_selector.b_toggle ], tile_selector, + ["Autoterrains", true, noone, autoterrain_selector.b_toggle ], autoterrain_selector, + ["Palette", true, noone, palette_viewer.b_toggle ], palette_viewer, + ["Animated tiles",true, noone, animated_viewer.b_toggle ], animated_viewer, + ["Rules", true, noone, rules.b_toggle ], rules, ]; static shader_submit = function() { @@ -1727,18 +1423,30 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr shader_set_f("animatedTilesLength", aTilesLength); } - static step = function() { - tile_selector_toggler.icon_blend = tile_selector.popupPanel == noone? COLORS._main_icon : COLORS._main_accent; - autoterrain_selector_toggler.icon_blend = autoterrain_selector.popupPanel == noone? COLORS._main_icon : COLORS._main_accent; - palette_viewer_toggler.icon_blend = palette_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent; - animated_viewer_toggler.icon_blend = animated_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent; - rules_viewer_toggler.icon_blend = rules_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent; - } - static update = function(frame = CURRENT_FRAME) { - texture = inputs[0].getValue(); - tileSize = inputs[1].getValue(); - + texture = inputs[0].getValue(); + tileSize = inputs[1].getValue(); + + if(gmTile != noone) { + var _spm = struct_try_get(gmTile.gmBinder.resourcesMap, gmTile.sprite, noone); + var _spr = _spm == noone? noone : _spm.thumbnail; + + if(_spr) { + var _sw = sprite_get_width(_spr); + var _sh = sprite_get_height(_spr); + + texture = surface_verify(texture, _sw, _sh); + surface_set_target(texture); + DRAW_CLEAR + BLEND_OVERRIDE + draw_sprite(_spr, 0, 0, 0); + BLEND_NORMAL + surface_reset_target(); + } + + tileSize = [ gmTile.raw.tileWidth, gmTile.raw.tileHeight ]; + } + outputs[0].setValue(self); } @@ -1749,8 +1457,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _attr = { autoterrain, animatedTiles, - ruleTiles, + ruleTiles: rules.ruleTiles, palette: surface_encode(brush_palette), + gm_key: gmTile == noone? noone : gmTile.key, }; return _attr; @@ -1773,7 +1482,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr } for( var i = 0, n = array_length(_rule); i < n; i++ ) - ruleTiles[i] = new tiler_rule().deserialize(_rule[i]); + rules.ruleTiles[i] = new tiler_rule().deserialize(_rule[i]); if(_palt != noone) { surface_free_safe(brush_palette); @@ -1784,6 +1493,13 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr brush_palette_buffer = buffer_from_surface(brush_palette, false, buffer_grow); } + if(struct_has(attr, "gm_key")) { + var _key = attr.gm_key; + var _gm = project.bind_gamemaker; + + if(_gm != noone) gmTile = struct_try_get(_gm.resourcesMap, _ey, noone); + } + refreshAnimatedData(); } diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 53158eb75..004c88e71 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -1368,7 +1368,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static isTimelineVisible = function() { INLINE return is_anim && value_from == noone; } show_val = []; - static showValue = function() { ////showValue + static __showValue = function() { INLINE var val = 0; @@ -1387,6 +1387,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru return val; } + static showValue = function() { ////showValue + return __showValue(); + } + static unitConvert = function(mode) { var _v = animator.values; diff --git a/scripts/node_value_dimension/node_value_dimension.gml b/scripts/node_value_dimension/node_value_dimension.gml index 2e00e86a1..ff3bd737b 100644 --- a/scripts/node_value_dimension/node_value_dimension.gml +++ b/scripts/node_value_dimension/node_value_dimension.gml @@ -53,7 +53,8 @@ function __NodeValue_Dimension(_node, value) : NodeValue("Dimension", _node, CON } static __getAnimValue = function(_time = CURRENT_FRAME) { - if(node.attributes.use_project_dimension) return PROJECT.attributes.surface_dimension; + if(node.attributes.use_project_dimension) + return PROJECT.attributes.surface_dimension; if(!is_anim) { if(sep_axis) return array_create_ext(2, function(i) /*=>*/ {return animators[i].processType(animators[i].values[0].value)}); @@ -67,4 +68,12 @@ function __NodeValue_Dimension(_node, value) : NodeValue("Dimension", _node, CON return animator.getValue(_time); } + + static showValue = function() { ////showValue + if(node.attributes.use_project_dimension) + return PROJECT.attributes.surface_dimension; + + return __showValue(); + } + } \ No newline at end of file diff --git a/scripts/panel_addon/panel_addon.gml b/scripts/panel_addon/panel_addon.gml index e3f2e08e7..8ad06937d 100644 --- a/scripts/panel_addon/panel_addon.gml +++ b/scripts/panel_addon/panel_addon.gml @@ -7,10 +7,10 @@ function Panel_Addon() : PanelContent() constructor { w = ui(400); h = ui(480); - search_string = ""; + search_string = ""; keyboard_lastchar = ""; - KEYBOARD_STRING = ""; - keyboard_lastkey = -1; + KEYBOARD_STRING = ""; + keyboard_lastkey = -1; search_res = []; tb_search = new textBox(TEXTBOX_INPUT.text, function(str) { diff --git a/scripts/panel_gm_explorer/panel_gm_explorer.gml b/scripts/panel_gm_explorer/panel_gm_explorer.gml new file mode 100644 index 000000000..cbc549ffa --- /dev/null +++ b/scripts/panel_gm_explorer/panel_gm_explorer.gml @@ -0,0 +1,141 @@ +function Panel_GM_Explore(gmBinder) : PanelContent() constructor { + self.gmBinder = gmBinder; + title = gmBinder.projectName; + + auto_pin = true; + padding = 8; + w = ui(400); + h = ui(480); + + grid_size = ui(64); + grid_size_to = grid_size; + + search_string = ""; + keyboard_lastchar = ""; + KEYBOARD_STRING = ""; + keyboard_lastkey = -1; + + search_res = []; + tb_search = new textBox(TEXTBOX_INPUT.text, function(str) { + search_string = string(str); + searchResource(); + }); + + tb_search.align = fa_left; + tb_search.auto_update = true; + tb_search.boxColor = COLORS._main_icon_light; + WIDGET_CURRENT = tb_search; + + function searchResource() { + search_res = []; + + } + + function onResize() { + sc_content.resize(w - ui(padding + padding), h - ui(padding + padding + 40)); + } + + sc_content = new scrollPane(w - ui(padding + padding), h - ui(padding + padding + 40), function(_y, _m) { + draw_clear_alpha(COLORS.panel_bg_clear_inner, 1); + + var _res = gmBinder.resources; + var _ww = sc_content.surface_w; + var _yy = _y; + var _hh = 0; + var lbh = ui(26); + + var _hover = sc_content.hover; + var _focus = sc_content.active; + + var _ths = grid_size; + var _pad = ui(8); + var _lnh = line_get_height(f_p3, 8); + var _col = floor((_ww - _pad) / (_ths + _pad)); + + for( var i = 0, n = array_length(_res); i < n; i++ ) { + var _name = _res[i].name; + + if(_hover && point_in_rectangle(_m[0], _m[1], 0, _yy, _ww, _yy + lbh)) { + draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, 0, _yy, _ww, lbh, COLORS.panel_inspector_group_hover, 1); + if(mouse_press(mb_left, _focus)) _res[i].closed = !_res[i].closed; + + } else + draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, 0, _yy, _ww, lbh, COLORS.panel_inspector_group_bg, 1); + + + draw_sprite_ui(THEME.arrow, _res[i].closed? 0 : 3, ui(16), _yy + lbh / 2, 1, 1, 0, COLORS.panel_inspector_group_bg, 1); + + draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text_inner); + draw_text_add(ui(32), _yy + lbh / 2, _name); + + _yy += lbh + ui(6); + _hh += lbh + ui(6); + + if(_res[i].closed) continue; + + var _data = _res[i].data; + var _xx = _pad; + + for( var j = 0, m = array_length(_data); j < m; j++ ) { + var _cc = j % _col; + var _rr = floor(j / _col); + + var _asx = _xx + _cc * (_ths + _pad); + var _asy = _yy + _rr * (_ths + _pad + _lnh); + + var _ass = _data[j]; + var _raw = _ass.raw; + var _thm = noone; + + if(_ass.type == "GMSprite") _thm = _ass.thumbnail; + else if(_ass.type == "GMTileSet") { + var _spm = struct_try_get(gmBinder.resourcesMap, _ass.sprite, noone); + _thm = _spm == noone? noone : _spm.thumbnail; + } + + if(sprite_exists(_thm)) draw_sprite_bbox_uniform(_thm, 0, BBOX().fromWH(_asx + ui(2), _asy + ui(2), _ths - ui(4), _ths - ui(4))); + + draw_set_text(f_p3, fa_center, fa_top, COLORS._main_text); + draw_text_add(_asx + _ths / 2, _asy + _ths + ui(4), _raw.name); + + if(_hover && point_in_rectangle(_m[0], _m[1], _asx, _asy, _asx + _ths, _asy + _ths)) { + draw_sprite_stretched_ext(THEME.ui_panel, 1, _asx, _asy, _ths, _ths, COLORS._main_icon); + + if(mouse_press(mb_left, _focus)) { + DRAGGING = { type : _ass.type, data : _ass }; + } + } + } + + var _rrow = ceil(array_length(_data) / _col); + _yy += (_ths + _pad + _lnh) * _rrow + ui(6); + _hh += (_ths + _pad + _lnh) * _rrow + ui(6); + + } + + if(pHOVER && key_mod_press(CTRL) && point_in_rectangle(_m[0], _m[1], 0, 0, sc_content.surface_w, sc_content.surface_h)) { + if(mouse_wheel_down()) grid_size_to = clamp(grid_size_to - ui(4), ui(32), ui(160)); + if(mouse_wheel_up()) grid_size_to = clamp(grid_size_to + ui(4), ui(32), ui(160)); + } + grid_size = lerp_float(grid_size, grid_size_to, 5); + + return _hh; + }); + + function drawContent(panel) { + draw_clear_alpha(COLORS.panel_bg_clear, 0); + + var px = ui(padding); + var py = ui(padding); + var pw = w - ui(padding + padding); + var ph = h - ui(padding + padding); + + draw_sprite_stretched(THEME.ui_panel_bg, 1, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16)); + tb_search.draw(px, py, pw, ui(32), search_string, [mx, my]); + if(search_string == "") tb_search.sprite_index = 1; + + sc_content.setFocusHover(pFOCUS, pHOVER); + sc_content.draw(px, py + ui(40), mx - px, my - (py + ui(40))); + + } +} \ No newline at end of file diff --git a/scripts/panel_gm_explorer/panel_gm_explorer.yy b/scripts/panel_gm_explorer/panel_gm_explorer.yy new file mode 100644 index 000000000..c13592bed --- /dev/null +++ b/scripts/panel_gm_explorer/panel_gm_explorer.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"panel_gm_explorer", + "isCompatibility":false, + "isDnD":false, + "name":"panel_gm_explorer", + "parent":{ + "name":"_others", + "path":"folders/panels/_others.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 23eb44aad..0f28905a0 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -3260,6 +3260,15 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { node = DRAGGING.data.build(mouse_grid_x, mouse_grid_y, getCurrentContext()); nodes_selecting = [ node ]; break; + + case "GMSprite" : + node = Node_create_Image_path(mouse_grid_x, mouse_grid_y, DRAGGING.data.thumbnailPath); + break; + + case "GMTileSet" : + node = nodeBuild("Node_Tile_Tileset", mouse_grid_x, mouse_grid_y).skipDefault(); + node.gmTile = DRAGGING.data; + break; } if(!key_mod_press(SHIFT) && node && struct_has(DRAGGING, "from") && DRAGGING.from.value_from == noone) { diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 8773dc912..90f246afe 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -70,6 +70,7 @@ function Inspector_Custom_Renderer(drawFn, registerFn = noone) : widget() constr self.draw = drawFn; node = noone; panel = noone; + name = ""; popupPanel = noone; popupDialog = noone; @@ -85,8 +86,15 @@ function Inspector_Custom_Renderer(drawFn, registerFn = noone) : widget() constr } } + b_toggle = button(function() /*=>*/ { togglePopup(name); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75); + + static setName = function(name) { self.name = name; return self; } static setNode = function(node) { self.node = node; return self; } - static toString = function() { return $"Custon renderer"; } + static toString = function() { return $"Custon renderer: {name}"; } + + static step = function() { + b_toggle.icon_blend = popupPanel == noone? COLORS._main_icon : COLORS._main_accent; + } static togglePopup = function(_title) { if(popupPanel == noone) { @@ -346,6 +354,7 @@ function Panel_Inspector() : PanelContent() constructor { var rx = x + ui(16); var ry = y + top_bar_h; var lbh = viewMode? ui(32) : ui(26); + var _cAll = 0; attribute_hovering = noone; @@ -382,7 +391,11 @@ function Panel_Inspector() : PanelContent() constructor { _x1 -= ui(4); if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, _x1, yy + lbh)) { draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, 0, yy, _x1, lbh, COLORS.panel_inspector_group_hover, 1); - if(mouse_press(mb_left, pFOCUS)) _meta[1] = !_meta[1]; + + if(pFOCUS) { + if(DOUBLE_CLICK) _cAll = _meta[1]? -1 : 1; + else if(mouse_press(mb_left)) _meta[1] = !_meta[1]; + } } else draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, 0, yy, _x1, lbh, COLORS.panel_inspector_group_bg, 1); @@ -394,7 +407,11 @@ function Panel_Inspector() : PanelContent() constructor { if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, _x1, yy + lbh)) { draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, 0, yy, con_w, lbh, COLORS.panel_inspector_group_hover, 1); - if(mouse_press(mb_left, pFOCUS)) _meta[1] = !_meta[1]; + + if(pFOCUS) { + if(DOUBLE_CLICK) _cAll = _meta[1]? -1 : 1; + else if(mouse_press(mb_left)) _meta[1] = !_meta[1]; + } } else draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, 0, yy, con_w, lbh, COLORS.panel_inspector_group_bg, 1); @@ -418,16 +435,16 @@ function Panel_Inspector() : PanelContent() constructor { var _lh, wh; for( var j = 0; j < array_length(_edt); j++ ) { - var title = _edt[j][0]; - var param = _edt[j][1]; - var editW = _edt[j][2]; - var drpFn = _edt[j][3]; - + var title = array_safe_get(_edt[j], 0, noone); + var param = array_safe_get(_edt[j], 1, noone); + var editW = array_safe_get(_edt[j], 2, noone); + var drpFn = array_safe_get(_edt[j], 3, noone); + var widx = ui(8); var widy = yy; draw_set_text(_font, fa_left, fa_top, COLORS._main_text_inner); - draw_text_over(ui(16), viewMode == INSP_VIEW_MODE.spacious? yy : yy + ui(3), __txt(title)); + draw_text_add(ui(16), viewMode == INSP_VIEW_MODE.spacious? yy : yy + ui(3), __txt(title)); if(viewMode == INSP_VIEW_MODE.spacious) { _lh = line_get_height(); @@ -458,7 +475,7 @@ function Panel_Inspector() : PanelContent() constructor { var widw = con_w - ui(16); var widh = viewMode == INSP_VIEW_MODE.spacious? _lh + ui(6) + wh + ui(4) : max(wh, _lh); - if(jun != noone && _hover && point_in_rectangle(_m[0], _m[1], widx, widy, widx + widw, widy + widh)) { + if(jun != noone && drpFn != noone && _hover && point_in_rectangle(_m[0], _m[1], widx, widy, widx + widw, widy + widh)) { draw_sprite_stretched_ext(THEME.ui_panel, 1, widx, widy, widw, widh, COLORS._main_value_positive, 1); attribute_hovering = drpFn; } @@ -486,7 +503,7 @@ function Panel_Inspector() : PanelContent() constructor { var _wdgt = meta_tb[j]; draw_set_text(_font, fa_left, fa_top, COLORS._main_text_inner); - draw_text_over(ui(16), viewMode == INSP_VIEW_MODE.spacious? yy : yy + ui(3), __txt(display[0])); + draw_text_add(ui(16), viewMode == INSP_VIEW_MODE.spacious? yy : yy + ui(3), __txt(display[0])); if(viewMode == INSP_VIEW_MODE.spacious) { _lh = line_get_height(); @@ -580,6 +597,9 @@ function Panel_Inspector() : PanelContent() constructor { hh += ui(viewMode? 4 : 2); } + if(_cAll == 1) { for( var i = 0, n = array_length(meta_display); i < n; i++ ) meta_display[i][1] = false; } + else if(_cAll == -1) { for( var i = 0, n = array_length(meta_display); i < n; i++ ) meta_display[i][1] = true; } + return hh; } @@ -714,6 +734,7 @@ function Panel_Inspector() : PanelContent() constructor { var color_picker_index = 0; var pickers = []; var _colsp = false; + var _cAll = 0; for(var i = 0; i < amo; i++) { var yy = hh + _y; @@ -792,6 +813,7 @@ function Panel_Inspector() : PanelContent() constructor { continue; } + jun.step(); jun.fixHeight = -1; jun.panel = self; jun.rx = ui(16) + x; @@ -835,12 +857,12 @@ function Panel_Inspector() : PanelContent() constructor { if(_hover && point_in_rectangle(_m[0], _m[1], lbx, yy, lbx + lbw, yy + lbh)) { contentPane.hover_content = true; draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, con_w - lbx, lbh, COLORS.panel_inspector_group_hover, 1); - - if(mouse_press(mb_left, pFOCUS)) - jun[@ 1] = !coll; - - if(mouse_press(mb_right, pFOCUS)) - menuCall("inspector_group_menu", group_menu, 0, 0, fa_left); + + if(pFOCUS) { + if(DOUBLE_CLICK) _cAll = jun[@ 1]? -1 : 1; + else if(mouse_press(mb_left)) jun[@ 1] = !coll; + else if(mouse_press(mb_right, pFOCUS)) menuCall("inspector_group_menu", group_menu, 0, 0, fa_left); + } } else draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, con_w - lbx, lbh, COLORS.panel_inspector_group_bg, 1); @@ -1026,6 +1048,10 @@ function Panel_Inspector() : PanelContent() constructor { } } + if(_cAll == 1) { section_expand_all(); } + else if(_cAll == -1) { section_collapse_all(); } + + if(MESSAGE != noone && MESSAGE.type == "Color") { var inp = array_safe_get_fast(pickers, picker_index, 0); if(is_struct(inp)) { @@ -1332,4 +1358,12 @@ function Panel_Inspector() : PanelContent() constructor { return self; } +} + +function New_Inspect_Node_Panel(node, pin = true) { + panel = panelAdd("Panel_Inspector", true, false); + panel.content.setInspecting(node, true, false); + panel.destroy_on_click_out = !pin; + + return panel; } \ No newline at end of file diff --git a/scripts/pathnodeBox/pathnodeBox.gml b/scripts/pathnodeBox/pathnodeBox.gml index 42b5632b4..fc4b63ee0 100644 --- a/scripts/pathnodeBox/pathnodeBox.gml +++ b/scripts/pathnodeBox/pathnodeBox.gml @@ -46,14 +46,14 @@ function pathnodeBox(_junction) : widget() constructor { var bi = 0; if(ihover && point_in_rectangle(_m[0], _m[1], x, y, x + iw, y + h)) { - TOOLTIP = __txt("Go to node"); + TOOLTIP = __txt("View node"); bi = 1; if(mouse_click(mb_left, iactive)) bi = 2; if(mouse_press(mb_left, iactive) && is(_path, Node)) - PANEL_GRAPH.setFocusingNode(_path); + New_Inspect_Node_Panel(_path); } draw_sprite_stretched_ext(THEME.button_def, bi, x, y, iw, h); diff --git a/scripts/project_data/project_data.gml b/scripts/project_data/project_data.gml index 884b8270a..5d3485e5d 100644 --- a/scripts/project_data/project_data.gml +++ b/scripts/project_data/project_data.gml @@ -89,16 +89,17 @@ tunnels_out = ds_map_create(); #region ===================== BINDERS ==================== - bind_gamemaker_path = ""; - bind_godot_path = ""; - bind_gamemaker = noone; bind_godot = noone; + + gamemaker_editWidget = new gamemakerPathBox(self); #endregion #region =================== ATTRIBUTES =================== attributes = variable_clone(PROJECT_ATTRIBUTES); - + attributes.bind_gamemaker_path = ""; + attributes.bind_godot_path = ""; + attributeEditor = [ [ "Default Surface", "surface_dimension", new vectorBox(2, function(val, index) { @@ -148,7 +149,7 @@ } ], - //[ "Strict", "strict", new checkBox(function() { attributes.strict = !attributes.strict; RENDER_ALL return true; }), function() {} ], + // [ "Gamemaker Link", "bind_gamemaker_path", gamemaker_editWidget, noone ], ]; static setPalette = function(pal = noone) { @@ -266,9 +267,6 @@ } _map.addon = _addon; - _map.bind_gamemaker_path = bind_gamemaker_path; - _map.bind_godot_path = bind_godot_path; - return _map; } @@ -324,8 +322,8 @@ if(_node) PANEL_INSPECTOR.setInspecting(_node); } - if(struct_has(_map, "bind_gamemaker_path")) bind_gamemaker_path = _map.bind_gamemaker_path; - if(struct_has(_map, "bind_godot_path")) bind_godot_path = _map.bind_godot_path; + bind_gamemaker = Binder_Gamemaker(attributes.bind_gamemaker_path); + if(bind_gamemaker == noone) attributes.bind_gamemaker_path = ""; } static postDeserialize = function() { diff --git a/scripts/tilesetBox/tilesetBox.gml b/scripts/tilesetBox/tilesetBox.gml index 1b3b80d0b..87146bcc5 100644 --- a/scripts/tilesetBox/tilesetBox.gml +++ b/scripts/tilesetBox/tilesetBox.gml @@ -41,14 +41,14 @@ function tilesetBox(_junction) : widget() constructor { var bi = 0; if(ihover && point_in_rectangle(_m[0], _m[1], x, y, x + iw, y + h)) { - TOOLTIP = __txt("Go to node"); + TOOLTIP = __txt("View node"); bi = 1; if(mouse_click(mb_left, iactive)) bi = 2; - if(mouse_press(mb_left, iactive)) - PANEL_GRAPH.setFocusingNode(_tileset); + if(mouse_press(mb_left, iactive) && is(_tileset, Node)) + New_Inspect_Node_Panel(_tileset); } draw_sprite_stretched_ext(THEME.button_def, bi, x, y, iw, h); diff --git a/sprites/s_gamemaker/a88c0c6e-7b5b-4d21-9e05-efa98490498f.png b/sprites/s_gamemaker/a88c0c6e-7b5b-4d21-9e05-efa98490498f.png new file mode 100644 index 0000000000000000000000000000000000000000..e482c9e3ae1626172b46e117705920722605d28a GIT binary patch literal 407 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=k0Y$sR$z3=CCj3=9n|3=F@3LJcn% z7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG?e4+iVk@H0SMY*DFuf3N|}EICpMlXU5fCKmE5eJV!C8<`)MX5lF z!N|bKMAy(j*T^!&z{1MF$ja1M+rYrez(D%3I}3`2-29Zxv`X9>viAMo0o0%Yx1l66 dH?_DVF}DD>9^2LT(t&yyJYD@<);T3K0Ra5FhxGse literal 0 HcmV?d00001 diff --git a/sprites/s_gamemaker/layers/a88c0c6e-7b5b-4d21-9e05-efa98490498f/cc462eeb-166f-485a-8e0a-f62059f49d24.png b/sprites/s_gamemaker/layers/a88c0c6e-7b5b-4d21-9e05-efa98490498f/cc462eeb-166f-485a-8e0a-f62059f49d24.png new file mode 100644 index 0000000000000000000000000000000000000000..e482c9e3ae1626172b46e117705920722605d28a GIT binary patch literal 407 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=k0Y$sR$z3=CCj3=9n|3=F@3LJcn% z7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG?e4+iVk@H0SMY*DFuf3N|}EICpMlXU5fCKmE5eJV!C8<`)MX5lF z!N|bKMAy(j*T^!&z{1MF$ja1M+rYrez(D%3I}3`2-29Zxv`X9>viAMo0o0%Yx1l66 dH?_DVF}DD>9^2LT(t&yyJYD@<);T3K0Ra5FhxGse literal 0 HcmV?d00001 diff --git a/sprites/s_gamemaker/s_gamemaker.yy b/sprites/s_gamemaker/s_gamemaker.yy new file mode 100644 index 000000000..961d6010d --- /dev/null +++ b/sprites/s_gamemaker/s_gamemaker.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"", + "%Name":"s_gamemaker", + "bboxMode":0, + "bbox_bottom":23, + "bbox_left":8, + "bbox_right":23, + "bbox_top":8, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"a88c0c6e-7b5b-4d21-9e05-efa98490498f","name":"a88c0c6e-7b5b-4d21-9e05-efa98490498f","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":32, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"cc462eeb-166f-485a-8e0a-f62059f49d24","blendMode":0,"displayName":"default","isLocked":false,"name":"cc462eeb-166f-485a-8e0a-f62059f49d24","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_gamemaker", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"misc", + "path":"folders/sprites/misc.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_gamemaker", + "autoRecord":true, + "backdropHeight":768, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1366, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_gamemaker", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"a88c0c6e-7b5b-4d21-9e05-efa98490498f","path":"sprites/s_gamemaker/s_gamemaker.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"60afba20-c698-4677-8592-ff7d6474b013","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":16, + "yorigin":16, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":32, +} \ No newline at end of file diff --git a/sprites/s_node_tileset/s_node_tileset.yy b/sprites/s_node_tileset/s_node_tileset.yy index 9371fd8f7..a35bcea84 100644 --- a/sprites/s_node_tileset/s_node_tileset.yy +++ b/sprites/s_node_tileset/s_node_tileset.yy @@ -25,8 +25,8 @@ "nineSlice":null, "origin":4, "parent":{ - "name":"IO", - "path":"folders/nodes/icons/IO.yy", + "name":"tiler", + "path":"folders/nodes/icons/tiler.yy", }, "preMultiplyAlpha":false, "resourceType":"GMSprite", diff --git a/sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy b/sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy index 65b83c90a..cc2731529 100644 --- a/sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy +++ b/sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy @@ -25,8 +25,8 @@ "nineSlice":null, "origin":4, "parent":{ - "name":"IO", - "path":"folders/nodes/icons/IO.yy", + "name":"tiler", + "path":"folders/nodes/icons/tiler.yy", }, "preMultiplyAlpha":false, "resourceType":"GMSprite", diff --git a/sprites/s_node_tileset_export/41ad1ef4-812c-4234-873f-50652a2e18cb.png b/sprites/s_node_tileset_export/41ad1ef4-812c-4234-873f-50652a2e18cb.png deleted file mode 100644 index f4c88920f3b2499c065dc9af56f2d92aeec64e6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1476 zcmZ{kdo0E`3yfXfHKD7IMaRAx>&!A#>Db1el6wRLnt(w8hH zq=#*+(T@&;*`4v^A_9@6vkM;)-nSUWRp_vbWvkm$26p482rGwzSa(id!}Y zT^MhyD)RGJzBP^PM|!V5M8GzSS}Wb(1cz4(kM71k70KM(?VcIqPYFhbS7g8#2MylJ z!o@$P=rcBQ@gn$$#oHI15{7aOc{rKRQLd5;*t2SAaEFny=(}}9iqOEh>YI|$HN-SS zelkOC_qsp*ya>$JtNw71iPDGaHar}#2pA2n{hU=u`(T*YEtWA%19W`2YpCRX3+OY| zY{ka>@$Fd?`it|NV4<)veMRDd*D%NoZHO-r7a$nBTCZO>njE}u-ZT0xdW3{d50og$ zmF;^>CbS`VklZgIuqU;AgOAl|;ZwXG#ToRBlD5nlv@&0Hq$oH61IWLkDOBsQh!)!E z4w@U=b@`{}mU^t{11GJslQI;)*>>ptqzk#?!iy+r_KMVZ{kIu)$k?A>bV4zAW6Z>; ztttav0>~+Gcw|{u_4T-R-UQ4a5o;{%MaOrqCAK^8%3W1UczD=j_`w8eD^^(B_yqp_ z*brKtW8XhDKM%n(0maWN(5P%?^w{$De4((B?ttKV!S3u-3HWuLedmh{de^Q3NnS7gQaPTL z*+4`KrD^b|k|pcTWR@Vim@<@H8!&JYw>E55i~M!76Bl}R%LXK)ISv)R{nwCZrhV)Y z7N@`18Y8Gz>5a+LChhrz;1*3Fxzeeo4>li7Ad>bzwK%*_*GN~p7pv`9_{Fp|9KNHX zG>Tyynh}TTIj)|*NOT+-_qgMGS&LP>4Bpn>zBud9RWa3Cn9>IgkU?%Pu8pt9 zCXOEOQ@;{-@eEx{&RYL z6aUeLb5@@XtvE1~SjH+Go;I!{^#s`?hR!(K<7D>;Dtg{kRL1o^ ziOpkDj<5WbU&xqPib1(~P>Qu`nSN>fnLh>tuVUcuY^z7m%Kb9@+O~D zWHX)7736=+n@S?$=1k_vi53mfp82;5d!#k2>Mi)lI9e;`*>GspF4rv7Pi~igZMU_t zURMh4b@+_dpsl1k_|wGmk5pr?#5A&7T_@%-xR*iQlgQz(5#BTL;J%vxy2}aqF=- zN9;NX!a|H*Yfq^-|)5S5Q;?~<)zW&02 z60PTNPjeEVac#>q7AJ;YF1I8e&N^3*T`Ic@AKN$VHT=ieTli4^gS~)xo9x9S{Zl7B zaI)i>$a+y=W9}uUT=r)>7H$mKTE49Kx!AJvdAF*c&nq^1|Mtum)>|ynhFc9h84KP& zC%_5DgVd(zUQ|Y z*H)gcnejy0?3wAw4Vinbm@1Yf>^l{FxoWRj{q!Yo6&Pkek-fZYuaUir(enc}Q)Ny% zUj8-P^uBA+!PcKz^F7LDeY@zx;6KYC{^>@)Ud6MLJ{1LhCm+ik;AZ&kd*;5qMZ4J+ zd!C6t3@?f;Yn@$+cA2tC9S>(X+07uwu!Hr1&6nwc$~g?H8SXJw=qa7P6{ckAyXncn zbL+Z=PG+jlo3fr^QZPeYruX&eWiBb_HZyp*F|IlIH|?3ZG((%qkt`E~MHPoWE`DZi z&VAx}dE)J~`zftXO%*n6CA)Tidu+#WoncR|MSS7h)mzzHog{C*=_~xqkZ{|@YX?^zj-y*qOwjq;o8D|Z{D*NX4h?qY;KY#Ks+bXX# zd1s@~vt9O#AzGp$-M5$7Ue7FYe&DU}fpLcx<9-3bBaaK0Zrm90<_RkULvwTb)MG~< zdzsgjvg~7Fl5bcoEe33RcFHA39SxUvo>SP;^@>G?hT9&=5$Pv<_+1!ZoNInp^iD-K_>Od z*2pYiZc{CBjVMV;EJ?LWE=mPb3`Pbzopr05)pUHvj+t literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_export/layers/41ad1ef4-812c-4234-873f-50652a2e18cb/fc03369a-caa3-4b07-9134-abc0293d62e6.png b/sprites/s_node_tileset_export/layers/41ad1ef4-812c-4234-873f-50652a2e18cb/fc03369a-caa3-4b07-9134-abc0293d62e6.png deleted file mode 100644 index f4c88920f3b2499c065dc9af56f2d92aeec64e6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1476 zcmZ{kdo0E`3yfXfHKD7IMaRAx>&!A#>Db1el6wRLnt(w8hH zq=#*+(T@&;*`4v^A_9@6vkM;)-nSUWRp_vbWvkm$26p482rGwzSa(id!}Y zT^MhyD)RGJzBP^PM|!V5M8GzSS}Wb(1cz4(kM71k70KM(?VcIqPYFhbS7g8#2MylJ z!o@$P=rcBQ@gn$$#oHI15{7aOc{rKRQLd5;*t2SAaEFny=(}}9iqOEh>YI|$HN-SS zelkOC_qsp*ya>$JtNw71iPDGaHar}#2pA2n{hU=u`(T*YEtWA%19W`2YpCRX3+OY| zY{ka>@$Fd?`it|NV4<)veMRDd*D%NoZHO-r7a$nBTCZO>njE}u-ZT0xdW3{d50og$ zmF;^>CbS`VklZgIuqU;AgOAl|;ZwXG#ToRBlD5nlv@&0Hq$oH61IWLkDOBsQh!)!E z4w@U=b@`{}mU^t{11GJslQI;)*>>ptqzk#?!iy+r_KMVZ{kIu)$k?A>bV4zAW6Z>; ztttav0>~+Gcw|{u_4T-R-UQ4a5o;{%MaOrqCAK^8%3W1UczD=j_`w8eD^^(B_yqp_ z*brKtW8XhDKM%n(0maWN(5P%?^w{$De4((B?ttKV!S3u-3HWuLedmh{de^Q3NnS7gQaPTL z*+4`KrD^b|k|pcTWR@Vim@<@H8!&JYw>E55i~M!76Bl}R%LXK)ISv)R{nwCZrhV)Y z7N@`18Y8Gz>5a+LChhrz;1*3Fxzeeo4>li7Ad>bzwK%*_*GN~p7pv`9_{Fp|9KNHX zG>Tyynh}TTIj)|*NOT+-_qgMGS&LP>4Bpn>zBud9RWa3Cn9>IgkU?%Pu8pt9 zCXOEOQ@;{-@eEx{&RYL z6aUeLb5@@XtvE1~SjH+Go;I!{^#s`?hR!(K<7D>;Dtg{kRL1o^ ziOpkDj<5WbU&xqPib1(~P>Qu`nSN>fnLh>tuVUcuY^z7m%Kb9@+O~D zWHX)7736=+n@S?$=1k_vi53mfp82;5d!#k2>Mi)lI9e;`*>GspF4rv7Pi~igZMU_t zURMh4b@+_dpsl1k_|wGmk5pr?#5A&7T_@%-xR*iQlgQz(5#BTL;J%vxy2}aqF=- zN9;NX!a|H*Yfq^-|)5S5Q;?~<)zW&02 z60PTNPjeEVac#>q7AJ;YF1I8e&N^3*T`Ic@AKN$VHT=ieTli4^gS~)xo9x9S{Zl7B zaI)i>$a+y=W9}uUT=r)>7H$mKTE49Kx!AJvdAF*c&nq^1|Mtum)>|ynhFc9h84KP& zC%_5DgVd(zUQ|Y z*H)gcnejy0?3wAw4Vinbm@1Yf>^l{FxoWRj{q!Yo6&Pkek-fZYuaUir(enc}Q)Ny% zUj8-P^uBA+!PcKz^F7LDeY@zx;6KYC{^>@)Ud6MLJ{1LhCm+ik;AZ&kd*;5qMZ4J+ zd!C6t3@?f;Yn@$+cA2tC9S>(X+07uwu!Hr1&6nwc$~g?H8SXJw=qa7P6{ckAyXncn zbL+Z=PG+jlo3fr^QZPeYruX&eWiBb_HZyp*F|IlIH|?3ZG((%qkt`E~MHPoWE`DZi z&VAx}dE)J~`zftXO%*n6CA)Tidu+#WoncR|MSS7h)mzzHog{C*=_~xqkZ{|@YX?^zj-y*qOwjq;o8D|Z{D*NX4h?qY;KY#Ks+bXX# zd1s@~vt9O#AzGp$-M5$7Ue7FYe&DU}fpLcx<9-3bBaaK0Zrm90<_RkULvwTb)MG~< zdzsgjvg~7Fl5bcoEe33RcFHA39SxUvo>SP;^@>G?hT9&=5$Pv<_+1!ZoNInp^iD-K_>Od z*2pYiZc{CBjVMV;EJ?LWE=mPb3`Pbzopr05)pUHvj+t literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_export/s_node_tileset_export.yy b/sprites/s_node_tileset_export/s_node_tileset_export.yy index 9f419eec7..1407254aa 100644 --- a/sprites/s_node_tileset_export/s_node_tileset_export.yy +++ b/sprites/s_node_tileset_export/s_node_tileset_export.yy @@ -3,8 +3,8 @@ "%Name":"s_node_tileset_export", "bboxMode":0, "bbox_bottom":61, - "bbox_left":4, - "bbox_right":59, + "bbox_left":9, + "bbox_right":54, "bbox_top":2, "collisionKind":1, "collisionTolerance":0, @@ -12,21 +12,21 @@ "edgeFiltering":false, "For3D":false, "frames":[ - {"$GMSpriteFrame":"","%Name":"41ad1ef4-812c-4234-873f-50652a2e18cb","name":"41ad1ef4-812c-4234-873f-50652a2e18cb","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"fab849f5-5a5b-45e3-b20b-6e6adf4ef06a","name":"fab849f5-5a5b-45e3-b20b-6e6adf4ef06a","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, ], "gridX":0, "gridY":0, "height":64, "HTile":false, "layers":[ - {"$GMImageLayer":"","%Name":"fc03369a-caa3-4b07-9134-abc0293d62e6","blendMode":0,"displayName":"default","isLocked":false,"name":"fc03369a-caa3-4b07-9134-abc0293d62e6","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + {"$GMImageLayer":"","%Name":"b15d1c5b-5a69-4cde-a6bd-4a2d5d4b6872","blendMode":0,"displayName":"default","isLocked":false,"name":"b15d1c5b-5a69-4cde-a6bd-4a2d5d4b6872","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, ], "name":"s_node_tileset_export", "nineSlice":null, "origin":4, "parent":{ - "name":"IO", - "path":"folders/nodes/icons/IO.yy", + "name":"tiler", + "path":"folders/nodes/icons/tiler.yy", }, "preMultiplyAlpha":false, "resourceType":"GMSprite", @@ -69,8 +69,8 @@ "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"41ad1ef4-812c-4234-873f-50652a2e18cb","path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"7a774c57-8fb5-4744-bf39-c20e7e9a1ac7","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"fab849f5-5a5b-45e3-b20b-6e6adf4ef06a","path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"11bb715f-b866-4e7a-8816-a70fe189bfbb","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], "visibleRange":null, diff --git a/sprites/s_node_tileset_render/e3ed7e8b-cdba-4e78-ad91-517384a46d66.png b/sprites/s_node_tileset_render/e3ed7e8b-cdba-4e78-ad91-517384a46d66.png new file mode 100644 index 0000000000000000000000000000000000000000..7aeac961591ec8c3a0947c9d27cb0280f998838f GIT binary patch literal 1288 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=3dtTpz6=aiY77hwEes65fI|H*Yfr0tAr;B4q#jUrqFXmqk z6KUT+TX(US)GZfISu**jALtotTgJp2CS$2^()pP$aFUiUVp zLciSGWL`k%SLOt%9UMy<9_E!_S~QROdt-dV{8oYgrmPEAy*hqi{ekIs-);5X#lECf zV0AUan?Ikn|F)>GZCSr%;)9E(KD!kv%97?>vwPw0z$S6oZhy_rqnp!bhphg8>r(fL z$Fp0e=P?=VmP;u6n{a!*B8!Zj&7q~MQWPPTXp=E;nR}~gF?4v&emqw^!p-zSXz3Gv0=O&-l{btTE|NQYIMEc$C3;$ ze|8LJ;Fq)6BHAEwtL4JKvRf_bF714h+pk{vteLRAO3qR*>cDJW{rGBau*J(9(@B@6$Hzs#GYL2q{Q6=($L43NHDiX?Qa=Mj!?xp> zcjkQ+VQ5G(I{D;Dxs1h!iPnq^CpNiQ*&coHU;&WL((I@g;~~r^U72@f*Q{v=TUoRH zTSB&`?JTyN-@kI@<}+vio|~-hZ_S;M{d%jexQX`q>!)WL-!FQ7EmzL=)YiN8=a(H= z=T~L3ZR*Lsd%Rwgd=xhPwQnfM<-D@rx7L2Dm7{`zhuLrTt+T$0ytZg)Y-IdXXU}kN zmH4V>wJMW6ft>5>|GRC?vh|gn$kaP&$+xMV?o18lsYXH@!_;KC8Md8%va>kdvg(U) zIY@ZZ)!m-QnHjQEH|aBEWIfH>v^cdO^JU@R3Y9GjF&6*mfwmxpIVaok*WrxWs zo^83mg&HJx$~j!NRFKH|yYj=aV{W&vy^3WP=->V?E+O%u;?}7AJAUuguP<+S&G_ZW z?T7ZypU<58d$soUvcDV`m@C%hbF|*t-@G`QtNnY(mS1Tcwhh0lx`UV7DT`Qj2rw=8 z;%L4a!ulN-CxVN7g#W;mbgZgq$HN4S|t~y0x1R~10xe%Ljzr7 zgAfCADnC}Q!>*kacg*%zqJFXK?80>NoH|H*Yfr0tAr;B4q#jUrqFXmqk z6KUT+TX(US)GZfISu**jALtotTgJp2CS$2^()pP$aFUiUVp zLciSGWL`k%SLOt%9UMy<9_E!_S~QROdt-dV{8oYgrmPEAy*hqi{ekIs-);5X#lECf zV0AUan?Ikn|F)>GZCSr%;)9E(KD!kv%97?>vwPw0z$S6oZhy_rqnp!bhphg8>r(fL z$Fp0e=P?=VmP;u6n{a!*B8!Zj&7q~MQWPPTXp=E;nR}~gF?4v&emqw^!p-zSXz3Gv0=O&-l{btTE|NQYIMEc$C3;$ ze|8LJ;Fq)6BHAEwtL4JKvRf_bF714h+pk{vteLRAO3qR*>cDJW{rGBau*J(9(@B@6$Hzs#GYL2q{Q6=($L43NHDiX?Qa=Mj!?xp> zcjkQ+VQ5G(I{D;Dxs1h!iPnq^CpNiQ*&coHU;&WL((I@g;~~r^U72@f*Q{v=TUoRH zTSB&`?JTyN-@kI@<}+vio|~-hZ_S;M{d%jexQX`q>!)WL-!FQ7EmzL=)YiN8=a(H= z=T~L3ZR*Lsd%Rwgd=xhPwQnfM<-D@rx7L2Dm7{`zhuLrTt+T$0ytZg)Y-IdXXU}kN zmH4V>wJMW6ft>5>|GRC?vh|gn$kaP&$+xMV?o18lsYXH@!_;KC8Md8%va>kdvg(U) zIY@ZZ)!m-QnHjQEH|aBEWIfH>v^cdO^JU@R3Y9GjF&6*mfwmxpIVaok*WrxWs zo^83mg&HJx$~j!NRFKH|yYj=aV{W&vy^3WP=->V?E+O%u;?}7AJAUuguP<+S&G_ZW z?T7ZypU<58d$soUvcDV`m@C%hbF|*t-@G`QtNnY(mS1Tcwhh0lx`UV7DT`Qj2rw=8 z;%L4a!ulN-CxVN7g#W;mbgZgq$HN4S|t~y0x1R~10xe%Ljzr7 zgAfCADnC}Q!>*kacg*%zqJFXK?80>NoH":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_node_tileset_render", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"e3ed7e8b-cdba-4e78-ad91-517384a46d66","path":"sprites/s_node_tileset_render/s_node_tileset_render.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"9b9f013c-e20f-49dd-b336-ac74a8ca984d","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":32, + "yorigin":32, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":64, +} \ No newline at end of file diff --git a/sprites/s_node_tileset_rule/a6dd42e2-e4cd-4977-bf7f-1b896802b5cd.png b/sprites/s_node_tileset_rule/a6dd42e2-e4cd-4977-bf7f-1b896802b5cd.png new file mode 100644 index 0000000000000000000000000000000000000000..5081f91403fbb6ca17f178a15b10fa10149190e5 GIT binary patch literal 1325 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=3dtTpz6=aiY77hwEes65fI|H*Yfq_NA)5S5Q;?~>QXY)fs zC63h}56a|rlDuW)E3KtH!>Pkjm8fJWC?o6R!`JoxZ+)eJQ(H4AOxy>IUE3SxK={GeI&l@0To>&?vdt)Hx$HfiLr z*s+%}$a_iZm@xtEkuSJ+VirRlv$5MfrVq>omQ88$8|EKXyx?Lu$4sKK_S9#6uN%6S zO!v&^t!I#LpA*lg=iYIdWe!^$*Cjaxr31lDOmEEQoez6hqk4vAj_Mu_R~=1aw?@AIWV`DpWb(`9Q7U*g}T%CObbbK`;H* z>V~s?tPB#N^Yp(>^L*B@gSSJvlc7*r!2Afyg=Xg4jll=R+P~#7`mxq_Iux1z;GM8= zN80;xl>?az*ehgTOjVe|)9CZz=HnBUldY4FKJsYT<)Y+phwTWjC*zsmduHt0))~$_ zdX7znbw{Gj{+A97+m(N9YI>6WA-ik&E{5X`>5bV3wgfI`;0fL%thm8iD8J-Ub=kwa|!9$D)Z-;KYIJ> z>gpG7V%&?17tgE>)Vvz5yZkN3ja0Qwk>%%@pM3tDvbq1x?l-I2yuBL2j17$+pZm#G zyCuv~Sg=5`Q7)`kLWp=S&MDA|H!o=X36EusOVttYqMv~N-Fu%f84*}*s1U2Yd{ z7N33g#EG*zYD<+4IQInK?CTSG{J8&LtV8z3|CX1oZBv|+y7kBw-p1EyN$2OuE(v-) z=gp%jK_#WRk4{WH{BY4N8JB6!1>Vx;_cjY%3u@S*@7~@}Yc_rHwH4oA7itQ=`o=Ew zpK4hBAx0&38J+fb63n_66wm|K8b&or0gM}c}6JYD@<);T3K F0RSMwKs5jW literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_rule/layers/a6dd42e2-e4cd-4977-bf7f-1b896802b5cd/02fd5ff2-e948-44f5-b5b4-c922da3a0973.png b/sprites/s_node_tileset_rule/layers/a6dd42e2-e4cd-4977-bf7f-1b896802b5cd/02fd5ff2-e948-44f5-b5b4-c922da3a0973.png new file mode 100644 index 0000000000000000000000000000000000000000..5081f91403fbb6ca17f178a15b10fa10149190e5 GIT binary patch literal 1325 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=3dtTpz6=aiY77hwEes65fI|H*Yfq_NA)5S5Q;?~>QXY)fs zC63h}56a|rlDuW)E3KtH!>Pkjm8fJWC?o6R!`JoxZ+)eJQ(H4AOxy>IUE3SxK={GeI&l@0To>&?vdt)Hx$HfiLr z*s+%}$a_iZm@xtEkuSJ+VirRlv$5MfrVq>omQ88$8|EKXyx?Lu$4sKK_S9#6uN%6S zO!v&^t!I#LpA*lg=iYIdWe!^$*Cjaxr31lDOmEEQoez6hqk4vAj_Mu_R~=1aw?@AIWV`DpWb(`9Q7U*g}T%CObbbK`;H* z>V~s?tPB#N^Yp(>^L*B@gSSJvlc7*r!2Afyg=Xg4jll=R+P~#7`mxq_Iux1z;GM8= zN80;xl>?az*ehgTOjVe|)9CZz=HnBUldY4FKJsYT<)Y+phwTWjC*zsmduHt0))~$_ zdX7znbw{Gj{+A97+m(N9YI>6WA-ik&E{5X`>5bV3wgfI`;0fL%thm8iD8J-Ub=kwa|!9$D)Z-;KYIJ> z>gpG7V%&?17tgE>)Vvz5yZkN3ja0Qwk>%%@pM3tDvbq1x?l-I2yuBL2j17$+pZm#G zyCuv~Sg=5`Q7)`kLWp=S&MDA|H!o=X36EusOVttYqMv~N-Fu%f84*}*s1U2Yd{ z7N33g#EG*zYD<+4IQInK?CTSG{J8&LtV8z3|CX1oZBv|+y7kBw-p1EyN$2OuE(v-) z=gp%jK_#WRk4{WH{BY4N8JB6!1>Vx;_cjY%3u@S*@7~@}Yc_rHwH4oA7itQ=`o=Ew zpK4hBAx0&38J+fb63n_66wm|K8b&or0gM}c}6JYD@<);T3K F0RSMwKs5jW literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_rule/s_node_tileset_rule.yy b/sprites/s_node_tileset_rule/s_node_tileset_rule.yy new file mode 100644 index 000000000..15c4d790e --- /dev/null +++ b/sprites/s_node_tileset_rule/s_node_tileset_rule.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"", + "%Name":"s_node_tileset_rule", + "bboxMode":0, + "bbox_bottom":63, + "bbox_left":15, + "bbox_right":48, + "bbox_top":0, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"a6dd42e2-e4cd-4977-bf7f-1b896802b5cd","name":"a6dd42e2-e4cd-4977-bf7f-1b896802b5cd","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":64, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"02fd5ff2-e948-44f5-b5b4-c922da3a0973","blendMode":0,"displayName":"default","isLocked":false,"name":"02fd5ff2-e948-44f5-b5b4-c922da3a0973","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_node_tileset_rule", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"tiler", + "path":"folders/nodes/icons/tiler.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_node_tileset_rule", + "autoRecord":true, + "backdropHeight":768, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1366, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_node_tileset_rule", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"a6dd42e2-e4cd-4977-bf7f-1b896802b5cd","path":"sprites/s_node_tileset_rule/s_node_tileset_rule.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"d70a0d91-9da3-4b3e-8106-f97f2fba0f6d","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":32, + "yorigin":32, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":64, +} \ No newline at end of file