[Graph Panel] Loopback connection is now unhoverable.

This commit is contained in:
Tanasart 2024-09-02 10:00:59 +07:00
parent 5767d8c988
commit 922a41b79e
4 changed files with 29 additions and 28 deletions

View file

@ -76,7 +76,7 @@ function LOAD_PATH(path, readonly = false, safe_mode = false) {
return PROJECT; return PROJECT;
} }
function LOAD_AT(path, params = new __loadParams()) { #region function LOAD_AT(path, params = new __loadParams()) {
static log = false; static log = false;
CALL("load"); CALL("load");
@ -176,7 +176,7 @@ function LOAD_AT(path, params = new __loadParams()) { #region
ds_queue_clear(CONNECTION_CONFLICT); ds_queue_clear(CONNECTION_CONFLICT);
try { try {
array_foreach(create_list, function(node) { node.loadGroup(); } ); array_foreach(create_list, function(node) /*=>*/ {return node.loadGroup()} );
} catch(e) { } catch(e) {
log_warning("LOAD, group", exception_print(e)); log_warning("LOAD, group", exception_print(e));
@ -186,7 +186,7 @@ function LOAD_AT(path, params = new __loadParams()) { #region
printIf(log, $" > Load group : {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Load group : {(get_timer() - t1) / 1000} ms"); t1 = get_timer();
try { try {
array_foreach(create_list, function(node) { node.postDeserialize(); } ); array_foreach(create_list, function(node) /*=>*/ {return node.postDeserialize()} );
} catch(e) { } catch(e) {
log_warning("LOAD, deserialize", exception_print(e)); log_warning("LOAD, deserialize", exception_print(e));
} }
@ -194,7 +194,7 @@ function LOAD_AT(path, params = new __loadParams()) { #region
printIf(log, $" > Deserialize: {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Deserialize: {(get_timer() - t1) / 1000} ms"); t1 = get_timer();
try { try {
array_foreach(create_list, function(node) { node.applyDeserialize(); } ); array_foreach(create_list, function(node) /*=>*/ {return node.applyDeserialize()} );
} catch(e) { } catch(e) {
log_warning("LOAD, apply deserialize", exception_print(e)); log_warning("LOAD, apply deserialize", exception_print(e));
} }
@ -202,9 +202,9 @@ function LOAD_AT(path, params = new __loadParams()) { #region
printIf(log, $" > Apply deserialize : {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Apply deserialize : {(get_timer() - t1) / 1000} ms"); t1 = get_timer();
try { try {
array_foreach(create_list, function(node) { node.preConnect(); } ); array_foreach(create_list, function(node) /*=>*/ {return node.preConnect()} );
array_foreach(create_list, function(node) { node.connect(); } ); array_foreach(create_list, function(node) /*=>*/ {return node.connect()} );
array_foreach(create_list, function(node) { node.postConnect(); } ); array_foreach(create_list, function(node) /*=>*/ {return node.postConnect()} );
} catch(e) { } catch(e) {
log_warning("LOAD, connect", exception_print(e)); log_warning("LOAD, connect", exception_print(e));
} }
@ -275,7 +275,7 @@ function LOAD_AT(path, params = new __loadParams()) { #region
LoadPanelStruct(_load_content.layout.panel); LoadPanelStruct(_load_content.layout.panel);
return true; return true;
} #endregion }
function __EXPORT_ZIP() { exportPortable(PROJECT); } function __EXPORT_ZIP() { exportPortable(PROJECT); }
function __IMPORT_ZIP() { function __IMPORT_ZIP() {

View file

@ -31,7 +31,7 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con
attributes.junc_out = [ junc_out.node.node_id, junc_out.index ]; attributes.junc_out = [ junc_out.node.node_id, junc_out.index ];
} }
static scanJunc = function() { #region static scanJunc = function() {
var node_in = PROJECT.nodeMap[? attributes.junc_in[0]]; var node_in = PROJECT.nodeMap[? attributes.junc_in[0]];
var node_out = PROJECT.nodeMap[? attributes.junc_out[0]]; var node_out = PROJECT.nodeMap[? attributes.junc_out[0]];
@ -40,9 +40,9 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con
if(junc_in) junc_in.value_from_loop = self; if(junc_in) junc_in.value_from_loop = self;
if(junc_out) array_push(junc_out.value_to_loop, self); if(junc_out) array_push(junc_out.value_to_loop, self);
} #endregion }
static updateValue = function() { #region static updateValue = function() {
var type = junc_out.type; var type = junc_out.type;
var val = junc_out.getValue(); var val = junc_out.getValue();
@ -56,27 +56,28 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con
value_buffer = variable_clone(val); value_buffer = variable_clone(val);
break; break;
} }
} #endregion }
static getValue = function(arr) { #region static getValue = function(arr) {
INLINE INLINE
arr[@ 0] = value_buffer; arr[@ 0] = value_buffer;
arr[@ 1] = junc_out; arr[@ 1] = junc_out;
} #endregion }
static drawConnections = function(params = {}) { #region static drawConnections = function(params = {}) {
if(!active) return noone; if(!active) return noone;
if(!junc_in || !junc_out) return noone; if(!junc_in || !junc_out) return noone;
if(!junc_in.node.active || !junc_out.node.active) return noone; if(!junc_in.node.active || !junc_out.node.active) return noone;
params.dashed = true; params.loop = true; params.dashed = true;
var sel = drawJuncConnection(junc_out, junc_in, params); params.loop = true;
params.dashed = false; params.loop = false; drawJuncConnection(junc_out, junc_in, params);
params.dashed = false;
params.loop = false;
if(sel) return self;
return noone; return noone;
} #endregion }
static drawNode = function(_x, _y, _mx, _my, _s, display_parameter = noone) {} static drawNode = function(_x, _y, _mx, _my, _s, display_parameter = noone) {}
@ -84,8 +85,8 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con
static postDeserialize = function() { scanJunc(); } static postDeserialize = function() { scanJunc(); }
static onDestroy = function() { #region static onDestroy = function() {
if(junc_in) junc_in.value_from_loop = noone; if(junc_in) junc_in.value_from_loop = noone;
if(junc_out) array_remove(junc_out.value_to_loop, self); if(junc_out) array_remove(junc_out.value_to_loop, self);
} #endregion }
} }

View file

@ -88,12 +88,12 @@ function Node_Iterate_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x
} }
static drawConnections = function(params = {}) { static drawConnections = function(params = {}) {
if(!active) return; if(!active) return noone;
if(!junc_in || !junc_out) return; if(!junc_in || !junc_out) return noone;
if(!junc_in.node.active || !junc_out.node.active) return; if(!junc_in.node.active || !junc_out.node.active) return noone;
if(drawJuncConnection(junc_out, junc_in, params)) drawJuncConnection(junc_out, junc_in, params);
return self; return noone;
} }
static postDeserialize = function() { static postDeserialize = function() {

View file

@ -2240,7 +2240,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return false; return false;
} }
log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Output not exist.", node); log_warning("LOAD", $"[Connect] Connection conflict {node.name} to {_nd.name} : Output not exist [{con_index}].", node);
return false; return false;
} }