From 15a938bcea7a4798ec4fd5ad99c8799dc3c6f5ed Mon Sep 17 00:00:00 2001 From: MakhamDev Date: Tue, 25 Jan 2022 10:05:30 +0700 Subject: [PATCH] Add node in between connection, collection size --- Pixels Composer.yyp | 3 + objects/o_dialog_add_node/Create_0.gml | 57 +++- objects/o_main/Create_0.gml | 12 +- objects/o_main/Other_2.gml | 1 + objects/o_main/Step_1.gml | 11 +- scripts/append_function/append_function.gml | 1 + scripts/collection_data/collection_data.gml | 19 +- scripts/debug/debug.gml | 18 +- scripts/draw_line_curve/draw_line_curve.gml | 24 ++ scripts/node_array_get/node_array_get.gml | 27 +- scripts/node_collection/node_collection.gml | 27 ++ scripts/node_data/node_data.gml | 45 ++- .../node_display_text/node_checkerboard.yy | 12 + .../node_display_text/node_display_text.gml | 73 ++++ .../node_display_text/node_display_text.yy | 12 + scripts/node_display_text/node_stripe.yy | 12 + scripts/node_frame/node_frame.gml | 5 +- scripts/node_group_input/node_group_input.gml | 11 +- scripts/node_iterate/node_iterate.gml | 8 +- .../node_iteration_index.gml | 5 +- .../node_iteration_input.gml | 15 +- scripts/node_math/node_math.gml | 122 +++++-- scripts/node_pin/node_pin.gml | 2 +- scripts/node_registry/node_registry.gml | 14 +- scripts/node_solid/node_solid.gml | 12 +- scripts/panel_collection/panel_collection.gml | 316 +++++++----------- scripts/panel_function/panel_function.gml | 2 +- scripts/panel_graph/panel_graph.gml | 8 +- scripts/panel_menu/panel_menu.gml | 2 +- scripts/render_data/render_data.gml | 96 +++--- scripts/save_function/save_function.gml | 4 +- scripts/type_conversion/type_conversion.gml | 3 + scripts/type_conversion/type_conversion.yy | 12 + .../087b63df-395b-442a-9541-13c1b948a89e.png | Bin 0 -> 332 bytes .../e370d044-47b2-4385-b536-765d62658b53.png | Bin 0 -> 257 bytes .../1b3ed37a-f867-49ee-9b1f-1668f53c9a96.png | Bin 0 -> 313 bytes .../1b3ed37a-f867-49ee-9b1f-1668f53c9a96.png | Bin 0 -> 251 bytes .../s_folder_content_24.yy | 83 +++++ .../388f3040-3a10-4d25-9bbf-2ed6887d2f11.png | Bin 0 -> 434 bytes .../7e26ac4a-cf07-4d11-8846-fdb949383281.png | Bin 486 -> 0 bytes .../436620d9-dfdd-4d34-8647-b12b0b32e71e.png | Bin 0 -> 436 bytes .../08c0d8ba-52ee-4d3c-9201-abc52d91e889.png | Bin 489 -> 0 bytes sprites/s_node_pin_bg/s_node_pin_bg.yy | 18 +- .../05b2e8dc-35db-4c71-b1f0-22dde0d3e82b.png | Bin 707 -> 0 bytes .../604a92a7-301f-4d97-9458-fb3556493573.png | Bin 0 -> 626 bytes .../38a923c1-df5b-4555-933d-e573af686008.png | Bin 712 -> 0 bytes .../8e106beb-1be9-406e-954b-3a5f83ae687e.png | Bin 0 -> 630 bytes .../s_node_pin_bg_active.yy | 42 ++- 48 files changed, 749 insertions(+), 385 deletions(-) create mode 100644 scripts/node_display_text/node_checkerboard.yy create mode 100644 scripts/node_display_text/node_display_text.gml create mode 100644 scripts/node_display_text/node_display_text.yy create mode 100644 scripts/node_display_text/node_stripe.yy create mode 100644 scripts/type_conversion/type_conversion.gml create mode 100644 scripts/type_conversion/type_conversion.yy create mode 100644 sprites/s_folder_content_24/087b63df-395b-442a-9541-13c1b948a89e.png create mode 100644 sprites/s_folder_content_24/e370d044-47b2-4385-b536-765d62658b53.png create mode 100644 sprites/s_folder_content_24/layers/087b63df-395b-442a-9541-13c1b948a89e/1b3ed37a-f867-49ee-9b1f-1668f53c9a96.png create mode 100644 sprites/s_folder_content_24/layers/e370d044-47b2-4385-b536-765d62658b53/1b3ed37a-f867-49ee-9b1f-1668f53c9a96.png create mode 100644 sprites/s_folder_content_24/s_folder_content_24.yy create mode 100644 sprites/s_node_pin_bg/388f3040-3a10-4d25-9bbf-2ed6887d2f11.png delete mode 100644 sprites/s_node_pin_bg/7e26ac4a-cf07-4d11-8846-fdb949383281.png create mode 100644 sprites/s_node_pin_bg/layers/388f3040-3a10-4d25-9bbf-2ed6887d2f11/436620d9-dfdd-4d34-8647-b12b0b32e71e.png delete mode 100644 sprites/s_node_pin_bg/layers/7e26ac4a-cf07-4d11-8846-fdb949383281/08c0d8ba-52ee-4d3c-9201-abc52d91e889.png delete mode 100644 sprites/s_node_pin_bg_active/05b2e8dc-35db-4c71-b1f0-22dde0d3e82b.png create mode 100644 sprites/s_node_pin_bg_active/604a92a7-301f-4d97-9458-fb3556493573.png delete mode 100644 sprites/s_node_pin_bg_active/layers/05b2e8dc-35db-4c71-b1f0-22dde0d3e82b/38a923c1-df5b-4555-933d-e573af686008.png create mode 100644 sprites/s_node_pin_bg_active/layers/604a92a7-301f-4d97-9458-fb3556493573/8e106beb-1be9-406e-954b-3a5f83ae687e.png diff --git a/Pixels Composer.yyp b/Pixels Composer.yyp index 781974979..7e3972ca8 100644 --- a/Pixels Composer.yyp +++ b/Pixels Composer.yyp @@ -186,6 +186,7 @@ {"id":{"name":"node_registry","path":"scripts/node_registry/node_registry.yy",},"order":1,}, {"id":{"name":"sh_checkerboard","path":"shaders/sh_checkerboard/sh_checkerboard.yy",},"order":12,}, {"id":{"name":"node_character","path":"scripts/node_character/node_character.yy",},"order":9,}, + {"id":{"name":"s_folder_content_24","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"order":38,}, {"id":{"name":"draw_set_text","path":"scripts/draw_set_text/draw_set_text.yy",},"order":1,}, {"id":{"name":"s_button_right","path":"sprites/s_button_right/s_button_right.yy",},"order":6,}, {"id":{"name":"node_color_data","path":"scripts/node_color_data/node_color_data.yy",},"order":4,}, @@ -201,6 +202,7 @@ {"id":{"name":"buttonPalette","path":"scripts/buttonPalette/buttonPalette.yy",},"order":6,}, {"id":{"name":"s_node_zigzag","path":"sprites/s_node_zigzag/s_node_zigzag.yy",},"order":0,}, {"id":{"name":"s_node_timeline_preview","path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",},"order":99,}, + {"id":{"name":"type_conversion","path":"scripts/type_conversion/type_conversion.yy",},"order":8,}, {"id":{"name":"node_keyframe","path":"scripts/node_keyframe/node_keyframe.yy",},"order":7,}, {"id":{"name":"s_node_pixel_cloud","path":"sprites/s_node_pixel_cloud/s_node_pixel_cloud.yy",},"order":81,}, {"id":{"name":"o_dialog_drag_folder","path":"objects/o_dialog_drag_folder/o_dialog_drag_folder.yy",},"order":20,}, @@ -445,6 +447,7 @@ {"id":{"name":"node_3d_transform","path":"scripts/node_3d_transform/node_3d_transform.yy",},"order":2,}, {"id":{"name":"s_node_dilate","path":"sprites/s_node_dilate/s_node_dilate.yy",},"order":40,}, {"id":{"name":"s_node_3d_transform","path":"sprites/s_node_3d_transform/s_node_3d_transform.yy",},"order":5,}, + {"id":{"name":"node_display_text","path":"scripts/node_display_text/node_display_text.yy",},"order":3,}, {"id":{"name":"s_prop_gradient","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"order":11,}, {"id":{"name":"s_kenney","path":"sprites/s_kenney/s_kenney.yy",},"order":0,}, {"id":{"name":"sh_grid_noise","path":"shaders/sh_grid_noise/sh_grid_noise.yy",},"order":8,}, diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index c98e49133..1fe3d6c7b 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -7,6 +7,7 @@ event_inherited(); node_target_x = 0; node_target_y = 0; node_called = noone; + junction_hovering = noone; dialog_w = ADD_NODE_W; dialog_h = ADD_NODE_H; @@ -21,24 +22,45 @@ event_inherited(); page_key = ADD_NODE_PAGE == ""? NODE_CATAGORY[| 2] : ADD_NODE_PAGE; page = ALL_NODES[? page_key]; - function buildNode(_node) { + function buildNode(_node, _param = "") { instance_destroy(); if(!_node) return; - var _new_node = _node.build(node_target_x, node_target_y); + var _new_node = _node.build(node_target_x, node_target_y, _param); - if(_new_node && node_called) { - var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _new_node.outputs : _new_node.inputs; - for(var i = 0; i < ds_list_size(_node_list); i++) { - var _target = _node_list[| i]; - if(_target.isVisible() && (value_bit(_target.type) & value_bit(node_called.type))) { - if(node_called.connect_type == JUNCTION_CONNECT.input) { - node_called.setFrom(_node_list[| i]); - _new_node.x -= _new_node.w; - } else - _node_list[| i].setFrom(node_called); - break; + if(_new_node) { + if(node_called != noone) { + var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _new_node.outputs : _new_node.inputs; + for(var i = 0; i < ds_list_size(_node_list); i++) { + var _target = _node_list[| i]; + if(_target.isVisible() && (value_bit(_target.type) & value_bit(node_called.type))) { + if(node_called.connect_type == JUNCTION_CONNECT.input) { + node_called.setFrom(_node_list[| i]); + _new_node.x -= _new_node.w; + } else + _node_list[| i].setFrom(node_called); + break; + } + } + } else if(junction_hovering != noone) { + var to = junction_hovering; + var from = junction_hovering.value_from; + + for( var i = 0; i < ds_list_size(_new_node.inputs); i++ ) { + var _in = _new_node.inputs[| i]; + if(value_bit(_in.type) & value_bit(from.type)) { + _in.setFrom(from); + break; + } + } + + for( var i = 0; i < ds_list_size(_new_node.outputs); i++ ) { + var _ot = _new_node.outputs[| i]; + if(value_bit(_ot.type) & value_bit(to.type)) { + to.setFrom(_ot); + break; + } } } } @@ -206,9 +228,12 @@ event_inherited(); if(!_node) continue; var match = string_pos(search_lower, string_lower(_node.name)) > 0; + var param = ""; for( var k = 0; k < array_length(_node.tags); k++ ) { - if(string_pos(search_lower, _node.tags[k]) > 0) + if(string_pos(search_lower, _node.tags[k]) > 0) { match = true; + param = _node.tags[k]; + } } if(match) { @@ -227,13 +252,13 @@ event_inherited(); if(point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) { node_selecting = amo; if(mouse_check_button_pressed(mb_left)) - buildNode(_node); + buildNode(_node, param); } if(node_selecting == amo) { draw_sprite_stretched(s_node_active, 0, _boxx, yy, grid_size, grid_size); if(keyboard_check_pressed(vk_enter)) - buildNode(_node); + buildNode(_node, param); } if(node_focusing == amo) { diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index 27c6ae1db..58c78a0dd 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -2,9 +2,7 @@ #region log var path = "log_temp.txt"; var f = file_text_open_append(path); - var t = string(current_year) + "/" + string(current_month) + "/" + string(current_day) - + " " + string(current_hour) + ":" + string(current_minute) + ":" + string(current_second) - + " > "; + var t = _log_template(); file_text_write_string(f, "[MESSAGE] " + t + "session begin" + "\n"); if (!code_is_compiled()) { @@ -26,10 +24,12 @@ display_reset(0, 1); draw_set_circle_precision(64); globalvar CURSOR, UPDATE, TOOLTIP, DIALOG_DEPTH_HOVER; + globalvar RENDER_STACK; DIALOG_DEPTH_HOVER = 0; - UPDATE = false; + UPDATE = RENDER_TYPE.none; CURSOR = cr_default; TOOLTIP = ""; + RENDER_STACK = ds_stack_create(); _cursor = CURSOR; dc_check = 0; @@ -45,9 +45,7 @@ display_reset(0, 1); addHotkey("", "Redo", "Z", MOD_KEY.ctrl | MOD_KEY.shift, function() { REDO(); }); addHotkey("", "Render all", vk_f5, MOD_KEY.none, function() { - for(var i = 0; i < ds_list_size(NODES); i++) - NODES[| i].setRenderStatus(false); - UPDATE = true; + UPDATE |= RENDER_TYPE.full; }); globalvar HOTKEY_MOD; diff --git a/objects/o_main/Other_2.gml b/objects/o_main/Other_2.gml index ebce5d15e..3becad53d 100644 --- a/objects/o_main/Other_2.gml +++ b/objects/o_main/Other_2.gml @@ -2,6 +2,7 @@ #region directory globalvar DIRECTORY; DIRECTORY = "C:\\Users\\" + environment_get_variable("USERNAME") + "\\AppData\\Local\\Pixels_Composer\\"; + log_clear(); log_newline(); log_message("SESSION", "Begin"); log_message("DIRECTORY", DIRECTORY); diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index 8ff2a8db9..46a64177d 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -48,11 +48,14 @@ NODES[| i].stepBegin(); } - if(UPDATE) { - //renderUpdated(); + if(UPDATE & RENDER_TYPE.full) { renderAll(); - UPDATE = false; - } + UPDATE = RENDER_TYPE.none; + } else if(UPDATE & RENDER_TYPE.partial) { + show_debug_message("Update partial stack size = " + string(ds_stack_size(RENDER_STACK))); + renderUpdated(); + UPDATE = RENDER_TYPE.none; + } #endregion #region clicks diff --git a/scripts/append_function/append_function.gml b/scripts/append_function/append_function.gml index 87c3b96e8..81d3557b0 100644 --- a/scripts/append_function/append_function.gml +++ b/scripts/append_function/append_function.gml @@ -90,6 +90,7 @@ function APPEND(_path) { log_message("FILE", "append file " + _path); PANEL_MENU.showNoti("Collection loaded", s_noti_icon_file_load); + return node_create; } diff --git a/scripts/collection_data/collection_data.gml b/scripts/collection_data/collection_data.gml index f661e40a6..0caaf7a58 100644 --- a/scripts/collection_data/collection_data.gml +++ b/scripts/collection_data/collection_data.gml @@ -1,14 +1,16 @@ -function FileContext(_name, _path) constructor { +function FileContext(_name, _path, _subfolder = false) constructor { name = _name; path = _path; spr = -1; + + subfolder = _subfolder; } function __init_collection() { log_message("COLLECTION", "init"); globalvar COLLECTIONS; - COLLECTIONS = ds_list_create(); + COLLECTIONS = -1; var _ = DIRECTORY + "Collections"; var _l = _ + "\\coll" + string(VERSION); @@ -26,21 +28,12 @@ function __init_collection() { function searchCollections() { log_message("COLLECTION", "refreshing collection base folder."); - ds_list_clear(COLLECTIONS); - var f = new FileContext("Base node", ""); - ds_list_add(COLLECTIONS, f); if(!directory_exists(DIRECTORY + "Collections")) { directory_create(DIRECTORY + "Collections"); return; } - var _l = DIRECTORY + "Collections"; - var folder = file_find_first(_l + "/*", fa_directory); - while(folder != "") { - if(directory_exists(_l + "\\" + folder)) - ds_list_add(COLLECTIONS, new FileContext(folder, _l + "\\" + folder)); - folder = file_find_next(); - } - file_find_close(); + COLLECTIONS = new DirectoryObject("Collections", DIRECTORY + "Collections"); + COLLECTIONS.open = true; } \ No newline at end of file diff --git a/scripts/debug/debug.gml b/scripts/debug/debug.gml index dc75cadb9..78ed8b3bb 100644 --- a/scripts/debug/debug.gml +++ b/scripts/debug/debug.gml @@ -1,9 +1,13 @@ -function __log(title, str) { - var path = DIRECTORY + "log.txt"; - var f = file_text_open_append(path); - var t = string(current_year) + "/" + string(current_month) + "/" + string(current_day) +function _log_template() { + return string(current_year) + "/" + string(current_month) + "/" + string(current_day) + " " + string(current_hour) + ":" + string(current_minute) + ":" + string(current_second) + " > "; +} + +function __log(title, str, fname = "log.txt") { + var path = DIRECTORY + fname; + var f = file_text_open_append(path); + var t = _log_template(); file_text_write_string(f, string(title) + t + string(str) + "\n"); file_text_close(f); @@ -29,6 +33,12 @@ function log_newline() { file_text_close(f); } +function log_clear() { + var path = DIRECTORY + "log.txt"; + if(file_exists(path)) + file_delete(path); +} + exception_unhandled_handler(function(ex) { var tt = "\n-------------------------- OH NO --------------------------\n\n"; tt += ex.longMessage; diff --git a/scripts/draw_line_curve/draw_line_curve.gml b/scripts/draw_line_curve/draw_line_curve.gml index f07ce8ee0..73bd855bf 100644 --- a/scripts/draw_line_curve/draw_line_curve.gml +++ b/scripts/draw_line_curve/draw_line_curve.gml @@ -54,3 +54,27 @@ function draw_line_curve_color(x0, y0, x1, y1, thick = 1, col1, col2) { oc = nc; } } + +function distance_to_curve(mx, my, x0, y0, x1, y1) { + var xc = (x0 + x1) / 2; + var sample = max(8, ceil((abs(x0 - x1) + abs(y0 - y1)) / 4)); + + var dist = 999999; + var ox, oy, nx, ny, t, it; + + for( var i = 0; i <= sample; i++ ) { + t = i / sample; + it = 1 - t; + + nx = x0 * t * t * t + 3 * xc * it * t * t + 3 * xc * it * it * t + x1 * it * it * it; + ny = y0 * t * t * t + 3 * y0 * it * t * t + 3 * y1 * it * it * t + y1 * it * it * it; + + if(i) + dist = min(dist, distance_to_line(mx, my, ox, oy, nx, ny)); + + ox = nx; + oy = ny; + } + + return dist; +} \ No newline at end of file diff --git a/scripts/node_array_get/node_array_get.gml b/scripts/node_array_get/node_array_get.gml index bc9857287..36ff1fc3b 100644 --- a/scripts/node_array_get/node_array_get.gml +++ b/scripts/node_array_get/node_array_get.gml @@ -15,14 +15,37 @@ function Node_Array_Get(_x, _y) : Node(_x, _y) constructor { inputs[| 0] = nodeValue(0, "Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); - inputs[| 1] = nodeValue(1, "Index", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0); + inputs[| 1] = nodeValue(1, "Index", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setVisible(true, true); + + inputs[| 2] = nodeValue(2, "Overflow", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY.enum_scroll, ["Clamp", "Loop", "Ping Pong"]); outputs[| 0] = nodeValue(0, "Size", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0); static update = function() { var _arr = inputs[| 0].getValue(); if(!is_array(_arr)) return; - var index = clamp(inputs[| 1].getValue(), 0, array_length(_arr) - 1); + + var index = inputs[| 1].getValue(); + var _len = array_length(_arr); + var _of = inputs[| 2].getValue(); + switch(_of) { + case 0 : + index = clamp(index, 0, _len - 1); + break; + case 1 : + index = safe_mod(index, _len); + if(index < 0) index = _len + index; + break; + case 2 : + var _pplen = (_len - 1) * 2; + index = safe_mod(abs(index), _pplen); + if(index >= _len) + index = _pplen - index; + break; + } + outputs[| 0].setValue(_arr[index]); } diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index 2679b8024..eaa01b210 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -33,6 +33,23 @@ function Node_Collection(_x, _y) : Node(_x, _y) constructor { for(var i = 0; i < ds_list_size(nodes); i++) { nodes[| i].stepBegin(); } + + var out_surf = false; + + for( var i = 0; i < ds_list_size(outputs); i++ ) { + if(outputs[| i].type == VALUE_TYPE.surface) + out_surf = true; + } + + if(out_surf) { + w = 128; + min_h = 128; + } else { + w = 96; + min_h = 0; + } + + setHeight(); } static step = function() { @@ -82,6 +99,7 @@ function Node_Collection(_x, _y) : Node(_x, _y) constructor { for( var i = custom_input_index; i < siz; i++ ) { var _jin = ds_priority_delete_min(ar); _jin.index = i; + _jin.from.inputs[| 5].setValue(i); ds_list_add(inputs, _jin); } @@ -104,6 +122,7 @@ function Node_Collection(_x, _y) : Node(_x, _y) constructor { for( var i = custom_output_index; i < siz; i++ ) { var _jout = ds_priority_delete_min(ar); _jout.index = i; + _jout.from.inputs[| 1].setValue(i); ds_list_add(outputs, _jout); } @@ -115,4 +134,12 @@ function Node_Collection(_x, _y) : Node(_x, _y) constructor { nodes[| i].destroy(); } } + + static resetRenderStatus = function() { + for( var i = 0; i < ds_list_size(nodes); i++ ) { + nodes[| i].setRenderStatus(false); + if(variable_struct_exists(nodes[| i], "nodes")) + nodes[| i].resetRenderStatus(); + } + } } \ No newline at end of file diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 7f3c1a3db..cc7a891da 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -79,6 +79,7 @@ function Node(_x, _y) constructor { if(array_length(cached_output) != ANIMATOR.frames_total + 1) array_resize(cached_output, ANIMATOR.frames_total + 1); } + var stack_push = false; if(always_output) { for(var i = 0; i < ds_list_size(outputs); i++) { @@ -89,14 +90,12 @@ function Node(_x, _y) constructor { for(var j = 0; j < array_length(val); j++) { var _surf = val[j]; if(!is_surface(_surf) || _surf == DEF_SURFACE) { - setRenderStatus(false); - UPDATE = true; + stack_push = true; } } } else { if(!is_surface(val) || val == DEF_SURFACE) { - setRenderStatus(false); - UPDATE = true; + stack_push = true; } } } @@ -108,12 +107,17 @@ function Node(_x, _y) constructor { doUpdate(); for(var i = 0; i < ds_list_size(inputs); i++) { if(inputs[| i].isAnim()) { - setRenderStatus(false); - UPDATE = true; + stack_push = true; } } } + if(stack_push) { + setRenderStatus(false); + UPDATE |= RENDER_TYPE.full; + //ds_stack_push(RENDER_STACK, self); + } + if(auto_height) setHeight(); } @@ -149,8 +153,8 @@ function Node(_x, _y) constructor { static updateForward = function() { rendered = false; - UPDATE = true; - //if(auto_update) doUpdate(); + UPDATE |= RENDER_TYPE.full; + //ds_stack_push(RENDER_STACK, self); for(var i = 0; i < ds_list_size(outputs); i++) { var jun = outputs[| i]; @@ -299,6 +303,7 @@ function Node(_x, _y) constructor { static drawConnections = function(_x, _y, mx, my, _s) { var xx = x * _s + _x; + var hovering = noone; for(var i = 0; i < ds_list_size(inputs); i++) { var jun = inputs[| i]; var jx = xx; @@ -310,13 +315,29 @@ function Node(_x, _y) constructor { var c0 = value_color(jun.value_from.type); var c1 = value_color(jun.type); + var hover = false; + var th = max(1, 2 * _s); - if(PREF_MAP[? "curve_connection_line"]) - draw_line_curve_color(jx, jy, frx, fry, max(1, 2 * _s), c0, c1); - else - draw_line_width_color(jx, jy, frx, fry, max(1, 2 * _s), c0, c1); + if(PREF_MAP[? "curve_connection_line"]) { + hover = distance_to_curve(mx, my, jx, jy, frx, fry) < 6; + } else { + hover = distance_to_line(mx, my, jx, jy, frx, fry) < 6; + } + + if(hover) + hovering = jun; + if(PANEL_GRAPH.junction_hovering == jun) + th *= 2; + + if(PREF_MAP[? "curve_connection_line"]) { + draw_line_curve_color(jx, jy, frx, fry, th, c0, c1); + } else { + draw_line_width_color(jx, jy, frx, fry, th, c0, c1); + } } } + + return hovering; } static drawPreview = function(_node, xx, yy, _s) { diff --git a/scripts/node_display_text/node_checkerboard.yy b/scripts/node_display_text/node_checkerboard.yy new file mode 100644 index 000000000..f65eb196c --- /dev/null +++ b/scripts/node_display_text/node_checkerboard.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "generator", + "path": "folders/nodes/data/generator.yy", + }, + "resourceVersion": "1.0", + "name": "node_checkerboard", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_display_text/node_display_text.gml b/scripts/node_display_text/node_display_text.gml new file mode 100644 index 000000000..6259644c5 --- /dev/null +++ b/scripts/node_display_text/node_display_text.gml @@ -0,0 +1,73 @@ +function Node_create_Display_Text(_x, _y) { + var node = new Node_Display_Text(_x, _y); + ds_list_add(PANEL_GRAPH.nodes_list, node); + return node; +} + +function Node_Display_Text(_x, _y) : Node(_x, _y) constructor { + name = "Display text"; + w = 240; + h = 160; + min_h = 0; + bg_spr = s_node_frame_bg; + bg_sel_spr = s_node_frame_bg_active; + + size_dragging = false; + size_dragging_w = w; + size_dragging_h = h; + size_dragging_mx = w; + size_dragging_my = h; + + auto_height = false; + name_hover = false; + draw_scale = 1; + + inputs[| 0] = nodeValue(0, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white ); + + inputs[| 1] = nodeValue(1, "Text", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "Text"); + + inputs[| 2] = nodeValue(2, "Style", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2) + .setDisplay(VALUE_DISPLAY.enum_scroll, ["Header", "Sub header", "Normal"]) + + inputs[| 3] = nodeValue(3, "Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.75) + .setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]) + + input_display_list = [1, + ["Styling", false], 2, 0, 3]; + + static drawNodeBase = function(xx, yy, _s) { + var color = inputs[| 0].getValue(); + var txt = inputs[| 1].getValue(); + if(txt == "") txt = "..." + var sty = inputs[| 2].getValue(); + var alp = inputs[| 3].getValue(); + var font = f_p1; + switch(sty) { + case 0 : font = f_h3; break; + case 1 : font = f_h5; break; + case 2 : font = f_p1; break; + } + + draw_set_alpha(alp); + draw_set_text(font, fa_left, fa_top, color); + draw_text_transformed(xx + 4, yy + 4, txt, _s, _s, 0); + draw_set_alpha(1); + + draw_scale = _s; + w = string_width(txt) + 8; + h = string_height(txt) + 8; + } + + static drawNode = function(_x, _y, _mx, _my, _s) { + var xx = x * _s + _x; + var yy = y * _s + _y; + + if(active_draw_index > -1) { + draw_sprite_stretched(bg_sel_spr, active_draw_index, xx, yy, w * _s, h * _s); + active_draw_index = -1; + } + + drawNodeBase(xx, yy, _s); + return noone; + } +} \ No newline at end of file diff --git a/scripts/node_display_text/node_display_text.yy b/scripts/node_display_text/node_display_text.yy new file mode 100644 index 000000000..4cbfe3aa9 --- /dev/null +++ b/scripts/node_display_text/node_display_text.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "node", + "path": "folders/nodes/data/node.yy", + }, + "resourceVersion": "1.0", + "name": "node_display_text", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_display_text/node_stripe.yy b/scripts/node_display_text/node_stripe.yy new file mode 100644 index 000000000..3c179d416 --- /dev/null +++ b/scripts/node_display_text/node_stripe.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "generator", + "path": "folders/nodes/data/generator.yy", + }, + "resourceVersion": "1.0", + "name": "node_stripe", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_frame/node_frame.gml b/scripts/node_frame/node_frame.gml index e08f767e3..5d5fab8e0 100644 --- a/scripts/node_frame/node_frame.gml +++ b/scripts/node_frame/node_frame.gml @@ -21,10 +21,9 @@ function Node_Frame(_x, _y) : Node(_x, _y) constructor { name_hover = false; inputs[| 0] = nodeValue(0, "Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 240, 160 ] ) - .setDisplay(VALUE_DISPLAY.vector) - + .setDisplay(VALUE_DISPLAY.vector); - inputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white ) + inputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white ); static step = function() { diff --git a/scripts/node_group_input/node_group_input.gml b/scripts/node_group_input/node_group_input.gml index 150329a10..030910869 100644 --- a/scripts/node_group_input/node_group_input.gml +++ b/scripts/node_group_input/node_group_input.gml @@ -135,9 +135,14 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor { } } - static createInput = function() { + static createInput = function(override_order = true) { if(group && is_struct(group)) { - input_index = inputs[| 5].getValue(); + if(override_order) { + input_index = ds_list_size(group.inputs); + inputs[| 5].setValue(input_index); + } else { + input_index = inputs[| 5].getValue(); + } inParent = nodeValue(ds_list_size(group.inputs), "Value", group, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1) .setVisible(true, true); @@ -191,7 +196,7 @@ function Node_Group_Input(_x, _y, _group) : Node(_x, _y) constructor { } static postDeserialize = function() { - createInput(); + createInput(false); onValueUpdate(0); } diff --git a/scripts/node_iterate/node_iterate.gml b/scripts/node_iterate/node_iterate.gml index d1b4674b4..aa16af5ce 100644 --- a/scripts/node_iterate/node_iterate.gml +++ b/scripts/node_iterate/node_iterate.gml @@ -5,7 +5,7 @@ function Node_create_Iterate(_x, _y) { } function Node_Iterate(_x, _y) : Node_Collection(_x, _y) constructor { - name = "Iterate"; + name = "Loop"; color = c_ui_lime; icon = s_group_16; @@ -27,17 +27,13 @@ function Node_Iterate(_x, _y) : Node_Collection(_x, _y) constructor { iter &= _out.rendered; } - //show_debug_message("get output from iteration " + string(iterated)); - if(iter) { if(++iterated == inputs[| 0].getValue()) return 2; else if(iterated > inputs[| 0].getValue()) return 3; - for( var i = 0; i < ds_list_size(nodes); i++ ) { - nodes[| i].setRenderStatus(false); - } + resetRenderStatus(); return 1; } diff --git a/scripts/node_iteration_index/node_iteration_index.gml b/scripts/node_iteration_index/node_iteration_index.gml index bdbd92b93..18a3ef5f8 100644 --- a/scripts/node_iteration_index/node_iteration_index.gml +++ b/scripts/node_iteration_index/node_iteration_index.gml @@ -12,9 +12,10 @@ function Node_Iterator_Index(_x, _y) : Node(_x, _y) constructor { w = 96; min_h = 32 + 24 * 1; - outputs[| 0] = nodeValue(0, "Index", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); + outputs[| 0] = nodeValue(0, "Loop index", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); static update = function() { - outputs[| 0].setValue(group.iterated); + if(variable_struct_exists(group, "iterated")) + outputs[| 0].setValue(group.iterated); } } \ No newline at end of file diff --git a/scripts/node_iteration_input/node_iteration_input.gml b/scripts/node_iteration_input/node_iteration_input.gml index eb26e6a15..93aaa403a 100644 --- a/scripts/node_iteration_input/node_iteration_input.gml +++ b/scripts/node_iteration_input/node_iteration_input.gml @@ -49,7 +49,9 @@ function Node_Iterator_Input(_x, _y, _group) : Node(_x, _y) constructor { outputs[| 0].getValueDefault = method(outputs[| 0], outputs[| 0].getValueRecursive); outputs[| 0].getValueRecursive = function() { //show_debug_message("iteration " + string(group.iterated)); - + if(!variable_struct_exists(group, "iterated")) + return outputs[| 0].getValueDefault(); + var _local_output = noone; for( var i = 0; i < ds_list_size(outputs[| 1].value_to); i++ ) { var vt = outputs[| 1].value_to[| i]; @@ -157,9 +159,14 @@ function Node_Iterator_Input(_x, _y, _group) : Node(_x, _y) constructor { } } - static createInput = function() { + static createInput = function(override_order = true) { if(group && is_struct(group)) { - input_index = inputs[| 5].getValue(); + if(override_order = true) { + input_index = ds_list_size(group.inputs); + inputs[| 5].setValue(input_index); + } else { + input_index = inputs[| 5].getValue(); + } inParent = nodeValue(ds_list_size(group.inputs), "Value", group, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1) .setVisible(true, true); @@ -213,7 +220,7 @@ function Node_Iterator_Input(_x, _y, _group) : Node(_x, _y) constructor { } static postDeserialize = function() { - createInput(); + createInput(false); onValueUpdate(0); } diff --git a/scripts/node_math/node_math.gml b/scripts/node_math/node_math.gml index 960c0db9c..b5f31e748 100644 --- a/scripts/node_math/node_math.gml +++ b/scripts/node_math/node_math.gml @@ -1,5 +1,44 @@ -function Node_create_Math(_x, _y) { +enum MATH_OPERATOR { + add, + subtract, + multiply, + divide, + power, + root, + + sin, + cos, + tan, + + modulo, + + floor, + ceiling, + round, +} + +function Node_create_Math(_x, _y, _param = "") { var node = new Node_Math(_x, _y); + + switch(_param) { + case "add" : node.inputs[| 0].setValue(MATH_OPERATOR.add); break; + case "subtract" : node.inputs[| 0].setValue(MATH_OPERATOR.subtract); break; + case "multiply" : node.inputs[| 0].setValue(MATH_OPERATOR.multiply); break; + case "divide" : node.inputs[| 0].setValue(MATH_OPERATOR.divide); break; + case "power" : node.inputs[| 0].setValue(MATH_OPERATOR.power); break; + case "root" : node.inputs[| 0].setValue(MATH_OPERATOR.root); break; + + case "sin" : node.inputs[| 0].setValue(MATH_OPERATOR.sin); break; + case "cos" : node.inputs[| 0].setValue(MATH_OPERATOR.cos); break; + case "tan" : node.inputs[| 0].setValue(MATH_OPERATOR.tan); break; + + case "modulo" : node.inputs[| 0].setValue(MATH_OPERATOR.modulo); break; + + case "floor" : node.inputs[| 0].setValue(MATH_OPERATOR.floor); break; + case "ceiling" : node.inputs[| 0].setValue(MATH_OPERATOR.ceiling); break; + case "round" : node.inputs[| 0].setValue(MATH_OPERATOR.round); break; + } + ds_list_add(PANEL_GRAPH.nodes_list, node); return node; } @@ -13,7 +52,9 @@ function Node_Math(_x, _y) : Node_Value_Processor(_x, _y) constructor { min_h = 0; inputs[| 0] = nodeValue(0, "Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) - .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Add", "Subtract", "Multiply", "Divide", "Power", "Root", "Sin", "Cos", "Tan" ]); + .setDisplay(VALUE_DISPLAY.enum_scroll, [ + /* 0 - 9*/ "Add", "Subtract", "Multiply", "Divide", "Power", "Root", "Sin", "Cos", "Tan", "Modulo", + /*10 - 12*/ "Floor", "Ceil", "Round" ]); inputs[| 1] = nodeValue(1, "a", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setVisible(true, true); @@ -24,32 +65,41 @@ function Node_Math(_x, _y) : Node_Value_Processor(_x, _y) constructor { function process_value_data(_data, index = 0) { switch(_data[0]) { - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : + case MATH_OPERATOR.add : + case MATH_OPERATOR.subtract : + case MATH_OPERATOR.multiply : + case MATH_OPERATOR.divide : + case MATH_OPERATOR.power : + case MATH_OPERATOR.root : + case MATH_OPERATOR.modulo : inputs[| 2].setVisible(true); break; - case 6 : - case 7 : - case 8 : + case MATH_OPERATOR.sin : + case MATH_OPERATOR.cos : + case MATH_OPERATOR.tan : + case MATH_OPERATOR.floor : + case MATH_OPERATOR.ceiling : + case MATH_OPERATOR.round : inputs[| 2].setVisible(false); break; } switch(_data[0]) { - case 0 : return _data[1] + _data[2]; break; - case 1 : return _data[1] - _data[2]; break; - case 2 : return _data[1] * _data[2]; break; - case 3 : return _data[1] / _data[2]; break; - case 4 : return power(_data[1], _data[2]); break; - case 5 : return power(_data[1], 1 / _data[2]); break; + case MATH_OPERATOR.add : return _data[1] + _data[2]; break; + case MATH_OPERATOR.subtract : return _data[1] - _data[2]; break; + case MATH_OPERATOR.multiply : return _data[1] * _data[2]; break; + case MATH_OPERATOR.divide : return _data[1] / _data[2]; break; + case MATH_OPERATOR.power : return power(_data[1], _data[2]); break; + case MATH_OPERATOR.root : return power(_data[1], 1 / _data[2]); break; - case 6 : return sin(_data[1]); break; - case 7 : return cos(_data[1]); break; - case 8 : return tan(_data[1]); break; + case MATH_OPERATOR.sin : return sin(_data[1]); break; + case MATH_OPERATOR.cos : return cos(_data[1]); break; + case MATH_OPERATOR.tan : return tan(_data[1]); break; + case MATH_OPERATOR.modulo : return safe_mod(_data[1], _data[2]); break; + + case MATH_OPERATOR.floor : return floor(_data[1]); break; + case MATH_OPERATOR.ceiling : return ceil(_data[1]); break; + case MATH_OPERATOR.round : return round(_data[1]); break; } return _data[1]; @@ -58,23 +108,31 @@ function Node_Math(_x, _y) : Node_Value_Processor(_x, _y) constructor { doUpdate(); function onDrawNode(xx, yy, _mx, _my, _s) { - draw_set_text(f_h5, fa_center, fa_center, c_white); + draw_set_text(f_h3, fa_center, fa_center, c_white); var str; switch(inputs[| 0].getValue()) { - case 0 : str = "+"; break; - case 1 : str = "-"; break; - case 2 : str = "*"; break; - case 3 : str = "/"; break; - case 4 : str = "pow";; break; - case 5 : str = "root"; break; + case MATH_OPERATOR.add : str = "+"; break; + case MATH_OPERATOR.subtract : str = "-"; break; + case MATH_OPERATOR.multiply : str = "*"; break; + case MATH_OPERATOR.divide : str = "/"; break; + case MATH_OPERATOR.power : str = "pow";; break; + case MATH_OPERATOR.root : str = "root"; break; - case 6 : str = "sin"; break; - case 7 : str = "cos"; break; - case 8 : str = "tan"; break; + case MATH_OPERATOR.sin : str = "sin"; break; + case MATH_OPERATOR.cos : str = "cos"; break; + case MATH_OPERATOR.tan : str = "tan"; break; + case MATH_OPERATOR.modulo : str = "mod"; break; + + case MATH_OPERATOR.floor : str = "floor"; break; + case MATH_OPERATOR.ceiling : str = "ceil"; break; + case MATH_OPERATOR.round : str = "round"; break; } - var _ss = min((w - 8) * _s / string_width(str), (h - 8) * _s / string_height(str)); + var _ss = min((w - 16) * _s / string_width(str), (h - 18) * _s / string_height(str)); - draw_text_transformed(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, _ss, _ss, 0); + if(_s * w > 48) + draw_text_transformed(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, _ss, _ss, 0); + else + draw_text_transformed(xx + w / 2 * _s, yy + h / 2 * _s, str, _ss, _ss, 0); } } \ No newline at end of file diff --git a/scripts/node_pin/node_pin.gml b/scripts/node_pin/node_pin.gml index 21b2906db..94ffe5668 100644 --- a/scripts/node_pin/node_pin.gml +++ b/scripts/node_pin/node_pin.gml @@ -6,7 +6,7 @@ function Node_create_Pin(_x, _y) { function Node_Pin(_x, _y) : Node(_x, _y) constructor { name = ""; - w = 64; + w = 32; h = 32; min_h = 0; auto_height = false; diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 51666f993..f1d851b22 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -5,8 +5,8 @@ function NodeObject(_name, _spr, _create, tags = []) constructor { self.tags = tags; - function build(_x, _y) { - var _node = createNode(_x, _y); + function build(_x, _y, _param = "") { + var _node = createNode(_x, _y, _param); return _node; } } @@ -137,7 +137,7 @@ function NodeObject(_name, _spr, _create, tags = []) constructor { var number = ds_list_create(); addNodeCatagory("Number", number); - addNodeObject(number, "Math", s_node_math, "Node_Math", Node_create_Math); + addNodeObject(number, "Math", s_node_math, "Node_Math", Node_create_Math, ["add", "subtract", "multiply", "divide", "power", "modulo", "round", "ceiling", "floor", "sin", "cos", "tan"]); addNodeObject(number, "Array", s_node_array, "Node_Array", Node_create_Array); addNodeObject(number, "Array length", s_node_array_length, "Node_Array_Length", Node_create_Array_Length); addNodeObject(number, "Array get", s_node_array_get, "Node_Array_Get", Node_create_Array_Get); @@ -195,11 +195,13 @@ function NodeObject(_name, _spr, _create, tags = []) constructor { var node = ds_list_create(); addNodeCatagory("Node", node); - addNodeObject(node, "Pin", s_node_pin, "Node_Pin", Node_create_Pin); - addNodeObject(node, "Frame", s_node_frame, "Node_Frame", Node_create_Frame); - addNodeObject(node, "Condition", s_node_condition, "Node_Condition", Node_create_Condition); + addNodeObject(node, "Pin", s_node_pin, "Node_Pin", Node_create_Pin); + addNodeObject(node, "Frame", s_node_frame, "Node_Frame", Node_create_Frame); + addNodeObject(node, "Display text", s_node_frame, "Node_Display_Text", Node_create_Display_Text); + addNodeObject(node, "Condition", s_node_condition, "Node_Condition", Node_create_Condition); NODE_CREATE_FUCTION[? "Node_Group"] = Node_create_Group; + NODE_CREATE_FUCTION[? "Node_Iterate"] = Node_create_Iterate; #endregion #region node function diff --git a/scripts/node_solid/node_solid.gml b/scripts/node_solid/node_solid.gml index 86bd55039..2c78b6a42 100644 --- a/scripts/node_solid/node_solid.gml +++ b/scripts/node_solid/node_solid.gml @@ -12,11 +12,14 @@ function Node_Solid(_x, _y) : Node(_x, _y) constructor { inputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white); + inputs[| 2] = nodeValue(2, "Empty", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1)); static update = function() { - var _dim = inputs[| 0].getValue(); - var _col = inputs[| 1].getValue(); + var _dim = inputs[| 0].getValue(); + var _col = inputs[| 1].getValue(); + var _emp = inputs[| 2].getValue(); var _outSurf = outputs[| 0].getValue(); if(!is_surface(_outSurf)) { @@ -26,7 +29,10 @@ function Node_Solid(_x, _y) : Node(_x, _y) constructor { surface_size_to(_outSurf, surface_valid(_dim[0]), surface_valid(_dim[1])); surface_set_target(_outSurf); - draw_clear(_col); + if(_emp) + draw_clear_alpha(0, 0); + else + draw_clear(_col); surface_reset_target(); } doUpdate(); diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 6441f7c97..182a8a311 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -1,20 +1,94 @@ +function DirectoryObject(name, path) constructor { + self.name = name; + self.path = path; + + subDir = ds_list_create(); + open = false; + + static destroy = function() { + ds_list_destroy(subDir); + } + + static getSub = function() { + var _temp_name = ds_list_create(); + var folder = file_find_first(path + "/*", fa_directory); + while(folder != "") { + ds_list_add(_temp_name, folder); + folder = file_find_next(); + } + file_find_close(); + + ds_list_clear(subDir); + + ds_list_sort(_temp_name, true); + for( var i = 0; i < ds_list_size(_temp_name); i++ ) { + var file = _temp_name[| i]; + + if(directory_exists(path + "/" + file)) { + var _fol_path = path + "/" + file; + var fol = new DirectoryObject(file, _fol_path); + ds_list_add(subDir, fol); + } + } + + ds_list_destroy(_temp_name); + } + getSub(); + + static draw = function(_x, _y, _m, _w) { + var hg = 28; + var hh = 0; + + if(path == PANEL_COLLECTION.context.path) + draw_sprite_stretched_ext(s_ui_panel_bg, 0, _x, _y, _w, hg, c_ui_blue_ltgrey, 1); + + if(HOVER == PANEL_COLLECTION.panel && point_in_rectangle(_m[0], _m[1], 0, _y, _w, _y + hg - 1)) { + draw_sprite_stretched_ext(s_ui_panel_bg, 0, _x, _y, _w, hg, c_ui_blue_white, 1); + if(FOCUS == PANEL_COLLECTION.panel && mouse_check_button_pressed(mb_left)) { + open = !open; + + if(PANEL_COLLECTION.context = self) + PANEL_COLLECTION.setContext(COLLECTIONS); + else + PANEL_COLLECTION.setContext(self); + } + } + + draw_set_text(f_p0, fa_left, fa_center, c_white); + if(ds_list_empty(subDir)) { + draw_sprite_ext(s_folder_24, 0, _x + 16, _y + hg / 2 - 1, 1, 1, 0, c_ui_blue_dkgrey, 1); + } else { + draw_sprite_ext(s_folder_content_24, open, _x + 16, _y + hg / 2 - 1, 1, 1, 0, c_ui_blue_grey, 1); + } + draw_text(_x + 8 + 24, _y + hg / 2, name); + hh += hg; + _y += hg; + + if(open) { + for(var i = 0; i < ds_list_size(subDir); i++) { + var hg = subDir[| i].draw(_x + 16, _y, _m, _w - 16); + hh += hg; + _y += hg; + } + } + + return hh; + } +} + function Panel_Collection(_panel) : PanelContent(_panel) constructor { - group_w = 160; + group_w = 180; content_w = w - 24 - group_w; content_h = h - 32 - 16; min_w = group_w + 40; min_h = 40; - context = ds_list_create(); - ds_list_add(context, COLLECTIONS); - page_key = ""; + context = COLLECTIONS; - folder_list = ds_list_create(); content_list = ds_list_create(); file_dragging = noone; - readonly = false; _menu_node = noone; contentPane = new scrollPane(content_w, content_h, function(_y, _m) { @@ -54,11 +128,9 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { dia.setMenu([ [ "Replace with selected", function() { saveCollection(_menu_node.path, false); - searchFolder(); } ], [ "Delete", function() { file_delete(_menu_node.path); - searchFolder(); } ], ]); } @@ -86,112 +158,12 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { folderPane = new scrollPane(group_w - 8, content_h, function(_y, _m) { draw_clear(c_ui_blue_black); + var hh = 0; - var hh = 0; - var hg = 28; - var key = ""; - var con = getCurrentContext(); - - if(con) { - if(con.path == "") { - for(var i = 0; i < ds_list_size(NODE_CATAGORY); i++) { - var key = NODE_CATAGORY[| i]; - - if(key == page_key) { - draw_sprite_stretched_ext(s_ui_panel_bg, 0, 8, _y, folderPane.w - 16, hg, c_ui_blue_ltgrey, 1); - } else if(HOVER == panel && point_in_rectangle(_m[0], _m[1], 0, _y, group_w + 16, _y + hg - 1)) { - draw_sprite_stretched_ext(s_ui_panel_bg, 0, 8, _y, folderPane.w - 16, hg, c_ui_blue_white, 1); - if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { - ds_list_copy(content_list, ALL_NODES[? key]); - page_key = key; - contentPane.scroll_y = 0; - contentPane.scroll_y_to = 0; - } - } - - draw_set_text(f_p0, fa_left, fa_center, c_white); - draw_text(16, _y + hg / 2, key); - hh += hg; - _y += hg; - } - } else { - for(var i = 0; i < ds_list_size(folder_list); i++) { - folder = folder_list[| i]; - - if(folder.name == page_key) { - draw_sprite_stretched_ext(s_ui_panel_bg, 0, 8, _y, folderPane.w - 16, hg, c_ui_blue_ltgrey, 1); - } else if(HOVER == panel && point_in_rectangle(_m[0], _m[1], 0, _y, group_w + 16, _y + hg - 1)) { - draw_sprite_stretched_ext(s_ui_panel_bg, 0, 8, _y, folderPane.w - 16, hg, c_ui_blue_white, 1); - if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { - ds_list_add(context, folder); - searchFolder(); - - contentPane.scroll_y = 0; - contentPane.scroll_y_to = 0; - file_find_close(); - } - - if(FOCUS == panel && mouse_check_button_pressed(mb_right)) { - var dia = dialogCall(o_dialog_menubox, mouse_mx + 8, mouse_my + 8); - dia.setMenu([ - [ "Delete", function() { - directory_destroy(folder.path); - searchFolder(); - } ], - ]); - } - } - - draw_set_text(f_p0, fa_left, fa_center, c_white); - if(folder.path == "") { - draw_text(16, _y + hg / 2, folder.name); - } else { - draw_sprite_ext(s_folder_24, 0, 16 + 8, _y + hg / 2 - 1, 1, 1, 0, c_ui_blue_grey, 1); - draw_text(16 + 24, _y + hg / 2, folder.name); - } - hh += hg; - _y += hg; - } - } - } else { - for(var i = 0; i < ds_list_size(COLLECTIONS); i++) { - folder = COLLECTIONS[| i]; - - if(HOVER == panel && point_in_rectangle(_m[0], _m[1], 0, _y, group_w + 16, _y + hg - 1)) { - draw_sprite_stretched_ext(s_ui_panel_bg, 0, 8, _y, folderPane.w - 16, hg, c_ui_blue_white, 1); - - if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { - readonly = i == 0; - ds_list_add(context, folder); - searchFolder(); - - contentPane.scroll_y = 0; - contentPane.scroll_y_to = 0; - } - - if(FOCUS == panel && mouse_check_button_pressed(mb_right)) { - if(folder.path != "") { - var dia = dialogCall(o_dialog_menubox, mouse_mx + 8, mouse_my + 8); - dia.setMenu([ - [ "Delete", function() { - directory_destroy(folder.path); - searchFolder(); - } ], - ]); - } - } - } - - draw_set_text(f_p0, fa_left, fa_center, c_white); - if(folder.path == "") { - draw_text(16, _y + hg / 2, folder.name); - } else { - draw_sprite_ext(s_folder_24, 0, 16 + 8, _y + hg / 2 - 1, 1, 1, 0, c_ui_blue_grey, 1); - draw_text(16 + 24, _y + hg / 2, folder.name); - } - hh += hg; - _y += hg; - } + for(var i = 0; i < ds_list_size(COLLECTIONS.subDir); i++) { + var hg = COLLECTIONS.subDir[| i].draw(8, _y, _m, folderPane.w - 16); + hh += hg; + _y += hg; } return hh; @@ -209,51 +181,43 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { return _node.build(0, 0); } - function searchFolder() { + function setContext(cont) { + context = cont; + searchContent(); + contentPane.scroll_y_raw = 0; + contentPane.scroll_y_to = 0; + } + + function searchContent() { if(content_list != -1 && ds_exists(content_list, ds_type_list)) { - if(!readonly) { - for( var i = 0; i < ds_list_size(content_list); i++ ) { - var _f = content_list[| i]; - if(_f.spr && sprite_exists(_f.spr)) - sprite_delete(_f.spr); - delete _f; - } + for( var i = 0; i < ds_list_size(content_list); i++ ) { + var _f = content_list[| i]; + if(_f.spr && sprite_exists(_f.spr)) + sprite_delete(_f.spr); + delete _f; } ds_list_clear(content_list); } else content_list = ds_list_create(); - contentPane.scroll_y = 0; - contentPane.scroll_y_to = 0; - - var _curr = getCurrentContext(); - if(_curr == -1 || _curr.path == "") { - searchCollections(); - return; - } + var _path = context.path; var _temp_name = ds_list_create(); - var folder = file_find_first(_curr.path + "/*", fa_directory); + var folder = file_find_first(_path + "/*", fa_directory); while(folder != "") { ds_list_add(_temp_name, folder); folder = file_find_next(); } file_find_close(); - ds_list_clear(folder_list); - ds_list_sort(_temp_name, true); for( var i = 0; i < ds_list_size(_temp_name); i++ ) { var file = _temp_name[| i]; - if(directory_exists(_curr.path + "/" + file)) { - var fol = new FileContext(file, _curr.path + "/" + file); - ds_list_add(folder_list, fol); - } else if(filename_ext(file) == ".json" || filename_ext(file) == ".pxcc") { - var f = new FileContext(string_copy(file, 1, string_length(file) - 5), _curr.path + "/" + file); - f.buildin = false; + if(filename_ext(file) == ".json" || filename_ext(file) == ".pxcc") { + var f = new FileContext(string_copy(file, 1, string_length(file) - 5), _path + "/" + file); ds_list_add(content_list, f); - var icon_path = _curr.path + "/" + string_copy(file, 1, string_length(file) - 5) + ".png"; + var icon_path = _path + "/" + string_copy(file, 1, string_length(file) - 5) + ".png"; if(file_exists(icon_path)) { var _temp = sprite_add(icon_path, 0, false, false, 0, 0); @@ -271,44 +235,6 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { ds_list_destroy(_temp_name); } - function drawContext() { - draw_set_text(f_p0b, fa_left, fa_center, c_ui_blue_ltgrey); - var xx = 24, tt, tw, th; - - var st = max(0, ds_list_size(context) - 2); - for(var i = st; i < ds_list_size(context); i++) { - if(i == 0) { - tt = "Collections"; - } else { - var _cnt = context[| i]; - tt = _cnt.name; - } - tw = string_width(tt); - th = string_height(tt); - - if(i < ds_list_size(context) - 1) { - if(buttonInstant(s_button_hide_fill, xx - 10, 20 - th / 2 - 3, tw + 20, th + 6, [mx, my], FOCUS == panel, HOVER == panel) == 2) { - for(var j = ds_list_size(context) - 1; j > i; j--) - ds_list_delete(context, j); - searchFolder(); - break; - } - - draw_sprite_ext(s_arrow_16, 0, xx + tw + 16, 20, 1, 1, 0, c_ui_blue_grey, 1); - } - draw_set_alpha(1); - draw_text(xx, 20, tt); - draw_set_alpha(1); - xx += tw; - xx += 32; - } - } - - function getCurrentContext() { - if(ds_list_size(context) == 1) return -1; - return context[| ds_list_size(context) - 1]; - } - function saveCollection(_path, save_surface = true) { if(PANEL_INSPECTOR.inspecting == noone) return; @@ -321,7 +247,6 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { function drawContent() { draw_clear_alpha(c_ui_blue_black, 0); - var con = getCurrentContext(); draw_sprite_stretched(s_ui_panel_bg, 1, group_w, 40, content_w + 16, content_h); contentPane.active = HOVER == panel; @@ -330,16 +255,17 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { folderPane.active = HOVER == panel; folderPane.draw(0, 40, mx, my - 40); - drawContext(); + draw_set_text(f_p0b, fa_left, fa_center, c_ui_blue_ltgrey); + draw_text(24, 20, "Collections"); var bx = w - 8 - 24; var by = 8; - if(con && con.path != "") { + if(context != COLLECTIONS) { if(buttonInstant(s_button_hide, bx, by, 24, 24, [mx, my], FOCUS == panel, HOVER == panel, "Add selecting node as collection", s_add_24, 0, c_ui_lime) == 2) { if(PANEL_INSPECTOR.inspecting != noone) { var dia = dialogCall(o_dialog_file_name, mouse_mx + 8, mouse_my + 8); - data_path = con.path; + data_path = context.path; if(PANEL_INSPECTOR.inspecting) dia.tb_name._input_text = PANEL_INSPECTOR.inspecting.name; dia.onModify = function (txt) { @@ -360,26 +286,19 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { } bx -= 32; - if(con == -1 || con.path != "") { - if(buttonInstant(s_button_hide, bx, by, 24, 24, [mx, my], FOCUS == panel, HOVER == panel, "Add folder") == 2) { - var dia = dialogCall(o_dialog_file_name, mouse_mx + 8, mouse_my + 8); - dia.onModify = function (txt) { - directory_create(txt); - searchFolder(); - }; - if(con == -1) dia.path = DIRECTORY + "Collections/"; - else dia.path = con.path; - } - draw_sprite_ext(s_folder_add, 0, bx + 12, by + 12, 1, 1, 0, c_ui_blue_grey, 1); - draw_sprite_ext(s_folder_add, 1, bx + 12, by + 12, 1, 1, 0, c_ui_lime, 1); - } else { - draw_sprite_ext(s_folder_add, 0, bx + 12, by + 12, 1, 1, 0, c_ui_blue_dkgrey, 1); - draw_sprite_ext(s_folder_add, 1, bx + 12, by + 12, 1, 1, 0, c_ui_blue_dkgrey, 1); + if(buttonInstant(s_button_hide, bx, by, 24, 24, [mx, my], FOCUS == panel, HOVER == panel, "Add folder") == 2) { + var dia = dialogCall(o_dialog_file_name, mouse_mx + 8, mouse_my + 8); + dia.onModify = function (txt) { + directory_create(txt); + }; + dia.path = context.path + "/"; } + draw_sprite_ext(s_folder_add, 0, bx + 12, by + 12, 1, 1, 0, c_ui_blue_grey, 1); + draw_sprite_ext(s_folder_add, 1, bx + 12, by + 12, 1, 1, 0, c_ui_lime, 1); bx -= 32; if(buttonInstant(s_button_hide, bx, by, 24, 24, [mx, my], FOCUS == panel, HOVER == panel, "Open in file explorer", s_folder_24) == 2) { - var _realpath = con == -1? DIRECTORY + "Collections" : con.path; + var _realpath = context.path; var _windir = environment_get_variable("WINDIR") + "\\explorer.exe"; execute_shell(_windir, _realpath); @@ -387,7 +306,8 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor { bx -= 32; if(buttonInstant(s_button_hide, bx, by, 24, 24, [mx, my], FOCUS == panel, HOVER == panel, "Refresh", s_refresh_16) == 2) { - searchFolder(); + searchCollections(); + searchContent(); } bx -= 32; diff --git a/scripts/panel_function/panel_function.gml b/scripts/panel_function/panel_function.gml index cdfa609fe..27c27da25 100644 --- a/scripts/panel_function/panel_function.gml +++ b/scripts/panel_function/panel_function.gml @@ -53,7 +53,7 @@ PANEL_GRAPH = new Panel_Graph(split_prev[1]); if(PREF_MAP[? "panel_collection"]) { - var pane = PANEL_ANIMATION.panel.split_h(460); + var pane = PANEL_ANIMATION.panel.split_h(500); pane[1].set(PANEL_ANIMATION); PANEL_COLLECTION = new Panel_Collection(pane[0]); } diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 17f63bf9f..0b1c5d518 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -47,6 +47,8 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor { node_focus = noone; node_previewing = noone; + junction_hovering = noone; + value_focus = noone; value_dragging = noone; @@ -343,9 +345,12 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor { _node.drawActive(gr_x, gr_y, graph_s); } + var hov = noone; for(var i = 0; i < ds_list_size(nodes_list); i++) { - nodes_list[| i].drawConnections(gr_x, gr_y, mx, my, graph_s); + var _hov = nodes_list[| i].drawConnections(gr_x, gr_y, mx, my, graph_s); + if(_hov != noone) hov = _hov; } + junction_hovering = hov; value_focus = noone; @@ -813,6 +818,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor { with(dialogCall(o_dialog_add_node, mouse_mx + 8, mouse_my + 8)) { node_target_x = other.mouse_grid_x; node_target_y = other.mouse_grid_y; + junction_hovering = other.junction_hovering; alarm[0] = 1; } diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index be7834d80..f1659abe9 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -51,7 +51,7 @@ function Panel_Menu(_panel) : PanelContent(_panel) constructor { [ "Render all nodes", function() { for(var i = 0; i < ds_list_size(NODES); i++) NODES[| i].setRenderStatus(false); - UPDATE = true; + UPDATE |= RENDER_TYPE.full; }, ["", "Render all"] ] ]], ["Panels", [ diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 2d05424e8..6b56af105 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -1,3 +1,9 @@ +enum RENDER_TYPE { + none = 0, + partial = 1, + full = 2 +} + function renderAll() { var _key = ds_map_find_first(NODE_MAP); var amo = ds_map_size(NODE_MAP); @@ -8,6 +14,28 @@ function renderAll() { _key = ds_map_find_next(NODE_MAP, _key); } + ds_stack_clear(RENDER_STACK); + // get leaf node + var key = ds_map_find_first(NODE_MAP); + repeat(ds_map_size(NODE_MAP)) { + var _node = NODE_MAP[? key]; + key = ds_map_find_next(NODE_MAP, key); + + if(instanceof(_node) == "Node_Group_Input") continue; + if(instanceof(_node) == "Node_Iterator_Input") continue; + + if(_node.active && !is_undefined(_node) && is_struct(_node)) { + var _startNode = true; + for(var j = 0; j < ds_list_size(_node.inputs); j++) { + var _in = _node.inputs[| j]; + if(_in.value_from != noone) + _startNode = false; + } + if(_startNode) + ds_stack_push(RENDER_STACK, _node); + } + } + renderUpdated(); } @@ -30,36 +58,14 @@ function __nodeLeafList(_list, _stack) { } function renderUpdated() { - var render_st = ds_stack_create(); var rendering = noone; var error = 0; - // get leaf node - var key = ds_map_find_first(NODE_MAP); - repeat(ds_map_size(NODE_MAP)) { - var _node = NODE_MAP[? key]; - key = ds_map_find_next(NODE_MAP, key); - - if(instanceof(_node) == "Node_Group_Input") continue; - if(instanceof(_node) == "Node_Iterator_Input") continue; - - if(_node.active && !is_undefined(_node) && is_struct(_node)) { - var _startNode = true; - for(var j = 0; j < ds_list_size(_node.inputs); j++) { - var _in = _node.inputs[| j]; - if(_in.value_from != noone) - _startNode = false; - } - if(_startNode) - ds_stack_push(render_st, _node); - } - } - - show_debug_message("\n=== RENDER ===") + //show_debug_message("\n=== RENDER ===") // render forward - while(!ds_stack_empty(render_st)) { - rendering = ds_stack_pop(render_st); + while(!ds_stack_empty(RENDER_STACK)) { + rendering = ds_stack_pop(RENDER_STACK); if(rendering.rendered) continue; @@ -75,7 +81,7 @@ function renderUpdated() { for(var i = rendering.custom_input_index; i < ds_list_size(rendering.inputs); i++) { var _in = rendering.inputs[| i].from; - if(_in.isUpdateReady()) ds_stack_push(render_st, _in); + if(_in.isUpdateReady()) ds_stack_push(RENDER_STACK, _in); } } else if(instanceof(rendering) == "Node_Group_Output") { //Group output in-junction connect automatically to parent out-junction var _ot = rendering.outParent; @@ -84,7 +90,7 @@ function renderUpdated() { if(_to.node.active && _to.value_from != noone && _to.value_from.node == rendering.group) { _to.node.setRenderStatus(false); - if(_to.node.isUpdateReady()) ds_stack_push(render_st, _to.node); + if(_to.node.isUpdateReady()) ds_stack_push(RENDER_STACK, _to.node); } } @@ -92,29 +98,29 @@ function renderUpdated() { } else if(instanceof(rendering) == "Node_Iterate") { //Put each input node in group to stack for(var i = rendering.custom_input_index; i < ds_list_size(rendering.inputs); i++) { var _in = rendering.inputs[| i].from; - if(_in.isUpdateReady()) ds_stack_push(render_st, _in); + if(_in.isUpdateReady()) ds_stack_push(RENDER_STACK, _in); } } else if(instanceof(rendering) == "Node_Iterator_Output") { //Check iteration result var _node_it = rendering.group; var _ren = _node_it.outputRendered(); if(_ren == 1) { //Go back to the beginning of the loop, reset render status for leaf node inside? - show_debug_message("iteration restart"); + //show_debug_message("iteration restart"); var _ot = rendering.group.inputs; for(var j = 1; j < ds_list_size(_ot); j++) { - if(_ot[| j].from.isUpdateReady()) ds_stack_push(render_st, _ot[| j].from); + if(_ot[| j].from.isUpdateReady()) ds_stack_push(RENDER_STACK, _ot[| j].from); } - __nodeLeafList(rendering.group.nodes, render_st); + __nodeLeafList(rendering.group.nodes, RENDER_STACK); } else if(_ren == 2) { //Go out of loop - show_debug_message("iteration completed"); + //show_debug_message("iteration completed"); var _ot = rendering.outParent; for(var j = 0; j < ds_list_size(_ot.value_to); j++) { var _to = _ot.value_to[| j]; if(_to.node.active && _to.value_from != noone && _to.value_from.node == rendering.group) { _to.node.setRenderStatus(false); - if(_to.node.isUpdateReady()) ds_stack_push(render_st, _to.node); + if(_to.node.isUpdateReady()) ds_stack_push(RENDER_STACK, _to.node); } } rendering.group.setRenderStatus(true); @@ -128,7 +134,7 @@ function renderUpdated() { if(_to.node.active && _to.value_from != noone && _to.value_from.node == rendering) { _to.node.setRenderStatus(false); - if(_to.node.isUpdateReady()) ds_stack_push(render_st, _to.node); + if(_to.node.isUpdateReady()) ds_stack_push(RENDER_STACK, _to.node); } } } @@ -136,13 +142,11 @@ function renderUpdated() { //show_debug_message(txt); } - - ds_stack_destroy(render_st); } - -function renderNodeBackward(_node) { - var render_st = ds_stack_create(); - ds_stack_push(render_st, _node); +/* +function renderNodeBackward(_node) { //unused + var RENDER_STACK = ds_stack_create(); + ds_stack_push(RENDER_STACK, _node); var key = ds_map_find_first(NODE_MAP); for(var i = 0; i < ds_map_size(NODE_MAP); i++) { @@ -156,18 +160,18 @@ function renderNodeBackward(_node) { var _in = _node.inputs[| i]; if(_in.value_from) { - ds_stack_push(render_st, _in.value_from.node); + ds_stack_push(RENDER_STACK, _in.value_from.node); } } - while(!ds_stack_empty(render_st)) { - var _rendering = ds_stack_top(render_st); + while(!ds_stack_empty(RENDER_STACK)) { + var _rendering = ds_stack_top(RENDER_STACK); var _leaf = true; for(var i = 0; i < ds_list_size(_rendering.inputs); i++) { var _in = _rendering.inputs[| i]; if(_in.value_from && !_in.value_from.node.rendered) { - ds_stack_push(render_st, _in.value_from.node); + ds_stack_push(RENDER_STACK, _in.value_from.node); _leaf = false; } } @@ -180,9 +184,9 @@ function renderNodeBackward(_node) { _rendering.doUpdate(); } else _rendering.doUpdate(); - ds_stack_pop(render_st); + ds_stack_pop(RENDER_STACK); } } - ds_stack_destroy(render_st); + ds_stack_destroy(RENDER_STACK); } \ No newline at end of file diff --git a/scripts/save_function/save_function.gml b/scripts/save_function/save_function.gml index 3aa969553..a40752f71 100644 --- a/scripts/save_function/save_function.gml +++ b/scripts/save_function/save_function.gml @@ -124,7 +124,7 @@ function SAVE_COLLECTIONS(_list, _path, save_surface = true) { ds_map_destroy(_map); var pane = findPanel("Panel_Collection", PANEL_MAIN, noone); - if(pane) pane.searchFolder(); + if(pane) pane.searchContent(); } function SAVE_COLLECTION(_node, _path, save_surface = true) { @@ -148,7 +148,7 @@ function SAVE_COLLECTION(_node, _path, save_surface = true) { ds_map_destroy(_map); var pane = findPanel("Panel_Collection", PANEL_MAIN, noone); - if(pane) pane.searchFolder(); + if(pane) pane.searchContent(); } function SAVE_NODE(_list, _node, dx = 0, dy = 0, scale = false) { diff --git a/scripts/type_conversion/type_conversion.gml b/scripts/type_conversion/type_conversion.gml new file mode 100644 index 000000000..2cea04b7a --- /dev/null +++ b/scripts/type_conversion/type_conversion.gml @@ -0,0 +1,3 @@ +function type_conversion(val, to) { + +} \ No newline at end of file diff --git a/scripts/type_conversion/type_conversion.yy b/scripts/type_conversion/type_conversion.yy new file mode 100644 index 000000000..dd1c30567 --- /dev/null +++ b/scripts/type_conversion/type_conversion.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "value", + "path": "folders/functions/value.yy", + }, + "resourceVersion": "1.0", + "name": "type_conversion", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/sprites/s_folder_content_24/087b63df-395b-442a-9541-13c1b948a89e.png b/sprites/s_folder_content_24/087b63df-395b-442a-9541-13c1b948a89e.png new file mode 100644 index 0000000000000000000000000000000000000000..85b1b87f17b4693e5f546081ed8402f31e20f8ca GIT binary patch literal 332 zcmV-S0ki&zP)@lt2l1^hOCOK`OwvnlMXb2cmM&ac6b{3;Vuo zem03_w&V{82DELPW60o3A?FNF<2b$s10b$397b|BaD#uhfYg%#NLWn}cea36$SGLN zz)Qa}UO~#98~D=s6pQ#1-<|#L6yb#=`Wz zXAoKq{Sv@J42GP?04*6rxwr_h>#d~ko)NHSfX*bq4!)i!?(8xYlmMaPV$KitqB#NP zgSwp-2hcgD-ZFGUL#(k{eE?l;>LYlp-hj9s)-}A|9#H?GJ`z2yx(XCG(MUIS5c)v} eii`IB$MgmZv{$|WYUWV@0000wSZ&`{{R2q0HhLtSRRL-gFqa>$jJDCWD9_XF91^U1oYSg@dKb*2cRVvh_(Qz z!GH+EVSpcq4*>N{KoWZZ#2e6khU|j?A`M5jq#jLd0=mzr9mz1CDZqR}i&O-%1QZ$z zXk`HiD8LxQFr$rHFrXGZprW~Ovyd&=0K}lOg`YyhKSIqywE&d0LFEXLd4K{-K!!UY z7kDUf04k(F((}Cyz18Nopw$)W+xPh6|)QMhbBEv=ff0@1kl!P$2&*rQ<00000 LNkvXXu0mjf)nJGn literal 0 HcmV?d00001 diff --git a/sprites/s_folder_content_24/layers/e370d044-47b2-4385-b536-765d62658b53/1b3ed37a-f867-49ee-9b1f-1668f53c9a96.png b/sprites/s_folder_content_24/layers/e370d044-47b2-4385-b536-765d62658b53/1b3ed37a-f867-49ee-9b1f-1668f53c9a96.png new file mode 100644 index 0000000000000000000000000000000000000000..8d48c2db32b76bf5dd9e0084a6e872d468e9a857 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjhdf;zLn`JZ|NQ^oo>`ZX+t*iq zo0thhA(O!A#}|qPI+z=NFk6c0Fg&VYs(RD-gHgbm;UjC1j)B6V0*MFgkC+{77(IDX zUb3;7%vX#Sa9Hy2#I!4mI~#RM5*$8BZdI0iX3WaA!arkTm&3FMr)0*pIt+}g63G>5 zTLQV+&NZ=zn26_zZDL(e#4_dTPfe3Q%2#xFxE&&IH!@DTdUER%(YKtxQK;JNUy85}Sb4q9e025nOxBvhE literal 0 HcmV?d00001 diff --git a/sprites/s_folder_content_24/s_folder_content_24.yy b/sprites/s_folder_content_24/s_folder_content_24.yy new file mode 100644 index 000000000..ca7ad21c0 --- /dev/null +++ b/sprites/s_folder_content_24/s_folder_content_24.yy @@ -0,0 +1,83 @@ +{ + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 4, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 2.525, + "bbox_left": 2, + "bbox_right": 21, + "bbox_top": 4, + "bbox_bottom": 20, + "HTile": false, + "VTile": false, + "For3D": false, + "width": 24, + "height": 24, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"compositeImage":{"FrameId":{"name":"e370d044-47b2-4385-b536-765d62658b53","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[ + {"FrameId":{"name":"e370d044-47b2-4385-b536-765d62658b53","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"LayerId":{"name":"1b3ed37a-f867-49ee-9b1f-1668f53c9a96","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",}, + ],"parent":{"name":"s_folder_content_24","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"resourceVersion":"1.0","name":"e370d044-47b2-4385-b536-765d62658b53","tags":[],"resourceType":"GMSpriteFrame",}, + {"compositeImage":{"FrameId":{"name":"087b63df-395b-442a-9541-13c1b948a89e","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"LayerId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",},"images":[ + {"FrameId":{"name":"087b63df-395b-442a-9541-13c1b948a89e","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"LayerId":{"name":"1b3ed37a-f867-49ee-9b1f-1668f53c9a96","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMSpriteBitmap",}, + ],"parent":{"name":"s_folder_content_24","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"resourceVersion":"1.0","name":"087b63df-395b-442a-9541-13c1b948a89e","tags":[],"resourceType":"GMSpriteFrame",}, + ], + "sequence": { + "spriteId": {"name":"s_folder_content_24","path":"sprites/s_folder_content_24/s_folder_content_24.yy",}, + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 2.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"c2ac1835-866f-41f9-acbf-d9cc2ef24d8d","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"e370d044-47b2-4385-b536-765d62658b53","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + {"id":"841150bf-ecfb-4047-b2cc-6b2c2de7cbae","Key":1.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"087b63df-395b-442a-9541-13c1b948a89e","path":"sprites/s_folder_content_24/s_folder_content_24.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack","modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 12, + "yorigin": 12, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"s_folder_content_24","path":"sprites/s_folder_content_24/s_folder_content_24.yy",}, + "resourceVersion": "1.3", + "name": "s_folder_content_24", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"1b3ed37a-f867-49ee-9b1f-1668f53c9a96","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "icon", + "path": "folders/sprites/icon.yy", + }, + "resourceVersion": "1.0", + "name": "s_folder_content_24", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file diff --git a/sprites/s_node_pin_bg/388f3040-3a10-4d25-9bbf-2ed6887d2f11.png b/sprites/s_node_pin_bg/388f3040-3a10-4d25-9bbf-2ed6887d2f11.png new file mode 100644 index 0000000000000000000000000000000000000000..f9676286df7ffa5f9b5ed8934c11a9c18902ffbc GIT binary patch literal 434 zcmV;j0ZsmiP)P=r$vGzs5uE|-jN zE#Mmw$Raqm$^f7v0%!nCnS6bvgO5>Y{Q>>}06-ZP>r1EsP(=i&0D!l78wsFHP`z>i zIrV#Rfp43Hdlj}4dZ!(J9sqckC$0%}TQi2h1pQ@mD)n1)DnPJ+ c3Dut80X7$okk-*Sz5oCK07*qoM6N<$g2f}XF#rGn literal 0 HcmV?d00001 diff --git a/sprites/s_node_pin_bg/7e26ac4a-cf07-4d11-8846-fdb949383281.png b/sprites/s_node_pin_bg/7e26ac4a-cf07-4d11-8846-fdb949383281.png deleted file mode 100644 index 37ed0626d6db2677c4551df4a95b579988c312ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 486 zcmV@P)`2-wz1QAR^*?)OO zfH1c6pqNjty78Ses1;_ODkg#c&GhYrGyW^;lY0c65h^J9RGWZLb# zB|z5wT(kX8kV;Y{8v$!ob#wrmDUlQ291c0ZjRkB+1mxP9C?W>|nYI>+$Us0$$*+%e z^fDAW?gVHnpp82L+6rg`1fYx*>rPOEfXc*6Km`JDH{NJ#qJ%O*^;8OovE2twu-zuX ztqHplG=vvC8Uk=Hj;tn7+p?Iu4HhhDCWKxUdN-}D4K4(rMkZ0P_pg&zbb17xgAl?3 zrDGFrK3Mg816Lc>R*|#``$>%vKq3L9GBWc|j5z6juQdk9gluNbQ5Uy0M=j(B c6l#0?1LS~?knET*_W%F@07*qoM6N<$g2xud3IG5A diff --git a/sprites/s_node_pin_bg/layers/388f3040-3a10-4d25-9bbf-2ed6887d2f11/436620d9-dfdd-4d34-8647-b12b0b32e71e.png b/sprites/s_node_pin_bg/layers/388f3040-3a10-4d25-9bbf-2ed6887d2f11/436620d9-dfdd-4d34-8647-b12b0b32e71e.png new file mode 100644 index 0000000000000000000000000000000000000000..8ea643a89f6469d0c7ac28f9044a3e62457fea70 GIT binary patch literal 436 zcmV;l0ZaagP)*!g6jb17`#3=o1SdI6aD;K8vJHj>lY>-Lc}0C?xV zolD_JZZZ-t0CDD_W$;DWoRATKb025krwRMgF91IGq1iq}DJP||5!j6A+zLKT!Z)1D zCF5H&_(lY>2+plC0O*JS8USM^Ut4MKV-#9{fIk2LP)5c25-I?c5dlg7;BDSU0w@wx zuUtTm{T^K4+a}>&g{_1>X@{RD0N&-1Yl6y_W%4rw0Gf%=RneV&sRjUQG>$?Z7@*N3 zG%g~91*NkJmk;Z9Z}4^#az5OY-y-!HcBjUKAqpVf7zT${nnfc e5G-IqwdW6*&XJJLib9U7;JK1LO`iC?k*!vOzjRHi$L|-2m<~K(awcNGG6rAm+|GhCX1!Gal9~i(54Fgji(5 zdY^dQG7csN!N6PsG9C!o~OhVp$ zc}0LQw)3EvPr#9Twr$m25-kG6^Pw5<0!!lTM#6;vXU&HW!j5Khf*S#3!dUY|fQ@9D z?YtpC*8Nno{Z9}}QY0GzYgKi00Glb26W$aKIlqksY)1s7+L|aL1p$e+7K%tfz?_m_ z7xCa_D0JKj&{jYjcLKB(&;|%V8ELLNK?wp1GhYG<5P-Y!Mq3jlLe)n;B3MwlGb5AsxbmcB%oAAX8MT{C*AM0#sHa+OsqNT;",}, "tracks": [ {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ - {"id":"0e78db92-77a0-4808-81b9-ba1130b46e12","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"7e26ac4a-cf07-4d11-8846-fdb949383281","path":"sprites/s_node_pin_bg/s_node_pin_bg.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + {"id":"0ac17b77-8ab5-4309-a240-2a12c94faa0e","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"388f3040-3a10-4d25-9bbf-2ed6887d2f11","path":"sprites/s_node_pin_bg/s_node_pin_bg.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack","modifiers":[],}, ], "visibleRange": null, @@ -65,12 +65,12 @@ "resourceType": "GMSequence", }, "layers": [ - {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"08c0d8ba-52ee-4d3c-9201-abc52d91e889","tags":[],"resourceType":"GMImageLayer",}, + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"436620d9-dfdd-4d34-8647-b12b0b32e71e","tags":[],"resourceType":"GMImageLayer",}, ], "nineSlice": { - "left": 28, + "left": 15, "top": 15, - "right": 24, + "right": 16, "bottom": 16, "guideColour": [ 4294902015, diff --git a/sprites/s_node_pin_bg_active/05b2e8dc-35db-4c71-b1f0-22dde0d3e82b.png b/sprites/s_node_pin_bg_active/05b2e8dc-35db-4c71-b1f0-22dde0d3e82b.png deleted file mode 100644 index b2c4b85539ef69ba4c9d965dd01b11184e0501aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 707 zcmV;!0zCbRP)e^N$jMNep!(*2|;NUakw(H-jAp$2nw6B5-|G9(zE5GPV%w^%*9;H>z!eAQ2i3 zB;gI`lk$@IMu2+0FdhTbmh@~C>cAAX@hg|ayB`T(1bAz{H^%#*O-h2{6V2rWKLU){ zH9u=xxfVg&_@ppmALo_;UH8oPqb{%cD$q9AN)pzZ6pf1jUR-u9+n)nXj75Tnn1NP! zL+N+umtn+4LCgqX=HFj~_Z>6}Sk;b6Kq9uhy*AM1gak18nXtM90n7TSOM-boMM5Fx zN9EgK-|vqLcS(>fBX&zn-`@$;`;U+bzZV4Xy;yq!a}MZh zPXM;vigotJ^#=VqAQf95&!xXhfwo2BJ@vi_V2@0rfZbE+TVGIHe~;i>CCF|m zTgPJa0WWpBElzl0U#$D`-oQaAtoeXO8%WF^T2~XJw^g7 z;cbo4>qVtoYio?q35mBky4E%lS!A-zbzF8Ky=z0m+akvqwvig! diff --git a/sprites/s_node_pin_bg_active/604a92a7-301f-4d97-9458-fb3556493573.png b/sprites/s_node_pin_bg_active/604a92a7-301f-4d97-9458-fb3556493573.png new file mode 100644 index 0000000000000000000000000000000000000000..500512ea724b3e3662c8aa6304ab8abc00eab13c GIT binary patch literal 626 zcmV-&0*(ENP);6ff_v7Xot=VDfD8%#~b zAj$lRtlP+QDnx7}0^%T5Aflb)I5MiStj(3kOaowTNccPfSu`+zQTAnV83BA4I=>V@ z_?U{VAtLV=7YQiinW>{5%cA`?;2{ys1|+`a_b}X&BLW(E1uhedroaIS0w}~cf7z0~ zpNRtjZ_n=r9uRRPEMJtX2|ojX^KyJ|aBtu{Q>^?zK=++$@87cLmj=EC3ld8$O6xMf z%lWm{-jD=^Iaf@ZXou^Wc2ge?Yw9dyWPr-wJtBHHGz)aq0R(bWx7SAxFmnh{e6|Au zwDplI!fgixD$I+gVcX-MfFqE0fSo!5$f&FX0${EnP?}o3JhBrqD$xT08p1@6$S5Is z>rj#M0(JtZ3P>_gJc5AYY`}I!h-5;o*tX9Ejs9J1$p4A}=dx;oDHGb#1mgSI)WNQt zHuU=d1lBsCXoGVS0Ch)YOq*zL+S9g-SI@ELFore<9x0jHs(ld)3uUNw6UI zE~iVCQA9zph7MCx7Z)9lCPQyIxd}xR@QC2R2G{e^ndwB!{OIfXFIv=ym!yNVkl`<1IV&(7gmjQ}fF0OD+;{I7kVFHHa6)`D ziv&4l_wC-Y?2eAdqtrqYkM%fF303avE$SRQl~iRT)78Gtg3-l0k~q@iT;)#X%|2Yj zsATs4(^cA7&EG^4hwdy;fs-PYga?@opt`c)WV6pRr8$oy|t;r$$p0#vmV5D*H>+iL@C4nY8tpYf}U7oe=4j>1fU>T zxKG5t*YauuY?9onY(~~-HV_d3kx#ukM5JIod+z(nY~ZvMWJP)#7}%bCE*rP}>=) zfh6`%^xR&*r%I$~Mj+233xsGF#&K9wV?CQ#B6Ax6&ejS4K_Jii;-l>8;Y|RrU);Y@ zKkzYC+ZiIm+3Gd{GM)>g9_yjgUEp;h%mzp-_3uIbN~#1HIl+gsv@vj%1OiCaw+OG~ zRL+Da;P3o-;8h}yL}8vNTNC9B031J#pAPO9e8(0m@dSA9sP^7NcYbTZcbXt=iD35@",}, "tracks": [ {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ - {"id":"0c00b804-b4da-4541-b342-bd8e2df9b911","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"05b2e8dc-35db-4c71-b1f0-22dde0d3e82b","path":"sprites/s_node_pin_bg_active/s_node_pin_bg_active.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + {"id":"9eeb162f-8b68-499f-8214-a3b5d1ff852f","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"604a92a7-301f-4d97-9458-fb3556493573","path":"sprites/s_node_pin_bg_active/s_node_pin_bg_active.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack","modifiers":[],}, ], "visibleRange": null, @@ -54,7 +54,7 @@ "backdropHeight": 768, "backdropXOffset": 0.0, "backdropYOffset": 0.0, - "xorigin": 32, + "xorigin": 16, "yorigin": 16, "eventToFunction": {}, "eventStubScript": null, @@ -65,9 +65,33 @@ "resourceType": "GMSequence", }, "layers": [ - {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"38a923c1-df5b-4555-933d-e573af686008","tags":[],"resourceType":"GMImageLayer",}, + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"8e106beb-1be9-406e-954b-3a5f83ae687e","tags":[],"resourceType":"GMImageLayer",}, ], - "nineSlice": null, + "nineSlice": { + "left": 15, + "top": 16, + "right": 16, + "bottom": 15, + "guideColour": [ + 4294902015, + 4294902015, + 4294902015, + 4294902015, + ], + "highlightColour": 1728023040, + "highlightStyle": 0, + "enabled": true, + "tileMode": [ + 0, + 0, + 0, + 0, + 0, + ], + "resourceVersion": "1.0", + "loadedVersion": null, + "resourceType": "GMNineSliceData", + }, "parent": { "name": "nodes", "path": "folders/sprites/nodes.yy",