mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-03 08:45:17 +01:00
Fix crash related to struct loading.
This commit is contained in:
parent
af24f73622
commit
c7457c644d
20 changed files with 392 additions and 344 deletions
|
@ -41,7 +41,7 @@ event_inherited();
|
|||
content_hoverable = true;
|
||||
|
||||
canvas = false;
|
||||
collapsed = ds_map_create();
|
||||
collapsed = {};
|
||||
|
||||
#region ---- category ----
|
||||
category = NODE_CATEGORY;
|
||||
|
@ -510,7 +510,7 @@ event_inherited();
|
|||
|
||||
array_push(group_labels, { y: yy, text: __txt(_node), key: _key });
|
||||
|
||||
if(ds_map_exists(collapsed, _key)) {
|
||||
if(struct_try_get(collapsed, _key, 0)) {
|
||||
hh += ui(24 + 4);
|
||||
yy += ui(24 + 4);
|
||||
|
||||
|
@ -611,7 +611,7 @@ event_inherited();
|
|||
var lb = group_labels[i];
|
||||
var _name = lb.text;
|
||||
var _key = lb.key;
|
||||
var _coll = ds_map_exists(collapsed, _key);
|
||||
var _coll = struct_try_get(collapsed, _key, 0);
|
||||
|
||||
var _yy = max(lb.y, i == len - 1? ui(8) : min(ui(8), group_labels[i + 1].y - ui(32)));
|
||||
|
||||
|
@ -623,8 +623,8 @@ event_inherited();
|
|||
_cAll = _coll? -1 : 1;
|
||||
|
||||
} else if(mouse_press(mb_left)) {
|
||||
if(_coll) ds_map_delete(collapsed, _key);
|
||||
else ds_map_add(collapsed, _key, 1);
|
||||
if(_coll) struct_set(collapsed, _key, 0);
|
||||
else struct_set(collapsed, _key, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -638,8 +638,8 @@ event_inherited();
|
|||
draw_text_add(ui(16 + 28), _yy + _lbh / 2, _name);
|
||||
}
|
||||
|
||||
if(_cAll == 1) { for( var i = 0; i < len; i++ ) ds_map_delete(collapsed, group_labels[i].key); }
|
||||
else if(_cAll == -1) { for( var i = 0; i < len; i++ ) ds_map_add(collapsed, group_labels[i].key, 1); }
|
||||
if(_cAll == 1) { for( var i = 0; i < len; i++ ) struct_set(collapsed, group_labels[i].key, 0); }
|
||||
else if(_cAll == -1) { for( var i = 0; i < len; i++ ) struct_set(collapsed, group_labels[i].key, 1); }
|
||||
}
|
||||
|
||||
hh += curr_height;
|
||||
|
@ -677,7 +677,7 @@ event_inherited();
|
|||
|
||||
array_push(group_labels, { y: yy, text: __txt(_node), key: _key });
|
||||
|
||||
if(ds_map_exists(collapsed, _key)) {
|
||||
if(struct_try_get(collapsed, _key, 0)) {
|
||||
hh += ui(24);
|
||||
yy += ui(24);
|
||||
|
||||
|
@ -758,7 +758,7 @@ event_inherited();
|
|||
var lb = group_labels[i];
|
||||
var _name = lb.text;
|
||||
var _key = lb.key;
|
||||
var _coll = ds_map_exists(collapsed, _key);
|
||||
var _coll = struct_try_get(collapsed, _key, 0);
|
||||
var _yy = max(lb.y, i == len - 1? ui(8) : min(ui(8), group_labels[i + 1].y - ui(32)));
|
||||
|
||||
BLEND_OVERRIDE;
|
||||
|
@ -769,8 +769,8 @@ event_inherited();
|
|||
_cAll = _coll? -1 : 1;
|
||||
|
||||
} else if(mouse_press(mb_left)) {
|
||||
if(_coll) ds_map_delete(collapsed, _key);
|
||||
else ds_map_add(collapsed, _key, 1);
|
||||
if(_coll) struct_set(collapsed, _key, 0);
|
||||
else struct_set(collapsed, _key, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -784,8 +784,8 @@ event_inherited();
|
|||
draw_text_add(ui(16 + 28), _yy + _lbh / 2, _name);
|
||||
}
|
||||
|
||||
if(_cAll == 1) { for( var i = 0; i < len; i++ ) ds_map_delete(collapsed, group_labels[i].key); }
|
||||
else if(_cAll == -1) { for( var i = 0; i < len; i++ ) ds_map_add(collapsed, group_labels[i].key, 1); }
|
||||
if(_cAll == 1) { for( var i = 0; i < len; i++ ) struct_set(collapsed, group_labels[i].key, 0); }
|
||||
else if(_cAll == -1) { for( var i = 0; i < len; i++ ) struct_set(collapsed, group_labels[i].key, 1); }
|
||||
}
|
||||
|
||||
if(sHOVER && key_mod_press(CTRL)) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/// @description
|
||||
event_inherited();
|
||||
|
||||
ds_map_destroy(collapsed);
|
||||
WIDGET_CURRENT = noone;
|
|
@ -93,9 +93,7 @@ function draw_line_elbow_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_whit
|
|||
draw_corner(x1 - corner * sx, y0, x1, y0, x1, y0 + corner * sy, thick, colc, sample);
|
||||
}
|
||||
|
||||
function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, params = {}) {
|
||||
var extend = params.extend;
|
||||
|
||||
function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s) {
|
||||
var inv = x1 <= x0;
|
||||
var xx0 = x0;
|
||||
var xx1 = x1;
|
||||
|
|
|
@ -243,11 +243,7 @@ function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c
|
|||
|
||||
}
|
||||
|
||||
function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, params = {}) {
|
||||
var extend = params.extend;
|
||||
var indexIn = struct_try_get(params, "fromIndex", 1);
|
||||
var indexOut = struct_try_get(params, "toIndex", 1);
|
||||
|
||||
function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, indexIn, indexOut) {
|
||||
var iy = sign(y1 - y0);
|
||||
var xx0 = x0 + extend * _s;
|
||||
var xx1 = x1 - extend * _s;
|
||||
|
|
|
@ -30,8 +30,7 @@ function draw_line_connect(x0, y0, x1, y1, _s = 1, thick = 1, c1 = c_white, c2 =
|
|||
|
||||
}
|
||||
|
||||
function distance_to_linear_connection(mx, my, x0, y0, x1, y1, _s, params = {}) {
|
||||
var extend = params.extend;
|
||||
function distance_to_linear_connection(mx, my, x0, y0, x1, y1, _s, extend) {
|
||||
var xx0 = x0 + extend * _s;
|
||||
var xx1 = x1 - extend * _s;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function draw_line_feedback(x0, y0, x1, y1, th, c1, c0, _s) { #region
|
||||
function draw_line_feedback(x0, y0, x1, y1, th, c1, c0, _s) {
|
||||
var _y0 = y0 - 12 * _s;
|
||||
var _y1 = y1 - 12 * _s;
|
||||
|
||||
|
@ -39,9 +39,9 @@ function draw_line_feedback(x0, y0, x1, y1, th, c1, c0, _s) { #region
|
|||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
} #endregion
|
||||
}
|
||||
|
||||
function distance_line_feedback(mx, my, x0, y0, x1, y1, _s) { #region
|
||||
function distance_line_feedback(mx, my, x0, y0, x1, y1, _s) {
|
||||
var _y0 = y0 - 12 * _s;
|
||||
var _y1 = y1 - 12 * _s;
|
||||
|
||||
|
@ -50,4 +50,4 @@ function distance_line_feedback(mx, my, x0, y0, x1, y1, _s) { #region
|
|||
dd = min(dd, distance_to_line(mx, my, x0, _y0, x1, _y1));
|
||||
|
||||
return dd;
|
||||
} #endregion
|
||||
}
|
|
@ -66,14 +66,14 @@ function Node_Array_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
static drawBadge = function(_x, _y, _s) {}
|
||||
static drawJunctionNames = function(_x, _y, _mx, _my, _s) {}
|
||||
|
||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
var _dval = PANEL_GRAPH.value_dragging;
|
||||
var hover = _dval == noone || _dval.connect_type == CONNECT_TYPE.input? outputs[0] : dummy_input;
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
isHovering = point_in_circle(_mx, _my, xx, yy, _s * 24);
|
||||
|
||||
var jhov = hover.drawJunction(_s, _mx, _my);
|
||||
var jhov = hover.drawJunction(_draw, _s, _mx, _my);
|
||||
|
||||
if(!isHovering) return noone;
|
||||
|
||||
|
@ -81,7 +81,7 @@ function Node_Array_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
return jhov? hover : noone;
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s) {
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
|
@ -108,6 +108,6 @@ function Node_Array_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
draw_text_transformed(xx, yy - 12 * _s, display_name, _s * 0.4, _s * 0.4, 0);
|
||||
}
|
||||
|
||||
return drawJunctions(_x, _y, _mx, _my, _s);
|
||||
return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
}
|
||||
}
|
|
@ -280,7 +280,7 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c
|
|||
return _hov;
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s, display_parameter = noone) {}
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s, display_parameter = noone) {}
|
||||
|
||||
static drawBadge = function(_x, _y, _s) {}
|
||||
|
||||
|
|
|
@ -1263,6 +1263,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
updateIO();
|
||||
setHeight();
|
||||
getJunctionList();
|
||||
setJunctionIndex();
|
||||
|
||||
} run_in(1, function() /*=>*/ { refreshNodeDisplay(); });
|
||||
|
||||
|
@ -1518,20 +1519,20 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
h_param = h;
|
||||
}
|
||||
|
||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
var hover = noone;
|
||||
|
||||
for(var i = 0, n = array_length(inputDisplayList); i < n; i++) { //inputs
|
||||
var jun = inputDisplayList[i];
|
||||
|
||||
if(jun.drawJunction(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
|
||||
for(var i = 0; i < array_length(outputs); i++) { // outputs
|
||||
var jun = outputs[i];
|
||||
|
||||
if(!jun.isVisible()) continue;
|
||||
if(jun.drawJunction(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
|
||||
for( var i = 0; i < array_length(inputs); i++ ) { // bypass
|
||||
|
@ -1539,15 +1540,15 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
var jun = _inp.bypass_junc;
|
||||
|
||||
if(jun == noone || !jun.visible) continue;
|
||||
if(jun.drawJunction(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
|
||||
if(hasInspector1Update() && inspectInput1.drawJunction(_s, _mx, _my)) hover = inspectInput1;
|
||||
if(hasInspector2Update() && inspectInput2.drawJunction(_s, _mx, _my)) hover = inspectInput2;
|
||||
if(hasInspector1Update() && inspectInput1.drawJunction(_draw, _s, _mx, _my)) hover = inspectInput1;
|
||||
if(hasInspector2Update() && inspectInput2.drawJunction(_draw, _s, _mx, _my)) hover = inspectInput2;
|
||||
|
||||
if(attributes.show_update_trigger) {
|
||||
if(updatedInTrigger.drawJunction(_s, _mx, _my)) hover = updatedInTrigger;
|
||||
if(updatedOutTrigger.drawJunction(_s, _mx, _my)) hover = updatedOutTrigger;
|
||||
if(updatedInTrigger.drawJunction(_draw, _s, _mx, _my)) hover = updatedInTrigger;
|
||||
if(updatedOutTrigger.drawJunction(_draw, _s, _mx, _my)) hover = updatedOutTrigger;
|
||||
}
|
||||
|
||||
if(attributes.outp_meta) {
|
||||
|
@ -1555,7 +1556,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
var jun = junc_meta[i];
|
||||
|
||||
if(!jun.isVisible()) continue;
|
||||
if(jun.drawJunction(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1564,7 +1565,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
return hover;
|
||||
}
|
||||
|
||||
static drawJunctions_fast = function(_x, _y, _mx, _my, _s) {
|
||||
static drawJunctions_fast = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
var hover = noone;
|
||||
|
||||
draw_set_circle_precision(4);
|
||||
|
@ -1572,14 +1573,14 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
for(var i = 0, n = array_length(inputDisplayList); i < n; i++) {
|
||||
var jun = inputDisplayList[i];
|
||||
|
||||
if(jun.drawJunction_fast(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction_fast(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
|
||||
for(var i = 0; i < array_length(outputs); i++) {
|
||||
var jun = outputs[i];
|
||||
|
||||
if(!jun.isVisible()) continue;
|
||||
if(jun.drawJunction_fast(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction_fast(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
|
||||
for( var i = 0; i < array_length(inputs); i++ ) {
|
||||
|
@ -1587,15 +1588,15 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
var jun = _inp.bypass_junc;
|
||||
|
||||
if(jun == noone || !jun.visible) continue;
|
||||
if(jun.drawJunction_fast(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction_fast(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
|
||||
if(hasInspector1Update() && inspectInput1.drawJunction_fast(_s, _mx, _my)) hover = inspectInput1;
|
||||
if(hasInspector2Update() && inspectInput2.drawJunction_fast(_s, _mx, _my)) hover = inspectInput2;
|
||||
if(hasInspector1Update() && inspectInput1.drawJunction_fast(_draw, _s, _mx, _my)) hover = inspectInput1;
|
||||
if(hasInspector2Update() && inspectInput2.drawJunction_fast(_draw, _s, _mx, _my)) hover = inspectInput2;
|
||||
|
||||
if(attributes.show_update_trigger) {
|
||||
if(updatedInTrigger.drawJunction_fast(_s, _mx, _my)) hover = updatedInTrigger;
|
||||
if(updatedOutTrigger.drawJunction_fast(_s, _mx, _my)) hover = updatedOutTrigger;
|
||||
if(updatedInTrigger.drawJunction_fast(_draw, _s, _mx, _my)) hover = updatedInTrigger;
|
||||
if(updatedOutTrigger.drawJunction_fast(_draw, _s, _mx, _my)) hover = updatedOutTrigger;
|
||||
}
|
||||
|
||||
if(attributes.outp_meta) {
|
||||
|
@ -1603,7 +1604,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
var jun = junc_meta[i];
|
||||
|
||||
if(!jun.isVisible()) continue;
|
||||
if(jun.drawJunction_fast(_s, _mx, _my)) hover = jun;
|
||||
if(jun.drawJunction_fast(_draw, _s, _mx, _my)) hover = jun;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1691,16 +1692,12 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
}
|
||||
}
|
||||
|
||||
__draw_inputs = []
|
||||
static drawConnections = function(params = {}) {
|
||||
if(!active) return noone;
|
||||
__draw_inputs = [];
|
||||
__draw_inputs_len = 0;
|
||||
|
||||
var hovering = noone;
|
||||
static setJunctionIndex = function() {
|
||||
var drawLineIndex = 1;
|
||||
|
||||
var high = params.highlight; // 0
|
||||
var bg = params.bg; // 0
|
||||
|
||||
for(var i = 0, n = array_length(outputs); i < n; i++) {
|
||||
var jun = outputs[i];
|
||||
var connected = !array_empty(jun.value_to);
|
||||
|
@ -1710,40 +1707,49 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
drawLineIndex += 0.5;
|
||||
}
|
||||
|
||||
jun.draw_blend_color = bg;
|
||||
jun.draw_blend = high? PREFERENCES.connection_line_highlight_fade : -1;
|
||||
// jun.draw_blend_color = bg;
|
||||
// jun.draw_blend = high? PREFERENCES.connection_line_highlight_fade : -1;
|
||||
}
|
||||
|
||||
__draw_inputs = array_verify(__draw_inputs, array_length(inputs));
|
||||
var _len = 0;
|
||||
var _jun, _hov;
|
||||
|
||||
if(hasInspector1Update()) { _hov = inspectInput1.drawConnections(params); if(_hov) hovering = _hov; }
|
||||
|
||||
if(hasInspector2Update()) { _hov = inspectInput2.drawConnections(params); if(_hov) hovering = _hov; }
|
||||
|
||||
var drawLineIndex = 1;
|
||||
__draw_inputs_len = 0;
|
||||
|
||||
for(var i = 0, n = array_length(inputs); i < n; i++) {
|
||||
_jun = inputs[i];
|
||||
_jun.draw_blend_color = bg;
|
||||
_jun.draw_blend = high? PREFERENCES.connection_line_highlight_fade : -1;
|
||||
// _jun.draw_blend_color = bg;
|
||||
// _jun.draw_blend = high? PREFERENCES.connection_line_highlight_fade : -1;
|
||||
|
||||
if(_jun.bypass_junc.visible) _jun.bypass_junc.drawBypass(params);
|
||||
if( _jun.value_from == noone || !_jun.value_from.node.active || !_jun.isVisible()) continue;
|
||||
|
||||
__draw_inputs[_len++] = _jun;
|
||||
__draw_inputs[__draw_inputs_len++] = _jun;
|
||||
}
|
||||
|
||||
for( var i = 0; i < _len; i++ ) {
|
||||
for( var i = 0; i < __draw_inputs_len; i++ ) {
|
||||
_jun = __draw_inputs[i];
|
||||
_jun.drawLineIndex = 1 + (i > _len / 2? (_len - 1 - i) : i) * 0.5;
|
||||
_jun.drawLineIndex = 1 + (i > __draw_inputs_len / 2? (__draw_inputs_len - 1 - i) : i) * 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
_hov = _jun.drawConnectionsRaw(params); if(_hov) hovering = _hov;
|
||||
static drawConnections = function(params = {}, _draw = true) {
|
||||
if(!active) return noone;
|
||||
|
||||
var _hov, hovering = noone;
|
||||
// var bg = params.bg;
|
||||
// var high = params.highlight;
|
||||
|
||||
if(hasInspector1Update()) { _hov = inspectInput1.drawConnections(params, _draw); if(_hov) hovering = _hov; }
|
||||
if(hasInspector2Update()) { _hov = inspectInput2.drawConnections(params, _draw); if(_hov) hovering = _hov; }
|
||||
|
||||
for( var i = 0; i < __draw_inputs_len; i++ ) {
|
||||
var _jun = __draw_inputs[i];
|
||||
|
||||
if(_jun.bypass_junc.visible) _jun.bypass_junc.drawBypass(params);
|
||||
_hov = _jun.drawConnections(params, _draw); if(_hov) hovering = _hov;
|
||||
}
|
||||
|
||||
if(attributes.show_update_trigger) {
|
||||
if(updatedInTrigger.drawConnections(params)) hovering = updatedInTrigger;
|
||||
if(updatedOutTrigger.drawConnections(params)) hovering = updatedOutTrigger;
|
||||
if(updatedInTrigger.drawConnections(params, _draw)) hovering = updatedInTrigger;
|
||||
if(updatedOutTrigger.drawConnections(params, _draw)) hovering = updatedOutTrigger;
|
||||
}
|
||||
|
||||
return hovering;
|
||||
|
@ -1893,11 +1899,12 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
static drawNodeFG = function(_x, _y, _mx, _my, _s, display_parameter = noone, _panel = noone) { }
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s, display_parameter = noone, _panel = noone) {
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s, display_parameter = noone, _panel = noone) {
|
||||
if(display_parameter != noone) self.display_parameter = display_parameter;
|
||||
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
if(!_draw) return _s > 0.5? drawJunctions(_draw, xx, yy, _mx, _my, _s) : drawJunctions_fast(_draw, xx, yy, _mx, _my, _s);
|
||||
|
||||
preview_mx = _mx;
|
||||
preview_my = _my;
|
||||
|
@ -1906,7 +1913,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
draw_sprite_stretched_ext(THEME.node_glow_border, 0, xx - 9, yy - 9, w * _s + 18, h * _s + 18, COLORS._main_value_negative, 1);
|
||||
|
||||
drawNodeBase(xx, yy, _s);
|
||||
|
||||
draggable = true;
|
||||
|
||||
if(previewable) {
|
||||
|
@ -1953,8 +1959,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
drawNodeOverlay(xx, yy, _mx, _my, _s);
|
||||
|
||||
if(!previewable) return drawJunctions_fast(xx, yy, _mx, _my, _s);
|
||||
return _s > 0.5? drawJunctions(xx, yy, _mx, _my, _s) : drawJunctions_fast(xx, yy, _mx, _my, _s);
|
||||
if(!previewable) return drawJunctions_fast(_draw, xx, yy, _mx, _my, _s);
|
||||
return _s > 0.5? drawJunctions(_draw, xx, yy, _mx, _my, _s) : drawJunctions_fast(_draw, xx, yy, _mx, _my, _s);
|
||||
}
|
||||
|
||||
static drawNodeBehind = function(_x, _y, _mx, _my, _s) {
|
||||
|
@ -2415,9 +2421,9 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
struct_override(attributes, attr);
|
||||
|
||||
if(!CLONING && LOADING_VERSION < 1_18_02_0) {
|
||||
if(struct_has(attr, "color_depth")) attributes.color_depth += (!array_empty(inputs) && inputs[0].type == VALUE_TYPE.surface)? 1 : 2;
|
||||
if(struct_has(attr, "interpolate")) attributes.interpolate++;
|
||||
if(struct_has(attr, "oversample")) attributes.oversample++;
|
||||
if(struct_has(attributes, "color_depth")) attributes.color_depth += (!array_empty(inputs) && inputs[0].type == VALUE_TYPE.surface)? 1 : 2;
|
||||
if(struct_has(attributes, "interpolate")) attributes.interpolate++;
|
||||
if(struct_has(attributes, "oversample")) attributes.oversample++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
sca_dx = 1;
|
||||
sca_dy = 1;
|
||||
|
||||
static move = function(_x, _y, _s) { #region
|
||||
static move = function(_x, _y, _s) {
|
||||
if(x == _x && y == _y) return;
|
||||
if(!LOADING) PROJECT.modified = true;
|
||||
|
||||
|
@ -66,16 +66,16 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
|
||||
if(inputs[1].setValue([ _x, _y ]))
|
||||
UNDO_HOLDING = true;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onInspector1Update = function() { #region
|
||||
static onInspector1Update = function() {
|
||||
var path = getInputData(0);
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
update();
|
||||
} #endregion
|
||||
}
|
||||
|
||||
function updatePaths(path) { #region
|
||||
function updatePaths(path) {
|
||||
path = path_get(path);
|
||||
if(path == -1) return false;
|
||||
|
||||
|
@ -99,9 +99,9 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var path = getInputData(0);
|
||||
var posi = getInputData(1);
|
||||
var scal = getInputData(2);
|
||||
|
@ -116,16 +116,16 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
pos_y = posi[1];
|
||||
sca_x = scal[0];
|
||||
sca_y = scal[1];
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static drawNodeBase = function(xx, yy, _s) { #region
|
||||
static drawNodeBase = function(xx, yy, _s) {
|
||||
if(!spr || !sprite_exists(spr)) return;
|
||||
|
||||
draw_sprite_uniform(spr, 0, xx, yy, _s);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s) { #region
|
||||
if(spr == noone) return noone;
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
if(!_draw || spr == noone) return noone;
|
||||
|
||||
x = smooth? lerp_float(x, pos_x, 4) : pos_x;
|
||||
y = smooth? lerp_float(y, pos_y, 4) : pos_y;
|
||||
|
@ -145,5 +145,5 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
active_draw_index = -1;
|
||||
}
|
||||
return noone;
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -508,7 +508,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
init_size = false;
|
||||
}
|
||||
|
||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
if(!active) return;
|
||||
|
||||
var hover = noone;
|
||||
|
@ -517,7 +517,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
for(var i = 0, n = array_length(inputDisplayList); i < n; i++) {
|
||||
var jun = inputDisplayList[i];
|
||||
|
||||
if(jun.drawJunction_fast(_s, _mx, _my))
|
||||
if(jun.drawJunction_fast(_draw, _s, _mx, _my))
|
||||
hover = jun;
|
||||
}
|
||||
|
||||
|
@ -528,7 +528,9 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
init_size = true;
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s) {
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
if(!_draw) return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
|
@ -540,6 +542,6 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
active_draw_index = -1;
|
||||
}
|
||||
|
||||
return drawJunctions(xx, yy, _mx, _my, _s);
|
||||
return drawJunctions(_draw, xx, yy, _mx, _my, _s);
|
||||
}
|
||||
}
|
|
@ -66,10 +66,6 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
}
|
||||
|
||||
static drawConnections = function(params = {}) {
|
||||
if(!active) return noone;
|
||||
if(!junc_in || !junc_out) return noone;
|
||||
if(!junc_in.node.active || !junc_out.node.active) return noone;
|
||||
|
||||
params.dashed = true; params.loop = true;
|
||||
drawJuncConnection(junc_out, junc_in, params);
|
||||
params.dashed = false; params.loop = false;
|
||||
|
@ -77,7 +73,7 @@ function Node_Feedback_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
return noone;
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s, display_parameter = noone) {}
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s, display_parameter = noone) {}
|
||||
|
||||
static pointIn = function(_x, _y, _mx, _my, _s) { return false; }
|
||||
|
||||
|
|
|
@ -88,10 +88,6 @@ function Node_Iterate_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x
|
|||
}
|
||||
|
||||
static drawConnections = function(params = {}) {
|
||||
if(!active) return noone;
|
||||
if(!junc_in || !junc_out) return noone;
|
||||
if(!junc_in.node.active || !junc_out.node.active) return noone;
|
||||
|
||||
params.dashed = true; params.loop = true;
|
||||
drawJuncConnection(junc_out, junc_in, params);
|
||||
params.dashed = false; params.loop = false;
|
||||
|
|
|
@ -67,7 +67,7 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
static drawBadge = function(_x, _y, _s) {}
|
||||
static drawJunctionNames = function(_x, _y, _mx, _my, _s) {}
|
||||
|
||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
var _dval = PANEL_GRAPH.value_dragging;
|
||||
var hover = _dval == noone || _dval.connect_type == CONNECT_TYPE.input? outputs[0] : inputs[0];
|
||||
var xx = x * _s + _x;
|
||||
|
@ -76,7 +76,7 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
isHovering = point_in_circle(_mx, _my, xx, yy, _s * 24);
|
||||
hover_junction = noone;
|
||||
|
||||
var jhov = hover.drawJunction(_s, _mx, _my);
|
||||
var jhov = hover.drawJunction(_draw, _s, _mx, _my);
|
||||
|
||||
if(!isHovering) return noone;
|
||||
if(!jhov) draw_sprite_ext(THEME.view_pan, 0, _mx + ui(16), _my + ui(24), 1, 1, 0, COLORS._main_accent);
|
||||
|
@ -87,7 +87,9 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
return hover_junction;
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s) {
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
if(!_draw) return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
|
@ -104,9 +106,7 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
shader_set(sh_node_circle);
|
||||
shader_set_color("color", COLORS._main_accent, hover_alpha);
|
||||
shader_set_f("radius", .5 * hover_scale);
|
||||
|
||||
draw_sprite_stretched(s_fx_pixel, 0, xx - _r, yy - _r, _r * 2, _r * 2);
|
||||
|
||||
shader_set_f("radius", 0);
|
||||
shader_reset();
|
||||
}
|
||||
|
@ -119,6 +119,6 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
draw_text_transformed(xx, yy - 12 * _s, display_name, _s * 0.4, _s * 0.4, 0);
|
||||
}
|
||||
|
||||
return drawJunctions(_x, _y, _mx, _my, _s);
|
||||
return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
}
|
||||
}
|
|
@ -195,12 +195,12 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
isHovering = point_in_circle(_mx, _my, xx, yy, _s * 24);
|
||||
|
||||
junction_hover = inputs[1].drawJunction(_s, _mx, _my);
|
||||
junction_hover = inputs[1].drawJunction(_draw, _s, _mx, _my);
|
||||
|
||||
if(!isHovering) return noone;
|
||||
if(!junction_hover) draw_sprite_ext(THEME.view_pan, 0, _mx + ui(16), _my + ui(24), 1, 1, 0, COLORS._main_accent);
|
||||
|
@ -210,7 +210,9 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
return junction_hover? inputs[1] : noone;
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s) {
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
if(!_draw) return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
|
@ -259,7 +261,7 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
draw_set_text(f_sdf, fa_center, fa_bottom, COLORS._main_text);
|
||||
draw_text_transformed(xx, yy - 12 * _s, string(inputs[0].getValue()), _s * .3, _s * .3, 0);
|
||||
|
||||
return drawJunctions(_x, _y, _mx, _my, _s);
|
||||
return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
}
|
||||
|
||||
static onClone = function() { onValueUpdate(0); }
|
||||
|
|
|
@ -119,12 +119,12 @@ function Node_Tunnel_Out(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
isHovering = point_in_circle(_mx, _my, xx, yy, _s * 24);
|
||||
|
||||
junction_hover = outputs[0].drawJunction(_s, _mx, _my);
|
||||
junction_hover = outputs[0].drawJunction(_draw, _s, _mx, _my);
|
||||
|
||||
if(!isHovering) return noone;
|
||||
if(!junction_hover) draw_sprite_ext(THEME.view_pan, 0, _mx + ui(16), _my + ui(24), 1, 1, 0, COLORS._main_accent);
|
||||
|
@ -133,7 +133,9 @@ function Node_Tunnel_Out(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
return junction_hover? outputs[0] : noone;
|
||||
}
|
||||
|
||||
static drawNode = function(_x, _y, _mx, _my, _s) {
|
||||
static drawNode = function(_draw, _x, _y, _mx, _my, _s) {
|
||||
if(!_draw) return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
|
@ -182,7 +184,7 @@ function Node_Tunnel_Out(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
draw_set_text(f_sdf, fa_center, fa_bottom, COLORS._main_text);
|
||||
draw_text_transformed(xx, yy - 12 * _s, string(inputs[0].getValue()), _s * .3, _s * .3, 0);
|
||||
|
||||
return drawJunctions(_x, _y, _mx, _my, _s);
|
||||
return drawJunctions(_draw, _x, _y, _mx, _my, _s);
|
||||
}
|
||||
|
||||
static onClone = function() { onValueUpdate(0); }
|
||||
|
|
|
@ -1720,6 +1720,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
node.triggerRender();
|
||||
node.clearCacheForward();
|
||||
|
||||
if(PANEL_GRAPH) PANEL_GRAPH.connection_draw_update = true;
|
||||
UPDATE |= RENDER_TYPE.partial;
|
||||
}
|
||||
|
||||
|
@ -1875,12 +1876,12 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
return -1;
|
||||
}
|
||||
|
||||
static drawJunction_fast = function(_s, _mx, _my) {
|
||||
INLINE
|
||||
|
||||
static drawJunction_fast = function(_draw, _s, _mx, _my) {
|
||||
var hov = PANEL_GRAPH.pHOVER && (PANEL_GRAPH.node_hovering == noone || PANEL_GRAPH.node_hovering == node);
|
||||
var _d = node.junction_draw_hei_y * _s;
|
||||
var _hov = hov && point_in_rectangle(_mx, _my, x - 6 * _s, y - _d / 2, x + 6 * _s, y + _d / 2 - 1);
|
||||
if(!_draw) return _hov;
|
||||
|
||||
var _aa = 0.75 + (!is_dummy * 0.25);
|
||||
hover_in_graph = _hov;
|
||||
|
||||
|
@ -1902,19 +1903,20 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
return _hov;
|
||||
}
|
||||
|
||||
static drawJunction = function(_s, _mx, _my) {
|
||||
static drawJunction = function(_draw, _s, _mx, _my) {
|
||||
_s /= 2;
|
||||
|
||||
var hov = PANEL_GRAPH.pHOVER && (PANEL_GRAPH.node_hovering == noone || PANEL_GRAPH.node_hovering == node);
|
||||
var _d = node.junction_draw_hei_y * _s;
|
||||
var is_hover = hov && point_in_rectangle(_mx, _my, x - _d, y - _d, x + _d - 1, y + _d - 1);
|
||||
hover_in_graph = is_hover;
|
||||
var _hov = hov && point_in_rectangle(_mx, _my, x - _d, y - _d, x + _d - 1, y + _d - 1);
|
||||
hover_in_graph = _hov;
|
||||
if(!_draw) return _hov;
|
||||
|
||||
if(custom_icon != noone) {
|
||||
__draw_sprite_ext(custom_icon, 0, x, y, _s, _s, 0, c_white, 1);
|
||||
|
||||
} else if(is_dummy) {
|
||||
__draw_sprite_ext(THEME.node_junction_add, is_hover, x, y, _s, _s, 0, c_white, 0.5 + 0.5 * is_hover);
|
||||
__draw_sprite_ext(THEME.node_junction_add, _hov, x, y, _s, _s, 0, c_white, 0.5 + 0.5 * _hov);
|
||||
|
||||
} else if(type == VALUE_TYPE.action) {
|
||||
var _cbg = c_white;
|
||||
|
@ -1922,7 +1924,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
if(draw_blend != -1)
|
||||
_cbg = merge_color(draw_blend_color, _cbg, draw_blend);
|
||||
|
||||
__draw_sprite_ext(THEME.node_junction_inspector, is_hover, x, y, _s, _s, 0, _cbg, 1);
|
||||
__draw_sprite_ext(THEME.node_junction_inspector, _hov, x, y, _s, _s, 0, _cbg, 1);
|
||||
|
||||
} else {
|
||||
var _cbg = draw_bg;
|
||||
|
@ -1937,11 +1939,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
if(_s > .5) {
|
||||
_bgS = THEME.node_junctions_bg_x2;
|
||||
_fgS = is_hover? THEME.node_junctions_outline_hover_x2 : THEME.node_junctions_outline_x2;
|
||||
_fgS = _hov? THEME.node_junctions_outline_hover_x2 : THEME.node_junctions_outline_x2;
|
||||
|
||||
} else {
|
||||
_bgS = THEME.node_junctions_bg;
|
||||
_fgS = is_hover? THEME.node_junctions_outline_hover : THEME.node_junctions_outline;
|
||||
_fgS = _hov? THEME.node_junctions_outline_hover : THEME.node_junctions_outline;
|
||||
_s *= 2;
|
||||
}
|
||||
|
||||
|
@ -1955,7 +1957,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
gpu_set_blendmode(bm_normal);
|
||||
}
|
||||
|
||||
return is_hover;
|
||||
return _hov;
|
||||
}
|
||||
|
||||
static drawNameBG = function(_s) {
|
||||
|
@ -2009,10 +2011,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
draw_set_alpha(1);
|
||||
}
|
||||
|
||||
static drawConnectionsRaw = function(params = {}) { return drawJuncConnection(value_from, self, params); }
|
||||
static drawConnections = function(params = {}) {
|
||||
static drawConnections = function(params = {}, _draw = true) {
|
||||
if(value_from == noone || !value_from.node.active || !isVisible()) return noone;
|
||||
return drawJuncConnection(value_from, self, params);
|
||||
if(_draw) drawJuncConnection(value_from, self, params);
|
||||
return checkJuncConnection(value_from, self, params);
|
||||
}
|
||||
|
||||
static drawConnectionMouse = function(params, _mx, _my, target = noone) {
|
||||
|
@ -2380,41 +2382,22 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
/////========== FUNCTIONS ==========
|
||||
|
||||
function drawJuncConnection(from, to, params) {
|
||||
#region parameters
|
||||
var log = params.log;
|
||||
var high = params.highlight;
|
||||
var bg = params.bg;
|
||||
var aa = params.aa;
|
||||
function checkJuncConnection(from, to, params) {
|
||||
if(from == noone || to == noone) return noone;
|
||||
if(!params.active || !PANEL_GRAPH.pHOVER) return noone;
|
||||
|
||||
to.draw_line_shift_hover = false;
|
||||
|
||||
var _s = params.s;
|
||||
var mx = params.mx;
|
||||
var my = params.my;
|
||||
var _active = params.active;
|
||||
var cur_layer = params.cur_layer;
|
||||
var max_layer = params.max_layer;
|
||||
|
||||
var hovering = noone;
|
||||
|
||||
var jx = to.x, jy = to.y;
|
||||
var frx = from.x, fry = from.y;
|
||||
|
||||
var fromIndex = from.drawLineIndex;
|
||||
var toIndex = to.drawLineIndex;
|
||||
|
||||
var _loop = struct_try_get(params, "loop");
|
||||
|
||||
if(params.minx != 0 && params.maxx != 0) {
|
||||
var minx = params.minx;
|
||||
var miny = params.miny;
|
||||
var maxx = params.maxx;
|
||||
var maxy = params.maxy;
|
||||
|
||||
if(jx < minx && frx < minx) return noone;
|
||||
if(jx > maxx && frx > maxx) return noone;
|
||||
|
||||
if(jy < miny && fry < miny) return noone;
|
||||
if(jy > maxy && fry > maxy) return noone;
|
||||
if((jx < params.minx && frx < params.minx) || (jx > params.maxx && frx > params.maxx) ||
|
||||
(jy < params.miny && fry < params.miny) || (jy > params.maxy && fry > params.maxy)) return noone;
|
||||
}
|
||||
|
||||
var shx = to.draw_line_shift_x * _s;
|
||||
|
@ -2422,33 +2405,26 @@ function drawJuncConnection(from, to, params) {
|
|||
|
||||
var cx = round((frx + jx) / 2 + shx);
|
||||
var cy = round((fry + jy) / 2 + shy);
|
||||
|
||||
var hover = false;
|
||||
var th = max(1, PREFERENCES.connection_line_width * _s);
|
||||
to.draw_line_shift_hover = false;
|
||||
var hover, hovDist = max(th * 2, 6);
|
||||
|
||||
var _x0 = min(jx, cx, frx) - hovDist, _x1 = max(jx, cx, frx) + hovDist;
|
||||
var _y0 = min(jy, cy, fry) - hovDist, _y1 = max(jy, cy, fry) + hovDist;
|
||||
if(!point_in_rectangle(mx, my, _x0, _y0, _x1, _y1)) return noone;
|
||||
|
||||
var downDirection = to.type == VALUE_TYPE.action || from.type == VALUE_TYPE.action;
|
||||
#endregion
|
||||
var _loop = struct_try_get(params, "loop");
|
||||
|
||||
#region +++++ CHECK HOVER +++++
|
||||
var _drawParam = {
|
||||
extend : PREFERENCES.connection_line_extend,
|
||||
fromIndex : fromIndex,
|
||||
toIndex : toIndex,
|
||||
}
|
||||
var hovDist = max(th * 2, 6);
|
||||
|
||||
if(PANEL_GRAPH.pHOVER) {
|
||||
if(_loop || from.node == to.node) {
|
||||
hover = distance_line_feedback(mx, my, jx, jy, frx, fry, _s) < hovDist;
|
||||
|
||||
} else {
|
||||
var _hdist = 999999;
|
||||
var _hdist;
|
||||
|
||||
switch(PREFERENCES.curve_connection_line) {
|
||||
case 0 :
|
||||
if(downDirection) _hdist = distance_to_line(mx, my, jx, jy, frx, fry);
|
||||
else _hdist = distance_to_linear_connection(mx, my, frx, fry, jx, jy, _s, _drawParam);
|
||||
else _hdist = distance_to_linear_connection(mx, my, frx, fry, jx, jy, _s, PREFERENCES.connection_line_extend);
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
|
@ -2458,33 +2434,56 @@ function drawJuncConnection(from, to, params) {
|
|||
|
||||
case 2 :
|
||||
if(downDirection) _hdist = distance_to_elbow_corner(mx, my, frx, fry, jx, jy);
|
||||
else _hdist = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, _drawParam);
|
||||
else _hdist = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s);
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
if(downDirection) _hdist = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy);
|
||||
else _hdist = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, _drawParam);
|
||||
else _hdist = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, PREFERENCES.connection_line_extend, from.drawLineIndex, to.drawLineIndex);
|
||||
break;
|
||||
|
||||
default : return noone;
|
||||
|
||||
}
|
||||
|
||||
hover = _hdist < hovDist;
|
||||
if(PANEL_GRAPH.value_focus == noone) to.draw_line_shift_hover = hover;
|
||||
}
|
||||
}
|
||||
|
||||
if(_active && hover)
|
||||
hovering = self;
|
||||
#endregion
|
||||
if(PANEL_GRAPH.value_focus == noone) to.draw_line_shift_hover = hover;
|
||||
return hover? self : noone;
|
||||
}
|
||||
|
||||
function drawJuncConnection(from, to, params, _thick = false) {
|
||||
if(from == noone || to == noone) return noone;
|
||||
|
||||
static drawParam = {
|
||||
extend : 0,
|
||||
fromIndex : 0,
|
||||
toIndex : 0,
|
||||
corner : 0,
|
||||
type : 0,
|
||||
}
|
||||
|
||||
var high = params.highlight;
|
||||
var bg = params.bg;
|
||||
var aa = params.aa;
|
||||
|
||||
var _s = params.s;
|
||||
var jx = to.x, jy = to.y;
|
||||
var frx = from.x, fry = from.y;
|
||||
|
||||
if(params.minx != 0 && params.maxx != 0) {
|
||||
if((jx < params.minx && frx < params.minx) || (jx > params.maxx && frx > params.maxx) ||
|
||||
(jy < params.miny && fry < params.miny) || (jy > params.maxy && fry > params.maxy)) return noone;
|
||||
}
|
||||
|
||||
var shx = to.draw_line_shift_x * _s;
|
||||
var shy = to.draw_line_shift_y * _s;
|
||||
var cx = round((frx + jx) / 2 + shx);
|
||||
var cy = round((fry + jy) / 2 + shy);
|
||||
var th = max(1, PREFERENCES.connection_line_width * _s) * (1 + _thick);
|
||||
|
||||
#region draw parameters
|
||||
var thicken = false;
|
||||
thicken |= PANEL_GRAPH.nodes_junction_d == self;
|
||||
thicken |= _active && PANEL_GRAPH.junction_hovering == self && PANEL_GRAPH.value_focus == noone;
|
||||
thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == self;
|
||||
|
||||
th *= thicken? 2 : 1;
|
||||
|
||||
var corner = PREFERENCES.connection_line_corner * _s;
|
||||
|
||||
var ty = LINE_STYLE.solid;
|
||||
|
@ -2513,52 +2512,45 @@ function drawJuncConnection(from, to, params) {
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region +++++ DRAW LINE +++++
|
||||
var ss = _s * aa;
|
||||
jx *= aa;
|
||||
jy *= aa;
|
||||
frx *= aa;
|
||||
fry *= aa;
|
||||
th *= aa;
|
||||
cx *= aa;
|
||||
cy *= aa;
|
||||
corner *= aa;
|
||||
th = max(1, round(th));
|
||||
th = max(1, round(th * aa));
|
||||
|
||||
draw_set_color(c0);
|
||||
var _loop = struct_try_get(params, "loop");
|
||||
if(_loop) { draw_line_feedback(jx, jy, frx, fry, th, c1, c0, ss); return; }
|
||||
|
||||
if(_loop || from.node == to.node) {
|
||||
draw_line_feedback(jx, jy, frx, fry, th, c1, c0, ss);
|
||||
} else {
|
||||
_drawParam.corner = corner;
|
||||
_drawParam.type = ty;
|
||||
var down = to.type == VALUE_TYPE.action || from.type == VALUE_TYPE.action;
|
||||
drawParam.extend = PREFERENCES.connection_line_extend;
|
||||
drawParam.fromIndex = from.drawLineIndex;
|
||||
drawParam.toIndex = to.drawLineIndex;
|
||||
drawParam.corner = corner;
|
||||
drawParam.type = ty;
|
||||
|
||||
switch(PREFERENCES.curve_connection_line) {
|
||||
case 0 :
|
||||
if(downDirection) draw_line_width_color(jx, jy, frx, fry, th, c0, c1);
|
||||
else draw_line_connect(frx, fry, jx, jy, ss, th, c0, c1, _drawParam);
|
||||
if(down) draw_line_width_color(jx, jy, frx, fry, th, c0, c1);
|
||||
else draw_line_connect(frx, fry, jx, jy, ss, th, c0, c1, drawParam);
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
if(downDirection) draw_line_curve_corner(jx, jy, frx, fry, ss, th, c0, c1);
|
||||
if(down) draw_line_curve_corner(jx, jy, frx, fry, ss, th, c0, c1);
|
||||
else draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty);
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
if(downDirection) draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, _drawParam);
|
||||
else draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, _drawParam);
|
||||
if(down) draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, drawParam);
|
||||
else draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, drawParam);
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
if(downDirection) draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, _drawParam);
|
||||
else draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, _drawParam);
|
||||
if(down) draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, drawParam);
|
||||
else draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, drawParam);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_alpha(1);
|
||||
#endregion
|
||||
|
||||
return hovering;
|
||||
}
|
|
@ -219,7 +219,6 @@ function connectionParameter() constructor {
|
|||
|
||||
max_layer = 0;
|
||||
highlight = 0;
|
||||
cur_layer = 1;
|
||||
|
||||
static setPos = function(_x, _y, _s, _mx, _my) {
|
||||
self.x = _x;
|
||||
|
@ -403,12 +402,18 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
add_node_draw_x = 0;
|
||||
add_node_draw_y = 0;
|
||||
|
||||
node_surface = surface_create(1, 1);
|
||||
node_surface_update = true;
|
||||
|
||||
connection_aa = 2;
|
||||
connection_surface = surface_create(1, 1);
|
||||
connection_surface_cc = surface_create(1, 1);
|
||||
connection_surface_aa = surface_create(1, 1);
|
||||
|
||||
connection_draw_mouse = noone;
|
||||
connection_draw_target = noone;
|
||||
connection_draw_update = true;
|
||||
connection_cache = {};
|
||||
|
||||
value_focus = noone;
|
||||
_value_focus = noone;
|
||||
|
@ -1196,6 +1201,29 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
return _hov;
|
||||
}
|
||||
|
||||
function drawCacheCheck(_x, _y, _s, _w, _h) {
|
||||
var _upd = false;
|
||||
|
||||
_upd |= pFOCUS && mouse_click(mb_any);
|
||||
|
||||
_upd |= connection_cache[$ "_x"] != _x; connection_cache[$ "_x"] = _x;
|
||||
_upd |= connection_cache[$ "_y"] != _y; connection_cache[$ "_y"] = _y;
|
||||
_upd |= connection_cache[$ "_s"] != _s; connection_cache[$ "_s"] = _s;
|
||||
_upd |= connection_cache[$ "_w"] != _w; connection_cache[$ "_w"] = _w;
|
||||
_upd |= connection_cache[$ "_h"] != _h; connection_cache[$ "_h"] = _h;
|
||||
|
||||
_upd |= connection_cache[$ "curve_connection_line"] != PREFERENCES.curve_connection_line; connection_cache[$ "curve_connection_line"] = PREFERENCES.curve_connection_line;
|
||||
_upd |= connection_cache[$ "connection_line_width"] != PREFERENCES.connection_line_width; connection_cache[$ "connection_line_width"] = PREFERENCES.connection_line_width;
|
||||
_upd |= connection_cache[$ "connection_line_corner"] != PREFERENCES.connection_line_corner; connection_cache[$ "connection_line_corner"] = PREFERENCES.connection_line_corner;
|
||||
_upd |= connection_cache[$ "connection_line_extend"] != PREFERENCES.connection_line_extend; connection_cache[$ "connection_line_extend"] = PREFERENCES.connection_line_extend;
|
||||
_upd |= connection_cache[$ "connection_line_aa"] != PREFERENCES.connection_line_aa; connection_cache[$ "connection_line_aa"] = PREFERENCES.connection_line_aa;
|
||||
|
||||
connection_draw_update |= _upd;
|
||||
|
||||
_upd |= connection_cache[$ "frame"] != CURRENT_FRAME; connection_cache[$ "frame"] = CURRENT_FRAME;
|
||||
node_surface_update |= _upd;
|
||||
}
|
||||
|
||||
function drawNodes() { //
|
||||
if(selection_block-- > 0) return;
|
||||
display_parameter.highlight = !array_empty(nodes_selecting) && ((PREFERENCES.connection_line_highlight == 1 && key_mod_press(ALT)) || PREFERENCES.connection_line_highlight == 2);
|
||||
|
@ -1215,15 +1243,20 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
|
||||
__self = self;
|
||||
|
||||
var log = false;
|
||||
drawCacheCheck(__gr_x, __gr_y, __gr_s, __gr_w, __gr_h);
|
||||
|
||||
var log = 0;
|
||||
var t = get_timer();
|
||||
printIf(log, "============ Draw start ============");
|
||||
|
||||
_frame_hovering = frame_hovering;
|
||||
frame_hovering = noone;
|
||||
|
||||
var _node_draw = display_parameter.show_control? nodes_list : array_filter(nodes_list, function(_n) /*=>*/ {return !_n.is_controller});
|
||||
_node_draw = array_filter( _node_draw, function(_n) /*=>*/ {
|
||||
var _node_active = nodes_list;
|
||||
if(display_parameter.show_control) _node_active = array_filter(nodes_list, function(_n) /*=>*/ {return _n.active});
|
||||
else _node_active = array_filter(nodes_list, function(_n) /*=>*/ {return _n.active && !_n.is_controller});
|
||||
|
||||
var _node_draw = array_filter( _node_active, function(_n) /*=>*/ {
|
||||
_n.preDraw(__gr_x, __gr_y, __gr_s, __gr_x, __gr_y);
|
||||
var _cull = _n.cullCheck(__gr_x, __gr_y, __gr_s, -32, -32, __gr_w + 32, __gr_h + 64);
|
||||
|
||||
|
@ -1484,30 +1517,41 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
// draw connections
|
||||
var aa = floor(min(8192 / w, 8192 / h, PREFERENCES.connection_line_aa));
|
||||
|
||||
connection_draw_update |= !surface_valid(connection_surface_cc, w * aa, h * aa);
|
||||
|
||||
connection_surface = surface_verify(connection_surface, w * aa, h * aa);
|
||||
connection_surface_cc = surface_verify(connection_surface_cc, w * aa, h * aa);
|
||||
connection_surface_aa = surface_verify(connection_surface_aa, w, h );
|
||||
|
||||
hov = noone;
|
||||
|
||||
if(connection_draw_update || pHOVER) {
|
||||
surface_set_target(connection_surface_cc);
|
||||
if(connection_draw_update) { DRAW_CLEAR }
|
||||
|
||||
var hoverable = !bool(node_dragging) && pHOVER;
|
||||
|
||||
connection_param.active = hoverable;
|
||||
connection_param.setPos(gr_x, gr_y, graph_s, mx, my);
|
||||
connection_param.setBoundary(-64, -64, w + 64, h + 64);
|
||||
connection_param.setProp(array_length(_node_active), display_parameter.highlight);
|
||||
connection_param.setDraw(aa, bg_color);
|
||||
|
||||
array_foreach(_node_active, function(n) /*=>*/ {
|
||||
var _hov = n.drawConnections(connection_param, connection_draw_update);
|
||||
if(is_struct(_hov)) hov = _hov;
|
||||
});
|
||||
|
||||
connection_draw_update = false;
|
||||
surface_reset_target();
|
||||
}
|
||||
|
||||
surface_set_target(connection_surface);
|
||||
DRAW_CLEAR
|
||||
|
||||
var hov = noone;
|
||||
var hoverable = !bool(node_dragging) && pHOVER;
|
||||
var param = connection_param;
|
||||
draw_surface(connection_surface_cc, 0, 0);
|
||||
|
||||
param.active = hoverable;
|
||||
param.setPos(gr_x, gr_y, graph_s, mx, my);
|
||||
param.setBoundary(-64, -64, w + 64, h + 64);
|
||||
param.setProp(array_length(nodes_list), display_parameter.highlight);
|
||||
param.setDraw(aa, bg_color);
|
||||
|
||||
for( var i = 0, n = array_length(nodes_list); i < n; i++ ) {
|
||||
var _node = nodes_list[i];
|
||||
if(!_node.active || (!display_parameter.show_control && _node.is_controller))
|
||||
continue;
|
||||
|
||||
param.cur_layer = i + 1;
|
||||
var _hov = _node.drawConnections(param);
|
||||
if(_hov != noone && is_struct(_hov)) hov = _hov;
|
||||
}
|
||||
if(hov) drawJuncConnection(hov.value_from, hov, connection_param, true);
|
||||
|
||||
if(value_dragging && connection_draw_mouse != noone && !key_mod_press(SHIFT)) {
|
||||
var _cmx = connection_draw_mouse[0];
|
||||
|
@ -1515,7 +1559,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
var _cmt = connection_draw_target;
|
||||
|
||||
if(array_empty(value_draggings))
|
||||
value_dragging.drawConnectionMouse(param, _cmx, _cmy, _cmt);
|
||||
value_dragging.drawConnectionMouse(connection_param, _cmx, _cmy, _cmt);
|
||||
else {
|
||||
var _stIndex = array_find(value_draggings, value_dragging);
|
||||
|
||||
|
@ -1523,7 +1567,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
var _dmx = _cmx;
|
||||
var _dmy = value_draggings[i].connect_type == CONNECT_TYPE.output? _cmy + (i - _stIndex) * 24 * graph_s : _cmy;
|
||||
|
||||
value_draggings[i].drawConnectionMouse(param, _dmx, _dmy, _cmt);
|
||||
value_draggings[i].drawConnectionMouse(connection_param, _dmx, _dmy, _cmt);
|
||||
}
|
||||
}
|
||||
} else if(add_node_draw_junc != noone) {
|
||||
|
@ -1534,7 +1578,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
var _amx = gr_x + add_node_draw_x * graph_s;
|
||||
var _amy = gr_y + add_node_draw_y * graph_s;
|
||||
|
||||
add_node_draw_junc.drawConnectionMouse(param, _amx, _amy);
|
||||
add_node_draw_junc.drawConnectionMouse(connection_param, _amx, _amy);
|
||||
}
|
||||
}
|
||||
surface_reset_target();
|
||||
|
@ -1565,12 +1609,19 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
|
||||
var t = get_timer();
|
||||
|
||||
array_foreach(_node_draw, function(_n) /*=>*/ { _n.drawNodeBehind(__gr_x, __gr_y, __mx, __my, __gr_s); });
|
||||
node_surface_update |= !surface_valid(node_surface, w, h);
|
||||
node_surface_update |= true;
|
||||
node_surface = surface_verify(node_surface, w, h);
|
||||
|
||||
surface_set_target(node_surface);
|
||||
if(node_surface_update) draw_clear_alpha(bg_color, 0.);
|
||||
|
||||
if(node_surface_update) array_foreach(_node_draw, function(_n) /*=>*/ { _n.drawNodeBehind(__gr_x, __gr_y, __mx, __my, __gr_s); });
|
||||
array_foreach(value_draggings, function(_v) /*=>*/ { _v.graph_selecting = true; });
|
||||
|
||||
array_foreach(_node_draw, function(_n) /*=>*/ {
|
||||
try {
|
||||
var val = _n.drawNode(__gr_x, __gr_y, __mx, __my, __gr_s, display_parameter, __self);
|
||||
var val = _n.drawNode(node_surface_update, __gr_x, __gr_y, __mx, __my, __gr_s, display_parameter, __self);
|
||||
if(val) {
|
||||
value_focus = val;
|
||||
if(key_mod_press(SHIFT)) TOOLTIP = [ val.getValue(), val.type ];
|
||||
|
@ -1578,12 +1629,19 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
} catch(e) { log_warning("NODE DRAW", exception_print(e)); }
|
||||
});
|
||||
|
||||
array_foreach(_node_draw, function(_n) /*=>*/ { _n.drawBadge(__gr_x, __gr_y, __gr_s); });
|
||||
array_foreach(_node_draw, function(_n) /*=>*/ { _n.drawNodeFG(__gr_x, __gr_y, __mx, __my, __gr_s, display_parameter, __self); });
|
||||
if(node_surface_update) array_foreach(_node_draw, function(_n) /*=>*/ { _n.drawBadge(__gr_x, __gr_y, __gr_s); });
|
||||
if(node_surface_update) array_foreach(_node_draw, function(_n) /*=>*/ { _n.drawNodeFG(__gr_x, __gr_y, __mx, __my, __gr_s, display_parameter, __self); });
|
||||
surface_reset_target();
|
||||
|
||||
node_surface_update = false;
|
||||
|
||||
if(PANEL_INSPECTOR && PANEL_INSPECTOR.prop_hover != noone)
|
||||
value_focus = PANEL_INSPECTOR.prop_hover;
|
||||
|
||||
BLEND_ALPHA_MULP
|
||||
draw_surface_safe(node_surface);
|
||||
BLEND_NORMAL
|
||||
|
||||
printIf(log, $"Draw node: {get_timer() - t}"); t = get_timer();
|
||||
|
||||
// dragging
|
||||
|
@ -1835,7 +1893,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
}
|
||||
}
|
||||
|
||||
if(_connect[0] == -7 && !is_instanceof(value_dragging.node, Node_Pin)) {
|
||||
if(_connect[0] == -7 && !is(value_dragging.node, Node_Pin)) {
|
||||
if(_connect[1].value_from_loop != noone)
|
||||
_connect[1].value_from_loop.destroy();
|
||||
|
||||
|
@ -1933,8 +1991,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
connection_draw_mouse = [ _mmx, _mmy ];
|
||||
connection_draw_target = target;
|
||||
|
||||
value_dragging.drawJunction(graph_s, value_dragging.x, value_dragging.y);
|
||||
if(target) target.drawJunction(graph_s, target.x, target.y);
|
||||
value_dragging.drawJunction(true, graph_s, value_dragging.x, value_dragging.y);
|
||||
if(target) target.drawJunction(true, graph_s, target.x, target.y);
|
||||
|
||||
var _inline_ctx = value_dragging.node.inline_context;
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ function graph_export_image(allList, nodeList, settings = {}) {
|
|||
#region draw frame
|
||||
for(var i = 0; i < array_length(nodeList); i++) {
|
||||
if(instanceof(nodeList[i]) != "Node_Frame") continue;
|
||||
nodeList[i].drawNode(gr_x, gr_y, mx, my, scale);
|
||||
nodeList[i].drawNode(true, gr_x, gr_y, mx, my, scale);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -118,7 +118,7 @@ function graph_export_image(allList, nodeList, settings = {}) {
|
|||
for(var i = 0; i < array_length(nodeList); i++) {
|
||||
var _node = nodeList[i];
|
||||
if(instanceof(_node) == "Node_Frame") continue;
|
||||
var val = _node.drawNode(gr_x, gr_y, mx, my, scale, param);
|
||||
var val = _node.drawNode(true, gr_x, gr_y, mx, my, scale, param);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ function struct_override(original, override) {
|
|||
var args = variable_struct_get_names(override);
|
||||
|
||||
for( var i = 0, n = array_length(args); i < n; i++ ) {
|
||||
var _key = args[i];
|
||||
var _key = array_safe_get(args, i);
|
||||
|
||||
if(!struct_has(original, _key)) continue;
|
||||
original[$ _key] = override[$ _key];
|
||||
|
@ -22,7 +22,7 @@ function struct_override_nested(original, override) {
|
|||
var args = variable_struct_get_names(override);
|
||||
|
||||
for( var i = 0, n = array_length(args); i < n; i++ ) {
|
||||
var _key = args[i];
|
||||
var _key = array_safe_get(args, i);
|
||||
|
||||
if(!struct_has(original, _key)) continue;
|
||||
if(is_struct(original[$ _key]))
|
||||
|
@ -39,8 +39,10 @@ function struct_append(original, append) {
|
|||
|
||||
var args = variable_struct_get_names(append);
|
||||
|
||||
for( var i = 0, n = array_length(args); i < n; i++ )
|
||||
original[$ args[i]] = append[$ args[i]];
|
||||
for( var i = 0, n = array_length(args); i < n; i++ ) {
|
||||
var _key = array_safe_get(args, i);
|
||||
original[$ _key] = append[$ _key];
|
||||
}
|
||||
|
||||
return original;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue