diff --git a/objects/o_dialog_add_multiple_images/Draw_64.gml b/objects/o_dialog_add_multiple_images/Draw_64.gml index 5655e87ee..beb99ddb8 100644 --- a/objects/o_dialog_add_multiple_images/Draw_64.gml +++ b/objects/o_dialog_add_multiple_images/Draw_64.gml @@ -54,7 +54,6 @@ if !ready exit; case "Node_Image_Animated" : Node_create_Image_Animated_path(nx, ny, path_arr); break; case "Node_Directory_Search" : Node_create_Directory_path(nx, ny, paths[0]); break; } - PANEL_GRAPH.fullView(); instance_destroy(); } } diff --git a/scripts/buttonGroup/buttonGroup.gml b/scripts/buttonGroup/buttonGroup.gml index 8d2cfa616..82f178767 100644 --- a/scripts/buttonGroup/buttonGroup.gml +++ b/scripts/buttonGroup/buttonGroup.gml @@ -138,7 +138,7 @@ function buttonGroup(_data, _onClick) : widget() constructor { } } else { sb_small.setFocusHover(active, hover); - sb_small.draw(_x, _y, _w, _h, data[_selecting], _m, _rx, _ry); + sb_small.draw(_x, _y, _w, _h, array_safe_get(data, _selecting, "-"), _m, _rx, _ry); } if(WIDGET_CURRENT == self) diff --git a/scripts/canvas_tool_node/canvas_tool_node.gml b/scripts/canvas_tool_node/canvas_tool_node.gml index 45f1bcc6b..f43c7cc9d 100644 --- a/scripts/canvas_tool_node/canvas_tool_node.gml +++ b/scripts/canvas_tool_node/canvas_tool_node.gml @@ -61,12 +61,18 @@ function canvas_tool_node(canvas, node) : canvas_tool() constructor { inputJunction = noone; outputJunction = noone; + setColor = true; + for( var i = 0, n = ds_list_size(nodeObject.inputs); i < n; i++ ) { var _in = nodeObject.inputs[| i]; - if(_in.type == VALUE_TYPE.surface || _in.name == "Dimension") { + if(_in.type == VALUE_TYPE.surface || _in.name == "Dimension") inputJunction = _in; - break; + + if(_in.type == VALUE_TYPE.color && setColor) { + _in.setValue(CURRENT_COLOR); + setColor = false; } + } for( var i = 0, n = ds_list_size(nodeObject.outputs); i < n; i++ ) { diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index d35ac659f..cf5d5ee81 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -38,7 +38,7 @@ LATEST_VERSION = 11700; VERSION = 11760; SAVE_VERSION = 11700; - VERSION_STRING = "1.17.6.004"; + VERSION_STRING = "1.17.6.005"; BUILD_NUMBER = 11760; globalvar HOTKEYS, HOTKEY_CONTEXT; diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index 528b53a99..1e5785d90 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -298,7 +298,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc return _nodes; } #endregion - static getInput = function(junc = noone) { #region + static getInput = function(_y = 0, junc = noone) { #region return input_dummy; } #endregion diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index e8f44e172..f3c03bdcb 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -449,19 +449,27 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { function onInputResize() { refreshDynamicInput(); triggerRender(); } - static getOutput = function(junc = noone) { #region + static getOutput = function(_y, junc = noone) { + var _targ = noone; + var _dy = 9999; + for( var i = 0; i < ds_list_size(outputs); i++ ) { if(!outputs[| i].visible) continue; if(junc != noone && !junc.isConnectable(outputs[| i], true)) continue; - return outputs[| i]; + var _ddy = abs(outputs[| i].y - _y); + if(_ddy < _dy) { + _targ = outputs[| i]; + _dy = _ddy; + } } - return noone; - } #endregion - - static getInput = function(junc = noone, shift = input_fix_len) { #region - if(dummy_input) return dummy_input; + return _targ; + } + static getInput = function(_y = 0, junc = noone, shift = input_fix_len) { + var _targ = noone; + var _dy = 9999; + for( var i = shift; i < ds_list_size(inputs); i++ ) { var _inp = inputs[| i]; @@ -469,10 +477,22 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { if(_inp.value_from != noone) continue; if(junc != noone && (value_bit(junc.type) & value_bit(_inp.type)) == 0) continue; - return _inp; + var _ddy = abs(_inp.y - _y); + + if(_ddy < _dy) { + _targ = _inp; + _dy = _ddy; + } } - return noone; - } #endregion + + if(dummy_input) { + var _ddy = abs(dummy_input.y - _y); + if(_ddy < _dy) + _targ = dummy_input; + } + + return _targ; + } /////========== INSPECTOR =========== @@ -726,7 +746,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { } if(!APPENDING && !LOADING) run_in(1, method(self, resetDefault)); static addInput = function(junctionFrom, shift = input_fix_len) { #region - var targ = getInput(junctionFrom, shift); + var targ = getInput(y, junctionFrom, shift); if(targ == noone) return; targ.setFrom(junctionFrom); @@ -1360,9 +1380,18 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { var yy = y * _s + _y; var _hov = PANEL_GRAPH.pHOVER && (PANEL_GRAPH.node_hovering == noone || PANEL_GRAPH.node_hovering == self); + show_input_name = _hov && point_in_rectangle(_mx, _my, xx - 12 * _s, yy + 20 * _s, xx + 12 * _s, yy + h * _s); show_output_name = _hov && point_in_rectangle(_mx, _my, xx + (w - 12) * _s, yy + 20 * _s, xx + (w + 12) * _s, yy + h * _s); + if(PANEL_GRAPH.value_dragging && PANEL_GRAPH.node_hovering == self) { + if(PANEL_GRAPH.value_dragging.connect_type == JUNCTION_CONNECT.input) + show_output_name = true; + + if(PANEL_GRAPH.value_dragging.connect_type == JUNCTION_CONNECT.output) + show_input_name = true; + } + if(show_input_name) { for(var i = 0, n = array_length(inputDisplayList); i < n; i++) { var jun = inputDisplayList[i]; diff --git a/scripts/node_functions/node_functions.gml b/scripts/node_functions/node_functions.gml index 2524023c0..c0f35ee64 100644 --- a/scripts/node_functions/node_functions.gml +++ b/scripts/node_functions/node_functions.gml @@ -206,7 +206,7 @@ var _var = strs[0]; var splt = string_splice(_var, "["); - var inp = PROJECT.globalNode.getInput(_var); + var inp = PROJECT.globalNode.getInputKey(_var); if(inp == noone) { noti_warning($"Variable {_var} not found."); return 0; diff --git a/scripts/node_global/node_global.gml b/scripts/node_global/node_global.gml index d1e4ddf4d..3c5ae8743 100644 --- a/scripts/node_global/node_global.gml +++ b/scripts/node_global/node_global.gml @@ -219,7 +219,7 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor { return true; } #endregion - static getInput = function(key, def = noone) { #region + static getInputKey = function(key, def = noone) { #region if(!ds_map_exists(value, key)) return def; return value[? key]; } #endregion diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index e470861ab..e07e803d6 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1666,15 +1666,17 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { if(value_focus && value_focus != value_dragging) target = value_focus; - if(key_mod_press(CTRL) && node_hovering != noone) { + else if(!key_mod_press(CTRL) && node_hovering != noone) { if(value_dragging.connect_type == JUNCTION_CONNECT.input) { - target = node_hovering.getOutput(value_dragging); + target = node_hovering.getOutput(my, value_dragging); if(target != noone) node_hovering.active_draw_index = 1; + } else { - target = node_hovering.getInput(value_dragging, 0); + target = node_hovering.getInput(my, value_dragging, 0); if(target != noone) node_hovering.active_draw_index = 1; + } }