diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 716e02626..dd7a1d32b 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -378,10 +378,10 @@ event_inherited(); var _cont = PANEL_GRAPH.getCurrentContext(); if(_cont != noone) array_append(sug, nodeReleatedQuery("context", instanceof(_cont))); - if(array_length(sug)) { + if(!array_empty(sug)) { ds_list_add(_list, "Related"); for( var i = 0, n = array_length(sug); i < n; i++ ) - ds_list_add(_list, ALL_NODES[? sug[i]]); + ds_list_add(_list, ALL_NODES[? array_safe_get(sug, i)]); } ds_list_add(_list, "Favourites"); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 91602defc..3e7031fa3 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -1256,6 +1256,16 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru updateColor(); } resetDisplay(); #endregion + static setColor = function(col) { #region + color = col; + updateColor(); + + if(value_from != noone) + value_from.setColor(col); + + return self; + } #endregion + static updateColor = function(val = undefined) { #region INLINE diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 368413f3b..f2e0ef065 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -439,7 +439,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { if(node_hover) node_hover.attributes.color = __temp_color; array_foreach(nodes_selecting, function(node) { node.attributes.color = __temp_color; }); } - + var _clrs = COLORS.labels; var _item = array_create(array_length(_clrs)); @@ -470,10 +470,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { function setSelectingJuncColor(color) { if(__junction_hovering == noone) return; - __junction_hovering.color = color; - - if(__junction_hovering.value_from != noone) - __junction_hovering.value_from.color = color; + __junction_hovering.setColor(color); for(var i = 0; i < array_length(nodes_selecting); i++) { var _node = nodes_selecting[i]; @@ -481,9 +478,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { for( var j = 0, m = ds_list_size(_node.inputs); j < m; j++ ) { var _input = _node.inputs[| j]; if(_input.isLeaf()) continue; - - _input.color = color; - _input.value_from.color = color; + _input.setColor(color); } } } diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 03ff2ef32..193e2f01a 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -142,13 +142,11 @@ function Panel_Inspector() : PanelContent() constructor { function setSelectingItemColor(color) { if(__dialog_junction == noone) return; - __dialog_junction.color = color; + __dialog_junction.setColor(color); - if(__dialog_junction.value_from != noone) - __dialog_junction.value_from.color = color; var _val_to = __dialog_junction.getJunctionTo(); for( var i = 0, n = array_length(_val_to); i < n; i++ ) - _val_to[i].color = color; + _val_to[i].setColor(color); } var _clrs = COLORS.labels;