diff --git a/datafiles/data/Actions.zip b/datafiles/data/Actions.zip index f9ee670a1..6a9460e1a 100644 Binary files a/datafiles/data/Actions.zip and b/datafiles/data/Actions.zip differ diff --git a/datafiles/data/Actions/Nodes/Armature Build.json b/datafiles/data/Actions/Nodes/Armature Build.json index e992f282c..243e55066 100644 --- a/datafiles/data/Actions/Nodes/Armature Build.json +++ b/datafiles/data/Actions/Nodes/Armature Build.json @@ -2,6 +2,7 @@ "name": "Armature Build", "tags": ["bone", "rigging"], "tooltip": "", + "location": ["Compose", "Armature"], "sprPath": "./Armature Build.png", "nodes": [ { "node": "Node_Armature" }, diff --git a/datafiles/data/Actions/Nodes/Follow Path.json b/datafiles/data/Actions/Nodes/Follow Path.json index 154eb4687..2d525f57d 100644 --- a/datafiles/data/Actions/Nodes/Follow Path.json +++ b/datafiles/data/Actions/Nodes/Follow Path.json @@ -2,6 +2,7 @@ "name": "Follow Path", "tags": [], "tooltip": "", + "location": ["Transform", "Transformations"], "sprPath": "./Follow Path.png", "nodes": [ { "node": "Node_Path", "y": 64 }, diff --git a/datafiles/data/Actions/Nodes/Line from Path.json b/datafiles/data/Actions/Nodes/Line from Path.json index a8483bec1..ad1fe6b03 100644 --- a/datafiles/data/Actions/Nodes/Line from Path.json +++ b/datafiles/data/Actions/Nodes/Line from Path.json @@ -2,6 +2,7 @@ "name": "Line from Path", "tags": [], "tooltip": "", + "location": ["Generate", "Drawer"], "sprPath": "./Line from Path.png", "nodes": [ { "node": "Node_Path" }, diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 3ce12f3d3..7d37cfacb 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -120,6 +120,7 @@ event_inherited(); function buildNode(_node, _param = "") { if(!_node) { instance_destroy(); + instance_destroy(o_dialog_menubox); return; } @@ -130,6 +131,7 @@ event_inherited(); _new_node = _node.build(node_target_x, node_target_y,, _param); if(!_new_node) { instance_destroy(); + instance_destroy(o_dialog_menubox); return; } @@ -226,6 +228,7 @@ event_inherited(); } instance_destroy(); + instance_destroy(o_dialog_menubox); } catagory_pane = new scrollPane(category_width, dialog_h - ui(66), function(_y, _m) { diff --git a/objects/o_dialog_add_node/Destroy_0.gml b/objects/o_dialog_add_node/Destroy_0.gml index 42c539a8e..57c5dc646 100644 --- a/objects/o_dialog_add_node/Destroy_0.gml +++ b/objects/o_dialog_add_node/Destroy_0.gml @@ -1,5 +1,4 @@ /// @description event_inherited(); -WIDGET_CURRENT = noone; -instance_destroy(o_dialog_menubox); \ No newline at end of file +WIDGET_CURRENT = noone; \ No newline at end of file diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 67d512617..5ef60969a 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -104,7 +104,7 @@ VERSION = 11484; SAVE_VERSION = 11482; VERSION_STRING = "1.15rc4"; - BUILD_NUMBER = 11484; + BUILD_NUMBER = 11485; globalvar APPEND_MAP; APPEND_MAP = ds_map_create(); diff --git a/scripts/node_action_object/node_action_object.gml b/scripts/node_action_object/node_action_object.gml index 1ab9879cd..48c6bc02e 100644 --- a/scripts/node_action_object/node_action_object.gml +++ b/scripts/node_action_object/node_action_object.gml @@ -14,6 +14,8 @@ inputNode = noone; outputNode = noone; + + location = noone; static getName = function() { return name; /*__txt_node_name(node, name); */ } static getTooltip = function() { return tooltip; /*__txt_node_tooltip(node, tooltip); */ } @@ -67,6 +69,8 @@ inputNode = struct_try_get(map, "inputNode", noone); outputNode = struct_try_get(map, "outputNode", noone); + location = struct_try_get(map, "location", noone); + if(struct_has(map, "sprPath")) { var _path = string_replace(map.sprPath, "./", filename_dir(path) + "/"); @@ -93,6 +97,23 @@ if(filename_ext(f) == ".json") { var _c = new NodeAction().deserialize($"{root}/{f}"); ds_list_add(list, _c); + + if(_c.location != noone) { + var _cat = _c.location[0]; + var _grp = _c.location[1]; + + for( var i = 0, n = ds_list_size(NODE_CATEGORY); i < n; i++ ) { + if(NODE_CATEGORY[| i].name != _cat) continue; + var _list = NODE_CATEGORY[| i].list; + var j = 0; + + for( var m = ds_list_size(_list); j < m; j++ ) + if(_list[| j] == _grp) break; + + ds_list_insert(_list, j + 1, _c); + break; + } + } } f = file_find_next(); diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index fd1e6555e..75473269f 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -37,6 +37,8 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const inputs[| 2] = nodeValue("Current tag", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, ""); + inputs[| 3] = nodeValue("Use cel dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + outputs[| 0] = nodeValue("Output", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); outputs[| 1] = nodeValue("Content", self, JUNCTION_CONNECT.output, VALUE_TYPE.object, self); @@ -155,7 +157,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const input_display_list = [ ["File", true], 0, - ["Layers", false], 1, layer_renderer, + ["Layers", false], 1, 3, layer_renderer, ["Tags", false], 2, tag_renderer, ]; @@ -183,6 +185,8 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const var nh = (array_length(layers) - 1) / 2 * _nh; var ny = y - nh; + var use_cel = inputs[| 3].getValue(); + var lvs = []; for( var i = 0, n = array_length(layers); i < n; i++ ) { var _layer = layers[i]; @@ -201,9 +205,10 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const if(_node == noone) _node = nodeBuild("Node_ASE_layer", nx, ny + i * _nh); - + lvs[i] = _node; lvs[i].inputs[| 0].setFrom(outputs[| 1]); + lvs[i].inputs[| 1].setValue(use_cel); lvs[i].setDisplayName(_name); } } diff --git a/scripts/node_palette_sort/node_palette_sort.gml b/scripts/node_palette_sort/node_palette_sort.gml index 966bb5d16..e2d9f216d 100644 --- a/scripts/node_palette_sort/node_palette_sort.gml +++ b/scripts/node_palette_sort/node_palette_sort.gml @@ -9,18 +9,45 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node(_x, _y, _group) constr .setVisible(true, true); inputs[| 1] = nodeValue("Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) - .setDisplay(VALUE_DISPLAY.enum_button, [ "Brightness", -1, "Hue (HSV)", "Saturation (SHV)", "Value (VHS)", -1, "Red (RGB)", "Green (GBR)", "Blue (BRG)" ]) + .setDisplay(VALUE_DISPLAY.enum_button, [ "Brightness", -1, "Hue (HSV)", "Saturation (SHV)", "Value (VHS)", -1, "Red (RGB)", "Green (GBR)", "Blue (BRG)", -1, "Custom" ]) .rejectArray(); inputs[| 2] = nodeValue("Reverse", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + inputs[| 3] = nodeValue("Sort Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "RGB"); + outputs[| 0] = nodeValue("Sorted palette", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, []) .setDisplay(VALUE_DISPLAY.palette); + static step = function() { + var _typ = inputs[| 1].getValue(); + + inputs[| 3].setVisible(_typ == 10); + } + + sort_string = ""; + static customSort = function(c) { + var len = string_length(sort_string); + var val = power(256, len); + + for( var i = 1; i <= len; i++ ) { + var ch = string_lower(string_char_at(sort_string, i)); + + switch(ch) { + case "r" : return + } + + val /= 256; + } + + return c; + } + static update = function(frame = PROJECT.animator.current_frame) { var _arr = inputs[| 0].getValue(); var _ord = inputs[| 1].getValue(); var _rev = inputs[| 2].getValue(); + sort_string = inputs[| 3].getValue(); if(!is_array(_arr)) return; var _pal = array_clone(_arr); @@ -28,13 +55,15 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node(_x, _y, _group) constr switch(_ord) { case 0 : array_sort(_pal, __sortBright); break; - case 1 : array_sort(_pal, __sortHue); break; - case 2 : array_sort(_pal, __sortSat); break; - case 3 : array_sort(_pal, __sortVal); break; + case 2 : array_sort(_pal, __sortHue); break; + case 3 : array_sort(_pal, __sortSat); break; + case 4 : array_sort(_pal, __sortVal); break; - case 4 : array_sort(_pal, __sortRed); break; - case 5 : array_sort(_pal, __sortGreen); break; - case 6 : array_sort(_pal, __sortBlue); break; + case 6 : array_sort(_pal, __sortRed); break; + case 7 : array_sort(_pal, __sortGreen); break; + case 8 : array_sort(_pal, __sortBlue); break; + + case 10 : array_sort(_pal, function(c1, c2) { return customSort(c1) - customSort(c2); }); break; } if(_rev) _pal = array_reverse(_pal); diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index b122e1d25..8d074f937 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -732,7 +732,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { ); callAddDialog(); - menuCall("graph_node_selected_menu",o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), menu, fa_right ); + menuCall("graph_node_selected_menu", o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), menu, fa_right ); setFocus(o_dialog_add_node.id, "Dialog"); } } @@ -1083,18 +1083,18 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { SAVE_NODE(_node, nodeArray[i],,,, getCurrentContext()); _map.nodes = _node; - clipboard_set_text(json_encode_minify(_map)); + clipboard_set_text(json_stringify_minify(_map)); } function doPaste() { - var txt = clipboard_get_text(); + var txt = clipboard_get_text(); var _map = json_try_parse(txt, noone); if(_map != noone) { ds_map_clear(APPEND_MAP); APPENDING = true; CLONING = true; - var _app = __APPEND_MAP(_map); + var _app = __APPEND_MAP(_map); APPENDING = false; CLONING = false;