- [Group] Fix node height not updating after duplicated.

This commit is contained in:
Tanasart 2024-07-17 08:48:04 +07:00
parent 268e26012a
commit 530c942ae0
3 changed files with 118 additions and 161 deletions

View file

@ -199,7 +199,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
input_dummy = nodeValue("Add to group", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0); input_dummy = nodeValue("Add to group", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0);
draw_dummy = false; draw_dummy = false;
input_dummy.onSetFrom = function(juncFrom) { #region input_dummy.onSetFrom = function(juncFrom) {
array_remove(juncFrom.value_to, input_dummy); array_remove(juncFrom.value_to, input_dummy);
input_dummy.value_from = noone; input_dummy.value_from = noone;
@ -214,18 +214,15 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
input.inParent.setFrom(juncFrom); input.inParent.setFrom(juncFrom);
if(onNewInputFromGraph != noone) onNewInputFromGraph(juncFrom); if(onNewInputFromGraph != noone) onNewInputFromGraph(juncFrom);
} #endregion }
onNewInputFromGraph = noone; onNewInputFromGraph = noone;
tool_node = noone; tool_node = noone;
draw_input_overlay = true; draw_input_overlay = true;
array_push(attributeEditors, ["Edit Input Display", function() { return 0; }, array_push(attributeEditors, ["Edit Input Display", function() /*=>*/ {return 0}, button(function() { dialogCall(o_dialog_group_input_order).setNode(self, JUNCTION_CONNECT.input); }) ]);
button(function() { dialogCall(o_dialog_group_input_order).setNode(self, JUNCTION_CONNECT.input); }) ]); array_push(attributeEditors, ["Edit Output Display", function() /*=>*/ {return 0}, button(function() { dialogCall(o_dialog_group_input_order).setNode(self, JUNCTION_CONNECT.output); }) ]);
array_push(attributeEditors, ["Edit Output Display", function() { return 0; },
button(function() { dialogCall(o_dialog_group_input_order).setNode(self, JUNCTION_CONNECT.output); }) ]);
/////========== INSPECTOR =========== /////========== INSPECTOR ===========
@ -248,7 +245,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
/////============ GROUP ============= /////============ GROUP =============
will_refresh = false; will_refresh = false;
static refreshNodes = function() { #region static refreshNodes = function() {
will_refresh = false; will_refresh = false;
hasInsp1 = false; hasInsp1 = false;
@ -264,18 +261,10 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
i++; i++;
} }
} #endregion }
static getNodeBase = function() { #region static getNodeBase = function() { return instanceBase == noone? self : instanceBase.getNodeBase(); }
if(instanceBase == noone) return self; static getNodeList = function() { return instanceBase == noone? nodes : instanceBase.getNodeList(); }
return instanceBase.getNodeBase();
} #endregion
static getNodeList = function() { #region
INLINE
if(instanceBase == noone) return nodes;
return instanceBase.getNodeList();
} #endregion
static exitGroup = function() {} static exitGroup = function() {}
@ -321,25 +310,25 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
/////============= STEP ============== /////============= STEP ==============
static stepBegin = function() { #region static stepBegin = function() {
if(will_refresh) refreshNodes(); if(will_refresh) refreshNodes();
doStepBegin(); doStepBegin();
} #endregion }
static step = function() { #region static step = function() {
if(combine_render_time) { if(combine_render_time) {
render_time = 0; render_time = 0;
array_foreach(getNodeList(), function(node) { render_time += node.render_time; }); array_foreach(getNodeList(), function(node) { render_time += node.render_time; });
} }
onStep(); onStep();
} #endregion }
static onStep = function() {} static onStep = function() {}
/////========== JUNCTIONS ========== /////========== JUNCTIONS ==========
static getOutputNodes = function() { #region static getOutputNodes = function() {
var _nodes = []; var _nodes = [];
for( var i = custom_output_index; i < ds_list_size(outputs); i++ ) { for( var i = custom_output_index; i < ds_list_size(outputs); i++ ) {
var _junc = outputs[| i]; var _junc = outputs[| i];
@ -351,18 +340,16 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
} }
return _nodes; return _nodes;
} #endregion }
static getInput = function(_y = 0, junc = noone) { #region static getInput = function(_y = 0, junc = noone) { return input_dummy; }
return input_dummy;
} #endregion
static preConnect = function() { #region static preConnect = function() {
sortIO(); sortIO();
deserialize(load_map, load_scale); deserialize(load_map, load_scale);
} #endregion }
static sortIO = function() { #region static sortIO = function() {
var _ilen = ds_list_size(inputs); var _ilen = ds_list_size(inputs);
var _iarr = attributes.input_display_list; var _iarr = attributes.input_display_list;
@ -393,20 +380,20 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
refreshNodeDisplay(); refreshNodeDisplay();
} #endregion }
static preConnect = function() { #region static preConnect = function() {
instanceBase = GetAppendID(struct_try_get(load_map, "instance_base", noone)); instanceBase = GetAppendID(struct_try_get(load_map, "instance_base", noone));
sortIO(); sortIO();
applyDeserialize(); applyDeserialize();
} #endregion }
/////========== RENDERING =========== /////========== RENDERING ===========
static getNextNodes = function() { return getNextNodesInternal(); } static getNextNodes = function() { return getNextNodesInternal(); }
static getNextNodesInternal = function() { #region //get node inside the group static getNextNodesInternal = function() { //get node inside the group
LOG_BLOCK_START(); LOG_BLOCK_START();
LOG_IF(global.FLAG.render == 1, $"→→→→→ Call get next node from group: {INAME}"); LOG_IF(global.FLAG.render == 1, $"→→→→→ Call get next node from group: {INAME}");
@ -429,9 +416,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
LOG_BLOCK_END(); LOG_BLOCK_END();
return _nodes; return _nodes;
} #endregion }
static getNextNodesExternal = function() { #region //get node connected to the parent object static getNextNodesExternal = function() { //get node connected to the parent object
LOG_IF(global.FLAG.render == 1, $"Checking next node external for {INAME}"); LOG_IF(global.FLAG.render == 1, $"Checking next node external for {INAME}");
LOG_BLOCK_START(); LOG_BLOCK_START();
@ -455,11 +442,11 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
LOG_BLOCK_END(); LOG_BLOCK_END();
return nextNodes; return nextNodes;
} #endregion }
static clearTopoSorted = function() { INLINE topoSorted = false; for( var i = 0, n = array_length(nodes); i < n; i++ ) { nodes[i].clearTopoSorted(); } } static clearTopoSorted = function() { INLINE topoSorted = false; for( var i = 0, n = array_length(nodes); i < n; i++ ) { nodes[i].clearTopoSorted(); } }
static setRenderStatus = function(result) { #region static setRenderStatus = function(result) {
LOG_BLOCK_START(); LOG_BLOCK_START();
LOG_IF(global.FLAG.render == 1, $"Set render status for {INAME} : {result}"); LOG_IF(global.FLAG.render == 1, $"Set render status for {INAME} : {result}");
rendered = result; rendered = result;
@ -483,9 +470,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
if(!result && group != noone) if(!result && group != noone)
group.setRenderStatus(result); group.setRenderStatus(result);
LOG_BLOCK_END(); LOG_BLOCK_END();
} #endregion }
static isActiveDynamic = function(frame = CURRENT_FRAME) { #region static isActiveDynamic = function(frame = CURRENT_FRAME) {
if(update_on_frame) return true; if(update_on_frame) return true;
if(!rendered) return true; if(!rendered) return true;
@ -493,9 +480,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
if(inputs[| i].isActiveDynamic(frame) || !inputs[| i].from.rendered) return true; if(inputs[| i].isActiveDynamic(frame) || !inputs[| i].from.rendered) return true;
return false; return false;
} #endregion }
static resetRender = function(_clearCache = false) { #region static resetRender = function(_clearCache = false) {
LOG_LINE_IF(global.FLAG.render == 1, $"Reset Render for group {INAME}"); LOG_LINE_IF(global.FLAG.render == 1, $"Reset Render for group {INAME}");
setRenderStatus(false); setRenderStatus(false);
@ -504,11 +491,11 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
if(reset_all_child) if(reset_all_child)
for(var i = 0, n = array_length(nodes); i < n; i++) for(var i = 0, n = array_length(nodes); i < n; i++)
nodes[i].resetRender(_clearCache); nodes[i].resetRender(_clearCache);
} #endregion }
/////============= DRAW ============= /////============= DRAW =============
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
if(!draw_input_overlay) return; if(!draw_input_overlay) return;
for(var i = custom_input_index; i < ds_list_size(inputs); i++) { for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
@ -519,7 +506,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
var _hov = _in.drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); var _hov = _in.drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
if(_hov != undefined) active &= !_hov; if(_hov != undefined) active &= !_hov;
} }
} #endregion }
static onPreDraw = function(_x, _y, _s, _iny, _outy) { static onPreDraw = function(_x, _y, _s, _iny, _outy) {
var xx = x * _s + _x; var xx = x * _s + _x;
@ -554,7 +541,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
panelSetContext(PANEL_GRAPH); panelSetContext(PANEL_GRAPH);
} }
static onDrawJunctions = function(_x, _y, _mx, _my, _s) { #region static onDrawJunctions = function(_x, _y, _mx, _my, _s) {
input_dummy.visible = false; input_dummy.visible = false;
if(draw_dummy) { if(draw_dummy) {
@ -563,9 +550,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
draw_dummy = false; draw_dummy = false;
} #endregion }
static getTool = function() { #region static getTool = function() {
for(var i = 0, n = array_length(nodes); i < n; i++) { for(var i = 0, n = array_length(nodes); i < n; i++) {
var _node = nodes[i]; var _node = nodes[i];
if(!_node.active) continue; if(!_node.active) continue;
@ -573,11 +560,11 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
return self; return self;
} #endregion }
/////============ PREVIEW ============ /////============ PREVIEW ============
static getGraphPreviewSurface = function() { #region static getGraphPreviewSurface = function() {
var _output_junc = outputs[| preview_channel]; var _output_junc = outputs[| preview_channel];
for( var i = 0, n = array_length(nodes); i < n; i++ ) { for( var i = 0, n = array_length(nodes); i < n; i++ ) {
@ -595,27 +582,27 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
return noone; return noone;
} #endregion }
/////============= CACHE ============= /////============= CACHE =============
static clearCache = function() { #region static clearCache = function() {
array_foreach(getNodeList(), function(node) { node.clearCache(); }); array_foreach(getNodeList(), function(node) { node.clearCache(); });
} #endregion }
/////========== INSTANCING =========== /////========== INSTANCING ===========
static setInstance = function(node) { #region static setInstance = function(node) {
instanceBase = node; instanceBase = node;
} #endregion }
static resetInstance = function() { #region static resetInstance = function() {
instanceBase = noone; instanceBase = noone;
} #endregion }
/////========= SERIALIZATION ========= /////========= SERIALIZATION =========
static attributeSerialize = function() { #region static attributeSerialize = function() {
sortIO(); sortIO();
var _attr = variable_clone(attributes); var _attr = variable_clone(attributes);
@ -633,12 +620,12 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
return _attr; return _attr;
} #endregion }
static preApplyDeserialize = function() { #region static preApplyDeserialize = function() {
var attr = attributes; var attr = attributes;
if(LOADING_VERSION < 11690) { #region if(LOADING_VERSION < 11690) {
var pr = ds_priority_create(); var pr = ds_priority_create();
for( var i = ds_list_size(inputs) - 1; i >= custom_input_index; i-- ) { for( var i = ds_list_size(inputs) - 1; i >= custom_input_index; i-- ) {
@ -663,7 +650,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
ds_priority_destroy(pr); ds_priority_destroy(pr);
return; return;
} #endregion }
if(struct_has(attr, "custom_input_list")) { if(struct_has(attr, "custom_input_list")) {
var _ilist = attr.custom_input_list; var _ilist = attr.custom_input_list;
@ -718,15 +705,15 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
} #endregion }
static processSerialize = function(_map) { #region static processSerialize = function(_map) {
_map.instance_base = instanceBase? instanceBase.node_id : noone; _map.instance_base = instanceBase? instanceBase.node_id : noone;
} #endregion }
/////============ ACTION ============ /////============ ACTION ============
static onClone = function(_newNode, target = PANEL_GRAPH.getCurrentContext()) { #region static onClone = function(_newNode, target = PANEL_GRAPH.getCurrentContext()) {
if(instanceBase != noone) { if(instanceBase != noone) {
_newNode.instanceBase = instanceBase; _newNode.instanceBase = instanceBase;
return; return;
@ -750,19 +737,19 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
APPENDING = false; APPENDING = false;
ds_list_destroy(dups); ds_list_destroy(dups);
} #endregion }
static enable = function() { #region static enable = function() {
active = true; active = true;
array_foreach(getNodeList(), function(node) { node.enable(); }); array_foreach(getNodeList(), function(node) { node.enable(); });
} #endregion }
static disable = function() { #region static disable = function() {
active = false; active = false;
array_foreach(getNodeList(), function(node) { node.disable(); }); array_foreach(getNodeList(), function(node) { node.disable(); });
} #endregion }
function onDoubleClick(panel) { #region function onDoubleClick(panel) {
if(PREFERENCES.panel_graph_group_require_shift && !key_mod_press(SHIFT)) return false; if(PREFERENCES.panel_graph_group_require_shift && !key_mod_press(SHIFT)) return false;
panelSetContext(panel); panelSetContext(panel);
@ -771,7 +758,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
ononDoubleClick(panel); ononDoubleClick(panel);
return true; return true;
} #endregion }
static panelSetContext = function(panel) { static panelSetContext = function(panel) {
__temp_panel = panel; __temp_panel = panel;
@ -784,14 +771,14 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static ononDoubleClick = noone; static ononDoubleClick = noone;
static enable = function() { #region static enable = function() {
active = true; timeline_item.active = true; active = true; timeline_item.active = true;
for( var i = 0, n = array_length(nodes); i < n; i++ ) nodes[i].enable(); for( var i = 0, n = array_length(nodes); i < n; i++ ) nodes[i].enable();
} #endregion }
static disable = function() { #region static disable = function() {
active = false; timeline_item.active = false; active = false; timeline_item.active = false;
for( var i = 0, n = array_length(nodes); i < n; i++ ) nodes[i].disable(); for( var i = 0, n = array_length(nodes); i < n; i++ ) nodes[i].disable();
} #endregion }
} }

View file

@ -1,59 +1,43 @@
function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Group Output"; name = "Group Output";
color = COLORS.node_blend_collection; color = COLORS.node_blend_collection;
is_group_io = true; is_group_io = true;
destroy_when_upgroup = true; destroy_when_upgroup = true;
setDimension(96, 32 + 24); setDimension(96, 32 + 24);
inputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1) inputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1)
.uncache() .uncache()
.setVisible(true, true); .setVisible(true, true);
inputs[| 0].onSetFrom = function(juncFrom) /*=>*/ { if(attributes.inherit_name && !LOADING && !APPENDING) setDisplayName(juncFrom.name); }
attributes.inherit_name = true; attributes.inherit_name = true;
outParent = undefined; outParent = undefined;
output_index = -1; output_index = -1;
onSetDisplayName = function() { attributes.inherit_name = false; } onSetDisplayName = function() /*=>*/ { attributes.inherit_name = false; }
inputs[| 0].onSetFrom = function(juncFrom) { static setRenderStatus = function(result) {
if(attributes.inherit_name && !LOADING && !APPENDING)
setDisplayName(juncFrom.name);
}
static setRenderStatus = function(result) { #region
if(rendered == result) return; if(rendered == result) return;
LOG_LINE_IF(global.FLAG.render == 1, $"Set render status for {INAME} : {result}"); LOG_LINE_IF(global.FLAG.render == 1, $"Set render status for {INAME} : {result}");
rendered = result; rendered = result;
if(group) group.setRenderStatus(result); if(group) group.setRenderStatus(result);
} #endregion }
static onValueUpdate = function(index = 0) { #region static onValueUpdate = function(index = 0) { if(is_undefined(outParent)) return; }
if(is_undefined(outParent)) return;
} #endregion
static getNextNodes = function() { #region static getNextNodes = function() {
if(is_undefined(outParent)) return []; if(is_undefined(outParent)) return [];
LOG_BLOCK_START(); LOG_BLOCK_START();
var nodes = []; var nodes = [];
for(var j = 0; j < array_length(outParent.value_to); j++) { for(var j = 0; j < array_length(outParent.value_to); j++) {
var _to = outParent.value_to[j]; var _to = outParent.value_to[j];
if(!_to.node.isRenderActive()) continue;
//printIf(global.FLAG.render, "Value to " + _to.name);
if(!_to.node.active || _to.value_from == noone) { if(!_to.node.isRenderActive()) continue;
//printIf(global.FLAG.render, "no value from"); if(!_to.node.active || _to.value_from == noone) continue;
continue; if(_to.value_from.node != group) continue;
}
if(_to.value_from.node != group) {
//printIf(global.FLAG.render, "value from not equal group");
continue;
}
//printIf(global.FLAG.render, "Group output ready " + string(_to.node.isRenderable()));
array_push(nodes, _to.node); array_push(nodes, _to.node);
LOG_IF(global.FLAG.render == 1, $"Check complete, push {_to.node.internalName} to queue."); LOG_IF(global.FLAG.render == 1, $"Check complete, push {_to.node.internalName} to queue.");
@ -61,60 +45,55 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
LOG_BLOCK_END(); LOG_BLOCK_END();
return nodes; return nodes;
} #endregion }
static createOutput = function() { #region static createOutput = function() {
if(group == noone) return; if(group == noone) return;
if(!is_struct(group)) return; if(!is_struct(group)) return;
if(!is_undefined(outParent)) if(!is_undefined(outParent)) ds_list_remove(group.outputs, outParent);
ds_list_remove(group.outputs, outParent);
outParent = nodeValue("Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.any, -1) outParent = nodeValue("Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.any, -1)
.uncache() .uncache()
.setVisible(true, true); .setVisible(true, true);
outParent.from = self; outParent.from = self;
ds_list_add(group.outputs, outParent); ds_list_add(group.outputs, outParent);
if(!LOADING && !APPENDING) { if(!LOADING && !APPENDING) {
group.refreshNodeDisplay(); group.refreshNodeDisplay();
group.sortIO(); group.sortIO();
group.setHeight();
} }
outParent.setFrom(inputs[| 0]); outParent.setFrom(inputs[| 0]);
} if(!LOADING && !APPENDING) createOutput(); #endregion
} if(!LOADING && !APPENDING) createOutput();
static step = function() { #region static step = function() {
if(is_undefined(outParent)) return; if(is_undefined(outParent)) return;
outParent.name = display_name; outParent.name = display_name;
inputs[| 0].setType(VALUE_TYPE.any); var _in0 = inputs[| 0];
if(inputs[| 0].value_from != noone) { var _pty = _in0.type;
inputs[| 0].setType(inputs[| 0].value_from.type); var _typ = _in0.value_from == noone? VALUE_TYPE.any : _in0.value_from.type;
inputs[| 0].display_type = inputs[| 0].value_from.display_type; var _dis = _in0.value_from == noone? VALUE_DISPLAY._default : _in0.value_from.display_type;
}
outParent.setType(inputs[| 0].type); _in0.setType(_typ);
outParent.display_type = inputs[| 0].display_type; _in0.display_type = _dis;
} #endregion
static getGraphPreviewSurface = function() { #region
return inputs[| 0].getValue();
} #endregion
static postDeserialize = function() { #region
if(group == noone) return;
createOutput(false); outParent.setType(_in0.type);
} #endregion outParent.display_type = _in0.display_type;
static doApplyDeserialize = function() { #region
} #endregion if(group && _pty != _typ) group.setHeight();
}
static onDestroy = function() { #region static getGraphPreviewSurface = function() { return inputs[| 0].getValue(); }
static postDeserialize = function() { if(group == noone) return; createOutput(false); }
static doApplyDeserialize = function() {}
static onDestroy = function() {
if(is_undefined(outParent)) return; if(is_undefined(outParent)) return;
ds_list_remove(group.outputs, outParent); ds_list_remove(group.outputs, outParent);
@ -126,9 +105,9 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
for (var i = 0, n = array_length(_tos); i < n; i++) for (var i = 0, n = array_length(_tos); i < n; i++)
_tos[i].removeFrom(); _tos[i].removeFrom();
} #endregion }
static onUngroup = function() { #region static onUngroup = function() {
var fr = inputs[| 0].value_from; var fr = inputs[| 0].value_from;
for( var i = 0; i < array_length(outParent.value_to); i++ ) { for( var i = 0; i < array_length(outParent.value_to); i++ ) {
@ -137,9 +116,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
to.setFrom(fr); to.setFrom(fr);
} }
} #endregion }
static onLoadGroup = function() { #region static onLoadGroup = function() { if(group == noone) destroy(); }
if(group == noone) destroy();
} #endregion
} }

View file

@ -237,7 +237,7 @@ function NodeObject(_name, _spr, _node, _create, tooltip = "", tags = []) constr
#macro NODE_ADD_CAT if(!IS_CMD) addNodeCatagory #macro NODE_ADD_CAT if(!IS_CMD) addNodeCatagory
#endregion #endregion
function nodeBuild(_name, _x, _y, _group = PANEL_GRAPH.getCurrentContext()) { #region function nodeBuild(_name, _x, _y, _group = PANEL_GRAPH.getCurrentContext()) {
INLINE INLINE
if(!ds_map_exists(ALL_NODES, _name)) { if(!ds_map_exists(ALL_NODES, _name)) {
@ -245,11 +245,13 @@ function nodeBuild(_name, _x, _y, _group = PANEL_GRAPH.getCurrentContext()) { #r
return noone; return noone;
} }
var _node = ALL_NODES[? _name]; var _node = ALL_NODES[? _name];
return _node.build(_x, _y, _group); var _bnode = _node.build(_x, _y, _group);
} #endregion
function addNodeObject(_list, _name, _spr, _node, _fun, _tag = [], tooltip = "") { #region return _bnode;
}
function addNodeObject(_list, _name, _spr, _node, _fun, _tag = [], tooltip = "") {
if(ds_map_exists(ALL_NODES, _node)) { if(ds_map_exists(ALL_NODES, _node)) {
var _n = ALL_NODES[? _node]; var _n = ALL_NODES[? _node];
ds_list_add(_list, _n); ds_list_add(_list, _n);
@ -261,20 +263,11 @@ function addNodeObject(_list, _name, _spr, _node, _fun, _tag = [], tooltip = "")
ds_list_add(_list, _n); ds_list_add(_list, _n);
return _n; return _n;
} #endregion }
function addNodeCatagory(name, list, filter = [], color = noone) { #region function addNodeCatagory( name, list, filter = [], color = noone) { global.__currPage = name; ds_list_add(NODE_CATEGORY, { name, list, filter, color }); }
global.__currPage = name; function addNodePBCatagory( name, list, filter = []) { ds_list_add(NODE_PB_CATEGORY, { name, list, filter }); }
ds_list_add(NODE_CATEGORY, { name, list, filter, color }); function addNodePCXCatagory( name, list, filter = []) { ds_list_add(NODE_PCX_CATEGORY, { name, list, filter }); }
} #endregion
function addNodePBCatagory(name, list, filter = []) { #region
ds_list_add(NODE_PB_CATEGORY, { name: name, list: list, filter: filter });
} #endregion
function addNodePCXCatagory(name, list, filter = []) { #region
ds_list_add(NODE_PCX_CATEGORY, { name: name, list: list, filter: filter });
} #endregion
function __initNodes() { function __initNodes() {
global.__currPage = ""; global.__currPage = "";