mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-03-03 14:14:49 +01:00
panel perf
This commit is contained in:
parent
9665e4ef6e
commit
ba6e8a7eb0
35 changed files with 724 additions and 751 deletions
|
@ -60,7 +60,7 @@ draw_clear(COLORS.bg);
|
|||
winManDraw();
|
||||
#endregion
|
||||
|
||||
if(APP_SURF_OVERRIDE) { #region
|
||||
if(APP_SURF_OVERRIDE) {
|
||||
surface_reset_target();
|
||||
draw_surface(POST_APP_SURF, 0, 0);
|
||||
|
||||
|
@ -71,4 +71,4 @@ if(APP_SURF_OVERRIDE) { #region
|
|||
surface_set_target(POST_APP_SURF);
|
||||
draw_surface(APP_SURF, 0, 0);
|
||||
surface_reset_target();
|
||||
} #endregion
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, thick = 1, c1 = c_white, c2 = c_white, params = {}) {
|
||||
var extend = params.extend;
|
||||
var indexIn = struct_try_get(params, "fromIndex", 1);
|
||||
var indexOut = struct_try_get(params, "toIndex", 1);
|
||||
|
||||
var corner = min(extend, params.corner);
|
||||
var type = params.type;
|
||||
|
||||
|
@ -17,8 +20,8 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s =
|
|||
|
||||
var iy = sign(y1 - y0);
|
||||
|
||||
var xx0 = x0;
|
||||
var xx1 = x1;
|
||||
var xx0 = x0 + extend * _s;
|
||||
var xx1 = x1 - extend * _s;
|
||||
var yy0 = y0;
|
||||
var yy1 = y1;
|
||||
|
||||
|
@ -32,6 +35,9 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s =
|
|||
var rx = _x1 - _x0;
|
||||
var ry = _y1 - _y0;
|
||||
|
||||
xx0 = x0 + extend * _s * indexIn;
|
||||
xx1 = x1 - extend * _s * indexOut;
|
||||
|
||||
if(inv) {
|
||||
var cm = merge_color(c1, c2, 0.5);
|
||||
|
||||
|
@ -209,6 +215,9 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s =
|
|||
|
||||
function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, params = {}) {
|
||||
var extend = params.extend;
|
||||
var indexIn = struct_try_get(params, "fromIndex", 1);
|
||||
var indexOut = struct_try_get(params, "toIndex", 1);
|
||||
|
||||
var corner = min(extend, params.corner);
|
||||
var type = params.type;
|
||||
|
||||
|
@ -236,10 +245,12 @@ 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);
|
||||
|
||||
var iy = sign(y1 - y0);
|
||||
var xx0 = x0;
|
||||
var xx1 = x1;
|
||||
var xx0 = x0 + extend * _s;
|
||||
var xx1 = x1 - extend * _s;
|
||||
var yy0 = y0;
|
||||
var yy1 = y1;
|
||||
|
||||
|
@ -252,6 +263,9 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, params = {})
|
|||
var rx = _x1 - _x0;
|
||||
var ry = _y1 - _y0;
|
||||
|
||||
xx0 = x0 + extend * _s * indexIn;
|
||||
xx1 = x1 - extend * _s * indexOut;
|
||||
|
||||
var dist = 9999999;
|
||||
if(inv) {
|
||||
var ofl = cy < _y0 || cy > _y1;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
LATEST_VERSION = 1_18_00_0;
|
||||
VERSION = 1_18_04_0;
|
||||
SAVE_VERSION = 1_18_02_0;
|
||||
VERSION_STRING = MAC? "1.18.003m" : "1.18.5.002";
|
||||
VERSION_STRING = MAC? "1.18.003m" : "1.18.5.003";
|
||||
BUILD_NUMBER = 1_18_04_1;
|
||||
|
||||
HOTKEYS = ds_map_create();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Array";
|
||||
setDimension(96, 32);
|
||||
|
||||
attributes.spread_value = false;
|
||||
|
||||
|
|
|
@ -119,25 +119,19 @@ function Node_Array_Rearrange(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
inputs[1].setValue(_val);
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
var _typ = VALUE_TYPE.any;
|
||||
if(inputs[0].value_from != noone) _typ = inputs[0].value_from.type;
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var _typ = inputs[0].value_from == noone? VALUE_TYPE.any : inputs[0].value_from.type;
|
||||
|
||||
inputs[0].setType(_typ);
|
||||
outputs[0].setType(_typ);
|
||||
|
||||
if(type != _typ) {
|
||||
if(_typ == VALUE_TYPE.surface)
|
||||
setDimension(128, 128);
|
||||
else
|
||||
setDimension(96, 32 + 24);
|
||||
if(_typ == VALUE_TYPE.surface) setDimension(128, 128);
|
||||
else setDimension(96, 32 + 24);
|
||||
|
||||
type = _typ;
|
||||
will_setHeight = true;
|
||||
}
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var _arr = getInputData(0);
|
||||
var _ord = getInputData(1);
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
draw_rectangle(_rx, _ry, _rx + _rw, _ry + _rh, true);
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
static processData_prebatch = function() {
|
||||
var _back = getSingleValue(0);
|
||||
var _fore = getSingleValue(1);
|
||||
var _fill = getSingleValue(5);
|
||||
|
|
|
@ -331,7 +331,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
static step = function() {
|
||||
if(combine_render_time) {
|
||||
render_time = 0;
|
||||
array_foreach(getNodeList(), function(node) { render_time += node.render_time; });
|
||||
array_foreach(getNodeList(), function(node) /*=>*/ { render_time += node.render_time; });
|
||||
}
|
||||
|
||||
onStep();
|
||||
|
|
|
@ -91,7 +91,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
.setDisplay(VALUE_DISPLAY.palette);
|
||||
|
||||
input_display_list = [11, 12, 15, 9, 24,
|
||||
["Surface", false], 0, 8, 16, 17, 13,
|
||||
["Input", false], 0, 8, 16, 17, 13,
|
||||
["Brightness", false], 1, 18, 10, 25, 2, 19,
|
||||
["HSV", false], 3, 20, 4, 21, 5, 22,
|
||||
["Color blend", false], 6, 14, 7, 23,
|
||||
|
@ -101,22 +101,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
attribute_surface_depth();
|
||||
|
||||
static step = function() { #region
|
||||
var type = getInputData(12);
|
||||
|
||||
inputs[ 0].setVisible(type == 0, type == 0);
|
||||
inputs[ 8].setVisible(type == 0, type == 0);
|
||||
inputs[ 9].setVisible(type == 0);
|
||||
inputs[13].setVisible(type == 1, type == 1);
|
||||
inputs[14].setVisible(type == 0);
|
||||
|
||||
outputs[0].setVisible(type == 0, type == 0);
|
||||
outputs[1].setVisible(type == 1, type == 1);
|
||||
|
||||
var _msk = is_surface(getSingleValue(8));
|
||||
inputs[16].setVisible(_msk);
|
||||
inputs[17].setVisible(_msk);
|
||||
|
||||
static step = function() {
|
||||
inputs[ 1].mappableStep();
|
||||
inputs[ 2].mappableStep();
|
||||
inputs[ 3].mappableStep();
|
||||
|
@ -125,9 +110,29 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
inputs[ 7].mappableStep();
|
||||
inputs[ 9].mappableStep();
|
||||
inputs[10].mappableStep();
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
static processData_prebatch = function() {
|
||||
var _type = getSingleValue(12);
|
||||
|
||||
inputs[ 0].setVisible(_type == 0, _type == 0);
|
||||
inputs[ 8].setVisible(_type == 0, _type == 0);
|
||||
inputs[ 9].setVisible(_type == 0);
|
||||
inputs[13].setVisible(_type == 1, _type == 1);
|
||||
inputs[14].setVisible(_type == 0);
|
||||
|
||||
outputs[0].setVisible(_type == 0, _type == 0);
|
||||
outputs[1].setVisible(_type == 1, _type == 1);
|
||||
|
||||
inputs[16].setVisible(_type == 0);
|
||||
inputs[17].setVisible(_type == 0);
|
||||
|
||||
preview_draw = _type == 0;
|
||||
if(_type == 0) setDimension(128, 128);
|
||||
else if(_type == 1) setDimension(96, process_length[13] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _bri = _data[1];
|
||||
var _con = _data[2];
|
||||
var _hue = _data[3];
|
||||
|
@ -155,7 +160,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
_col = array_clone(_col);
|
||||
|
||||
if(_type == 1) { #region color adjust
|
||||
if(_type == 1) { // single color adjust
|
||||
if(is_array(_bri)) _bri = array_safe_get_fast(_bri, 0);
|
||||
if(is_array(_con)) _con = array_safe_get_fast(_con, 0);
|
||||
if(is_array(_hue)) _hue = array_safe_get_fast(_hue, 0);
|
||||
|
@ -197,7 +202,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
}
|
||||
|
||||
return _col;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
#region param
|
||||
var sw = surface_get_width_safe(_baseSurf);
|
||||
|
@ -252,15 +257,10 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
#endregion
|
||||
|
||||
return _outSurf;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var type = getInputData(12);
|
||||
if(preview_draw != (type == 0)) {
|
||||
preview_draw = (type == 0);
|
||||
will_setHeight = true;
|
||||
}
|
||||
|
||||
if(type == 0) return;
|
||||
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
|
@ -270,7 +270,6 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
if(array_empty(pal)) return;
|
||||
if(!is_array(pal[0])) pal = [ pal ];
|
||||
|
||||
var _h = array_length(pal) * 32;
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(pal);
|
||||
|
||||
|
@ -278,8 +277,5 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
drawPalette(pal[i], bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Color Data";
|
||||
batch_output = false;
|
||||
setDimension(96, 48);
|
||||
|
||||
newInput(0, nodeValue_Color("Color", self, c_white))
|
||||
|
@ -19,31 +18,38 @@ function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
newOutput(6, nodeValue_Output("Brightness", self, VALUE_TYPE.float, 0).setVisible(false));
|
||||
newOutput(7, nodeValue_Output("Alpha", self, VALUE_TYPE.float, 0).setVisible(false));
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
static processData = function(_outData, _data, _output_index, _array_index = 0) {
|
||||
var _c = _data[0];
|
||||
var _n = _data[1];
|
||||
|
||||
var val = 0;
|
||||
switch(_output_index) {
|
||||
case 0 : val = color_get_red(_c); break;
|
||||
case 1 : val = color_get_green(_c); break;
|
||||
case 2 : val = color_get_blue(_c); break;
|
||||
if(!is_numeric(_c)) return _outData;
|
||||
|
||||
case 3 : val = color_get_hue(_c); break;
|
||||
case 4 : val = color_get_saturation(_c); break;
|
||||
case 5 : val = color_get_value(_c); break;
|
||||
if(_n) {
|
||||
_outData[0] = _color_get_red(_c);
|
||||
_outData[1] = _color_get_green(_c);
|
||||
_outData[2] = _color_get_blue(_c);
|
||||
|
||||
case 6 :
|
||||
var r = color_get_red(_c);
|
||||
var g = color_get_green(_c);
|
||||
var b = color_get_blue(_c);
|
||||
val = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||
break;
|
||||
_outData[3] = _color_get_hue(_c);
|
||||
_outData[4] = _color_get_saturation(_c);
|
||||
_outData[5] = _color_get_value(_c);
|
||||
|
||||
case 7 : val = color_get_alpha(_c); break;
|
||||
_outData[6] = 0.2126 * _outData[0] + 0.7152 * _outData[1] + 0.0722 * _outData[2];
|
||||
_outData[7] = _color_get_alpha(_c);
|
||||
|
||||
} else {
|
||||
_outData[0] = color_get_red(_c);
|
||||
_outData[1] = color_get_green(_c);
|
||||
_outData[2] = color_get_blue(_c);
|
||||
|
||||
_outData[3] = color_get_hue(_c);
|
||||
_outData[4] = color_get_saturation(_c);
|
||||
_outData[5] = color_get_value(_c);
|
||||
|
||||
_outData[6] = 0.2126 * _outData[0] + 0.7152 * _outData[1] + 0.0722 * _outData[2];
|
||||
_outData[7] = color_get_alpha(_c);
|
||||
}
|
||||
|
||||
return _n? val / 255 : val;
|
||||
return _outData;
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
|
|
|
@ -43,20 +43,6 @@ function Node_Condition(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
newOutput(0, nodeValue_Output("Result", self, VALUE_TYPE.any, []));
|
||||
newOutput(1, nodeValue_Output("Bool", self, VALUE_TYPE.boolean, false));
|
||||
|
||||
static step = function() {
|
||||
var _mode = getInputData(5);
|
||||
|
||||
inputs[0].setVisible(_mode == 1, _mode == 1);
|
||||
inputs[1].setVisible(_mode == 1);
|
||||
inputs[2].setVisible(_mode == 1, _mode == 1);
|
||||
inputs[6].setVisible(_mode == 0, _mode == 0);
|
||||
inputs[7].setVisible(_mode == 2, _mode == 2);
|
||||
inputs[8].setVisible(_mode == 2, _mode == 2);
|
||||
|
||||
inputs[3].setType(inputs[3].value_from == noone? VALUE_TYPE.any : inputs[3].value_from.type);
|
||||
inputs[4].setType(inputs[4].value_from == noone? VALUE_TYPE.any : inputs[4].value_from.type);
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var _true = getInputData(3);
|
||||
var _fals = getInputData(4);
|
||||
|
@ -70,6 +56,16 @@ function Node_Condition(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
var _txt1 = getInputData(7);
|
||||
var _txt2 = getInputData(8);
|
||||
|
||||
inputs[0].setVisible(_mode == 1, _mode == 1);
|
||||
inputs[1].setVisible(_mode == 1);
|
||||
inputs[2].setVisible(_mode == 1, _mode == 1);
|
||||
inputs[6].setVisible(_mode == 0, _mode == 0);
|
||||
inputs[7].setVisible(_mode == 2, _mode == 2);
|
||||
inputs[8].setVisible(_mode == 2, _mode == 2);
|
||||
|
||||
inputs[3].setType(inputs[3].value_from == noone? VALUE_TYPE.any : inputs[3].value_from.type);
|
||||
inputs[4].setType(inputs[4].value_from == noone? VALUE_TYPE.any : inputs[4].value_from.type);
|
||||
|
||||
var res = false;
|
||||
|
||||
switch(_mode) {
|
||||
|
|
|
@ -103,11 +103,9 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
w = 128;
|
||||
h = 128;
|
||||
min_w = w;
|
||||
min_h = name_height;
|
||||
con_h = 128;
|
||||
|
||||
h_param = h;
|
||||
will_setHeight = false;
|
||||
preserve_height_for_preview = false;
|
||||
|
||||
selectable = true;
|
||||
|
@ -587,12 +585,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
updatedOutTrigger.setValue(false);
|
||||
}
|
||||
|
||||
if(will_setHeight) {
|
||||
setHeight();
|
||||
getJunctionList();
|
||||
will_setHeight = false;
|
||||
}
|
||||
|
||||
if(is_3D == NODE_3D.polygon) USE_DEPTH = true;
|
||||
if(is_simulation) PROJECT.animator.is_simulating = true;
|
||||
|
||||
|
@ -737,9 +729,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
}
|
||||
}
|
||||
|
||||
h = max(min_h, _prev_surf * 128, _hi, _ho);
|
||||
h = max(previewable? con_h : name_height, _prev_surf * 128, _hi, _ho);
|
||||
if(attributes.node_height) h = max(h, attributes.node_height);
|
||||
|
||||
}
|
||||
|
||||
static getJunctionList = function() { ////getJunctionList
|
||||
|
@ -988,14 +979,12 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
if(!is_instanceof(self, Node_Collection))
|
||||
render_time = get_timer() - render_timer;
|
||||
|
||||
//refreshNodeDisplay();
|
||||
LOG_BLOCK_END();
|
||||
}
|
||||
|
||||
static valueUpdate = function(index) {
|
||||
onValueUpdate(index);
|
||||
|
||||
if(is_dynamic_input) will_setHeight = true;
|
||||
cacheCheck();
|
||||
}
|
||||
|
||||
|
@ -1006,7 +995,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
if(auto_input && !LOADING && !APPENDING)
|
||||
refreshDynamicInput();
|
||||
|
||||
if(is_dynamic_input) will_setHeight = true;
|
||||
cacheCheck();
|
||||
}
|
||||
|
||||
|
@ -1246,6 +1234,12 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
/////============= DRAW =============
|
||||
|
||||
static setShowParameter = function(showParam) {
|
||||
show_parameter = showParam;
|
||||
refreshNodeDisplay();
|
||||
return self;
|
||||
}
|
||||
|
||||
static onInspect = function() {}
|
||||
|
||||
static pointIn = function(_x, _y, _mx, _my, _s) {
|
||||
|
@ -1267,6 +1261,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
draw_boundary[3] = maxy;
|
||||
|
||||
draw_graph_culled = !rectangle_in_rectangle(minx, miny, maxx, maxy, x0, y0, x1, y1);
|
||||
return !draw_graph_culled;
|
||||
}
|
||||
|
||||
static refreshNodeDisplay = function() {
|
||||
|
@ -1278,10 +1273,26 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
} run_in(1, function() /*=>*/ { refreshNodeDisplay(); });
|
||||
|
||||
static preDraw = function(_x, _y, _s) {
|
||||
__preDraw_data = { _x: undefined, _y: undefined, _s: undefined };
|
||||
|
||||
static preDraw = function(_x, _y, _s) {
|
||||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
var _upd = __preDraw_data._x != xx ||
|
||||
__preDraw_data._y != yy ||
|
||||
__preDraw_data._s != _s;
|
||||
|
||||
__preDraw_data._x = xx;
|
||||
__preDraw_data._y = yy;
|
||||
__preDraw_data._s = _s;
|
||||
|
||||
if(!_upd) {
|
||||
if(SHOW_PARAM) h = h_param;
|
||||
onPreDraw(_x, _y, _s, _iy, _oy);
|
||||
return;
|
||||
}
|
||||
|
||||
var jun;
|
||||
|
||||
var inspCount = hasInspector1Update() + hasInspector2Update();
|
||||
|
@ -1319,70 +1330,23 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
_junSy = yy + _junRy * _s;
|
||||
}
|
||||
|
||||
var _ix = xx;
|
||||
var _iy = _junSy;
|
||||
var rx = x;
|
||||
var ry = y + _junRy;
|
||||
__s = _s;
|
||||
_ix = xx;
|
||||
_iy = _junSy;
|
||||
|
||||
for( var i = 0, n = array_length(inputs); i < n; i++ ) {
|
||||
jun = inputs[i];
|
||||
_ox = xx + w * _s;
|
||||
_oy = _junSy;
|
||||
|
||||
jun.x = _ix; jun.rx = rx;
|
||||
jun.y = _iy; jun.ry = ry;
|
||||
}
|
||||
array_foreach(inputs, function(jun) /*=>*/ { jun.x = _ix; jun.y = _iy; });
|
||||
array_foreach(inputDisplayList, function(jun) /*=>*/ { jun.x = _ix; jun.y = _iy; _iy += junction_draw_hei_y * __s; });
|
||||
|
||||
for(var i = 0; i < in_cache_len; i++) {
|
||||
jun = inputDisplayList[i];
|
||||
array_foreach(outputs_index, function(jun) /*=>*/ { jun = outputs[jun]; jun.x = _ox; jun.y = _oy; _oy += junction_draw_hei_y * jun.isVisible() * __s; });
|
||||
|
||||
jun.x = _ix; jun.rx = rx;
|
||||
jun.y = _iy; jun.ry = ry;
|
||||
|
||||
_iy += junction_draw_hei_y * _s;
|
||||
ry += junction_draw_hei_y;
|
||||
}
|
||||
|
||||
var _ox = xx + w * _s;
|
||||
var _oy = _junSy;
|
||||
var rx = x + w;
|
||||
var ry = y + _junRy;
|
||||
var idx;
|
||||
|
||||
var _oamo = getOutputJunctionAmount();
|
||||
for(var i = 0; i < _oamo; i++) {
|
||||
idx = outputs_index[i];
|
||||
jun = outputs[idx];
|
||||
|
||||
jun.x = _ox; jun.rx = rx;
|
||||
jun.y = _oy; jun.ry = ry;
|
||||
|
||||
_oy += junction_draw_hei_y * jun.isVisible() * _s;
|
||||
ry += junction_draw_hei_y * jun.isVisible();
|
||||
}
|
||||
|
||||
for( var i = 0; i < array_length(inputs); i++ ) {
|
||||
var _inp = inputs[i];
|
||||
var jun = _inp.bypass_junc;
|
||||
if(jun == noone) continue;
|
||||
|
||||
jun.x = _ox; jun.rx = rx;
|
||||
jun.y = _oy; jun.ry = ry;
|
||||
|
||||
_oy += junction_draw_hei_y * jun.visible * _s;
|
||||
ry += junction_draw_hei_y * jun.visible;
|
||||
}
|
||||
|
||||
for( var i = 0, n = array_length(junc_meta); i < n; i++ ) {
|
||||
var jun = junc_meta[i];
|
||||
|
||||
jun.x = _ox; jun.rx = rx;
|
||||
jun.y = _oy; jun.ry = ry;
|
||||
|
||||
_oy += junction_draw_hei_y * jun.isVisible() * _s;
|
||||
ry += junction_draw_hei_y * jun.isVisible();
|
||||
}
|
||||
array_foreach(inputs, function(jun) /*=>*/ { jun = jun.bypass_junc; if(!jun.visible) return;
|
||||
jun.x = _ox; jun.y = _oy; _oy += junction_draw_hei_y * jun.visible * __s; });
|
||||
array_foreach(junc_meta, function(jun) /*=>*/ { jun.x = _ox; jun.y = _oy; _oy += junction_draw_hei_y * jun.isVisible() * __s; });
|
||||
|
||||
if(SHOW_PARAM) h = h_param;
|
||||
|
||||
onPreDraw(_x, _y, _s, _iy, _oy);
|
||||
}
|
||||
|
||||
|
@ -1396,7 +1360,9 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
static getColor = function() { INLINE return attributes.color == -1? color : attributes.color; }
|
||||
|
||||
static drawNodeBase = function(xx, yy, _s) { INLINE draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, getColor(), (.25 + .5 * renderActive) * (.25 + .75 * isHighlightingInGraph())); }
|
||||
static drawNodeBase = function(xx, yy, _s) {
|
||||
draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, getColor(), (.25 + .5 * renderActive) * (.25 + .75 * isHighlightingInGraph()));
|
||||
}
|
||||
|
||||
static drawNodeOverlay = function(xx, yy, _mx, _my, _s) {}
|
||||
|
||||
|
@ -1738,7 +1704,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
__draw_inputs = []
|
||||
static drawConnections = function(params = {}) {
|
||||
if(!active) return;
|
||||
if(!active) return noone;
|
||||
|
||||
var hovering = noone;
|
||||
var drawLineIndex = 1;
|
||||
|
@ -1746,43 +1712,26 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
var high = params.highlight; // 0
|
||||
var bg = params.bg; // 0
|
||||
|
||||
for(var i = 0; i < array_length(outputs); i++) {
|
||||
for(var i = 0, n = array_length(outputs); i < n; i++) {
|
||||
var jun = outputs[i];
|
||||
var connected = false;
|
||||
|
||||
for( var j = 0; j < array_length(jun.value_to); j++ ) {
|
||||
if(jun.value_to[j].value_from == jun)
|
||||
connected = true;
|
||||
}
|
||||
var connected = !array_empty(jun.value_to);
|
||||
|
||||
if(connected) {
|
||||
jun.drawLineIndex = drawLineIndex;
|
||||
drawLineIndex += 0.5;
|
||||
}
|
||||
|
||||
if(high) {
|
||||
jun.draw_blend_color = bg;
|
||||
jun.draw_blend = PREFERENCES.connection_line_highlight_fade;
|
||||
} else {
|
||||
jun.draw_blend_color = bg;
|
||||
jun.draw_blend = -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(hasInspector1Update()) { _hov = inspectInput1.drawConnections(params); if(_hov) hovering = _hov; }
|
||||
|
||||
if(hasInspector2Update()) {
|
||||
_hov = inspectInput2.drawConnections(params);
|
||||
if(_hov) hovering = _hov;
|
||||
}
|
||||
if(hasInspector2Update()) { _hov = inspectInput2.drawConnections(params); if(_hov) hovering = _hov; }
|
||||
|
||||
var drawLineIndex = 1;
|
||||
for(var i = 0, n = array_length(inputs); i < n; i++) {
|
||||
|
@ -1790,25 +1739,17 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
_jun.draw_blend_color = bg;
|
||||
_jun.draw_blend = high? PREFERENCES.connection_line_highlight_fade : -1;
|
||||
|
||||
if( _jun.value_from == noone) continue;
|
||||
if(!_jun.value_from.node.active) continue;
|
||||
if(!_jun.isVisible()) continue;
|
||||
if(_jun.bypass_junc.visible) _jun.bypass_junc.drawBypass(params);
|
||||
if( _jun.value_from == noone || !_jun.value_from.node.active || !_jun.isVisible()) continue;
|
||||
|
||||
if(i >= 0) __draw_inputs[_len++] = _jun;
|
||||
}
|
||||
|
||||
for( var i = 0; i < array_length(inputs); i++ ) {
|
||||
var jun = inputs[i].bypass_junc;
|
||||
if(jun == noone || !jun.visible) continue;
|
||||
jun.drawBypass(params);
|
||||
__draw_inputs[_len++] = _jun;
|
||||
}
|
||||
|
||||
for( var i = 0; i < _len; i++ ) {
|
||||
_jun = __draw_inputs[i];
|
||||
_jun.drawLineIndex = 1 + (i > _len / 2? (_len - 1 - i) : i) * 0.5;
|
||||
|
||||
_hov = _jun.drawConnectionsRaw(params);
|
||||
if(_hov) hovering = _hov;
|
||||
_hov = _jun.drawConnectionsRaw(params); if(_hov) hovering = _hov;
|
||||
}
|
||||
|
||||
if(attributes.show_update_trigger) {
|
||||
|
@ -2032,7 +1973,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
}
|
||||
|
||||
static drawNodeBehind = function(_x, _y, _mx, _my, _s) {
|
||||
if(draw_graph_culled) return;
|
||||
if(!active) return;
|
||||
|
||||
var xx = x * _s + _x;
|
||||
|
@ -2608,10 +2548,14 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
static setDimension = function(_w = 128, _h = 128, _apply = true) {
|
||||
INLINE
|
||||
|
||||
var _oh = con_h;
|
||||
min_w = _w;
|
||||
con_h = _h;
|
||||
|
||||
if(_apply) { w = _w; h = _h; }
|
||||
if(!_apply) return;
|
||||
|
||||
w = max(w, min_w);
|
||||
if(_oh != _h) refreshNodeDisplay();
|
||||
}
|
||||
|
||||
static move = function(_x, _y, _s) {
|
||||
|
|
|
@ -56,7 +56,9 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
|
||||
static onValueUpdate = function(index = 3) { global.__FRAME_LABEL_SCALE = getInputData(3); }
|
||||
|
||||
static step = function() {
|
||||
static setHeight = function() {}
|
||||
|
||||
static update = function() {
|
||||
previewable = true;
|
||||
|
||||
var sz = getInputData(0);
|
||||
|
@ -70,6 +72,9 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
lcolor = getInputData(4);
|
||||
}
|
||||
|
||||
static drawNode = function() { return noone; }
|
||||
static drawBadge = function() { return noone; }
|
||||
|
||||
static drawNodeBase = function(xx, yy, _s, _panel) {
|
||||
var px0 = 3;
|
||||
var py0 = 3;
|
||||
|
|
|
@ -14,6 +14,10 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
|
||||
newOutput(2, nodeValue_Output("Type", self, VALUE_TYPE.integer, 0 ));
|
||||
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var gra = _data[0];
|
||||
|
||||
|
@ -42,8 +46,6 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
var grad = getInputData(0);
|
||||
if(!is_array(grad)) grad = [ grad ];
|
||||
|
||||
var _h = array_length(grad) * 32;
|
||||
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(grad);
|
||||
|
||||
|
@ -51,8 +53,5 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
grad[i].draw(bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
}
|
||||
}
|
|
@ -15,6 +15,10 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
_pal = -1;
|
||||
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var pal = _data[0];
|
||||
var pos = _data[1];
|
||||
|
@ -32,7 +36,6 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
var grad = outputs[0].getValue();
|
||||
if(!is_array(grad)) grad = [ grad ];
|
||||
var _h = array_length(grad) * 32;
|
||||
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(grad);
|
||||
|
@ -41,8 +44,5 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
grad[i].draw(bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
}
|
||||
}
|
|
@ -17,12 +17,16 @@ function Node_Gradient_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
|
||||
_pal = -1;
|
||||
|
||||
static step = function() { #region
|
||||
static step = function() {
|
||||
var usePos = array_safe_get_fast(current_data, 1);
|
||||
inputs[2].setVisible(usePos, usePos);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var pal = _data[0];
|
||||
var pos_use = _data[1];
|
||||
var _pos = _data[2];
|
||||
|
@ -50,15 +54,14 @@ function Node_Gradient_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
}
|
||||
|
||||
return grad;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = outputs[0].getValue();
|
||||
if(!is_array(grad)) grad = [ grad ];
|
||||
var _h = array_length(grad) * 32;
|
||||
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(grad);
|
||||
|
@ -67,8 +70,5 @@ function Node_Gradient_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
|||
grad[i].draw(bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
function Node_Gradient_Replace_Color(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Gradient Replace";
|
||||
setDimension(96, 48);;
|
||||
setDimension(96, 48);
|
||||
|
||||
newInput(0, nodeValue_Gradient("Gradient", self, new gradientObject(cola(c_white))))
|
||||
.setVisible(true, true);
|
||||
|
@ -14,7 +14,11 @@ function Node_Gradient_Replace_Color(_x, _y, _group = noone) : Node_Processor(_x
|
|||
|
||||
newOutput(0, nodeValue_Output("Gradient", self, VALUE_TYPE.gradient, new gradientObject(cola(c_white)) ));
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var gra = _data[0];
|
||||
var pfr = _data[1];
|
||||
var pto = _data[2];
|
||||
|
@ -43,15 +47,14 @@ function Node_Gradient_Replace_Color(_x, _y, _group = noone) : Node_Processor(_x
|
|||
graO.type = gra.type;
|
||||
|
||||
return graO;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = outputs[0].getValue();
|
||||
if(!is_array(grad)) grad = [ grad ];
|
||||
var _h = array_length(grad) * 32;
|
||||
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(grad);
|
||||
|
@ -61,7 +64,5 @@ function Node_Gradient_Replace_Color(_x, _y, _group = noone) : Node_Processor(_x
|
|||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -17,7 +17,11 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
|
||||
_pal = -1;
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var pal = _data[0];
|
||||
var sft = _data[1];
|
||||
var lop = _data[2];
|
||||
|
@ -42,15 +46,14 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
|
||||
_outSurf.type = pal.type;
|
||||
return _outSurf;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
var grad = outputs[0].getValue();
|
||||
if(!is_array(grad)) grad = [ grad ];
|
||||
var _h = array_length(grad) * 32;
|
||||
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(grad);
|
||||
|
@ -59,8 +62,5 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
grad[i].draw(bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -423,6 +423,10 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
doTrigger = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
if(is_undefined(inParent)) return;
|
||||
|
||||
var _dstype = getInputData(0);
|
||||
var _data = getInputData(2);
|
||||
|
@ -458,16 +462,13 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
inputs[4].setVisible(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
if(is_undefined(inParent)) return;
|
||||
visibleCheck();
|
||||
|
||||
outputs[0].setValue(inParent.getValue());
|
||||
}
|
||||
|
||||
static getGraphPreviewSurface = function() { return inputs[0].getValue(); }
|
||||
static getGraphPreviewSurface = function() { var _in = array_safe_get(inputs, 0, noone); return _in == noone? noone : _in.getValue(); }
|
||||
|
||||
static postDeserialize = function() { createInput(false); }
|
||||
|
||||
|
|
|
@ -77,7 +77,9 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
if(is_undefined(outParent)) return;
|
||||
|
||||
outParent.name = display_name;
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _in0 = inputs[0];
|
||||
var _pty = _in0.type;
|
||||
var _typ = _in0.value_from == noone? VALUE_TYPE.any : _in0.value_from.type;
|
||||
|
@ -93,13 +95,11 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
outParent.draw_fg = _in0.draw_fg;
|
||||
|
||||
if(group && _pty != _typ) group.setHeight();
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
outParent.setValue(inputs[0].getValue());
|
||||
}
|
||||
|
||||
static getGraphPreviewSurface = function() { return inputs[0].getValue(); }
|
||||
static getGraphPreviewSurface = function() { var _in = array_safe_get(inputs, 0, noone); return _in == noone? noone : _in.getValue(); }
|
||||
static postDeserialize = function() { if(group == noone) return; createOutput(false); }
|
||||
static postApplyDeserialize = function() {}
|
||||
|
||||
|
|
|
@ -94,9 +94,9 @@ void main(in VertexShaderOutput _input, out PixelShaderOutput output) {
|
|||
|
||||
input_display_list = [ 2,
|
||||
["Vertex Shader [read only]", true], new Inspector_Label(vs_string, _f_code_s),
|
||||
["Fragmanet Shader", false], preLabel, 1, new Inspector_Label(fs_postString, _f_code_s),
|
||||
["Arguments", false], argument_renderer,
|
||||
["Values", true],
|
||||
["Fragment Shader", false], preLabel, 1, new Inspector_Label(fs_postString, _f_code_s),
|
||||
["Arguments", false], argument_renderer,
|
||||
["Values", true],
|
||||
];
|
||||
|
||||
setDynamicInput(3, false);
|
||||
|
|
|
@ -21,15 +21,21 @@ function Node_Iterator_Each_Input(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
arr[@ 1] = group.inputs[0];
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
if(group == noone) return;
|
||||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
static getPreviewValues = function() {
|
||||
if(group == noone) return noone;
|
||||
|
||||
if(outputs[0].setType(group.inputs[0].type))
|
||||
will_setHeight = true;
|
||||
switch(group.inputs[0].type) {
|
||||
case VALUE_TYPE.surface :
|
||||
case VALUE_TYPE.dynaSurface :
|
||||
break;
|
||||
default :
|
||||
return noone;
|
||||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
}
|
||||
|
||||
static getPreviewValues = function() { #region
|
||||
static getGraphPreviewSurface = function() {
|
||||
if(group == noone) return noone;
|
||||
|
||||
switch(group.inputs[0].type) {
|
||||
|
@ -41,23 +47,9 @@ function Node_Iterator_Each_Input(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static getGraphPreviewSurface = function() { #region
|
||||
if(group == noone) return noone;
|
||||
|
||||
switch(group.inputs[0].type) {
|
||||
case VALUE_TYPE.surface :
|
||||
case VALUE_TYPE.dynaSurface :
|
||||
break;
|
||||
default :
|
||||
return noone;
|
||||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
|
||||
static onLoadGroup = function() { #region
|
||||
static onLoadGroup = function() {
|
||||
if(group == noone) destroy();
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -11,24 +11,21 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
newOutput(0, nodeValue_Output("Preview", self, VALUE_TYPE.any, 0 ))
|
||||
.setVisible(false, false);
|
||||
|
||||
static getNextNodes = function() { #region
|
||||
static getNextNodes = function() {
|
||||
if(!struct_has(group, "outputNextNode")) return [];
|
||||
return group.outputNextNode();
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static step = function() { #region
|
||||
static step = function() {
|
||||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
|
||||
var type = inputs[0].value_from == noone? VALUE_TYPE.any : inputs[0].value_from.type;
|
||||
|
||||
inputs[0].setType(type);
|
||||
group.outputs[0].setType(type);
|
||||
}
|
||||
|
||||
if(outputs[0].setType(type))
|
||||
will_setHeight = true;
|
||||
} #endregion
|
||||
|
||||
static cloneValue = function(_prev_val, _val) { #region
|
||||
static cloneValue = function(_prev_val, _val) {
|
||||
if(inputs[0].value_from == noone) return _prev_val;
|
||||
|
||||
var is_surf = inputs[0].value_from.type == VALUE_TYPE.surface;
|
||||
|
@ -41,9 +38,9 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
else _new_val = array_clone(_val);
|
||||
|
||||
return _new_val;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
if(inputs[0].value_from == noone) {
|
||||
group.iterationUpdate();
|
||||
return;
|
||||
|
@ -61,9 +58,9 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
outputs[0].setValue(_val);
|
||||
group.outputs[0].setValue(_val);
|
||||
group.iterationUpdate();
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onLoadGroup = function() { #region
|
||||
static onLoadGroup = function() {
|
||||
if(group == noone) destroy();
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ function Node_Iterator_Filter_Input(_x, _y, _group = noone) : Node(_x, _y, _grou
|
|||
|
||||
newOutput(0, nodeValue_Output("Value in", self, VALUE_TYPE.any, 0 ));
|
||||
outputs[0].getValueDefault = method(outputs[0], outputs[0].getValueRecursive); //Get value from outside loop
|
||||
outputs[0].getValueRecursive = function(arr) { #region
|
||||
outputs[0].getValueRecursive = function(arr) {
|
||||
if(!variable_struct_exists(group, "iterated"))
|
||||
return outputs[0].getValueDefault(arr);
|
||||
|
||||
|
@ -16,17 +16,14 @@ function Node_Iterator_Filter_Input(_x, _y, _group = noone) : Node(_x, _y, _grou
|
|||
|
||||
arr[@ 0] = array_safe_get_fast(val, ind)
|
||||
arr[@ 1] = group.inputs[0];
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static step = function() { #region
|
||||
static step = function() {
|
||||
if(group == noone) return noone;
|
||||
if(!variable_struct_exists(group, "iterated")) return;
|
||||
}
|
||||
|
||||
if(outputs[0].setType(group.inputs[0].type))
|
||||
will_setHeight = true;
|
||||
} #endregion
|
||||
|
||||
static getPreviewValues = function() { #region
|
||||
static getPreviewValues = function() {
|
||||
if(group == noone) return noone;
|
||||
|
||||
switch(group.inputs[0].type) {
|
||||
|
@ -38,9 +35,9 @@ function Node_Iterator_Filter_Input(_x, _y, _group = noone) : Node(_x, _y, _grou
|
|||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static getGraphPreviewSurface = function() { #region
|
||||
static getGraphPreviewSurface = function() {
|
||||
if(group == noone) return noone;
|
||||
|
||||
switch(group.inputs[0].type) {
|
||||
|
@ -52,6 +49,6 @@ function Node_Iterator_Filter_Input(_x, _y, _group = noone) : Node(_x, _y, _grou
|
|||
}
|
||||
|
||||
return group.getInputData(0);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
}
|
|
@ -84,8 +84,6 @@ function Node_Logic(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
auto_input = true;
|
||||
return;
|
||||
}
|
||||
|
||||
will_setHeight = true;
|
||||
}
|
||||
|
||||
static _eval = function(mode, a, b) {
|
||||
|
@ -102,18 +100,18 @@ function Node_Logic(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
|
||||
function evalLogicArray(mode, a, b = false) {
|
||||
var as = is_array(a);
|
||||
var bs = is_array(b);
|
||||
var _as = is_array(a);
|
||||
var _bs = is_array(b);
|
||||
|
||||
if(!as && !bs)
|
||||
if(!_as && !_bs)
|
||||
return _eval(mode, a, b);
|
||||
|
||||
var al = as? array_length(a) : 0;
|
||||
var bl = bs? array_length(b) : 0;
|
||||
var al = _as? array_length(a) : 0;
|
||||
var bl = _bs? array_length(b) : 0;
|
||||
|
||||
var val = [];
|
||||
if(!as) a = [ a ];
|
||||
if(!bs) b = [ b ];
|
||||
if(!_as) a = [ a ];
|
||||
if(!_bs) b = [ b ];
|
||||
|
||||
for( var i = 0; i < max(al, bl, cl); i++ )
|
||||
val[i] = evalLogicArray(mode,
|
||||
|
|
|
@ -116,7 +116,43 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
function evalArray(a, b, c = 0) {
|
||||
var _as = is_array(a);
|
||||
var _bs = is_array(b);
|
||||
var _cs = is_array(c);
|
||||
|
||||
if(!_as && !_bs && !_cs)
|
||||
return _eval(a, b, c);
|
||||
|
||||
if(!_as) a = [ a ];
|
||||
if(!_bs) b = [ b ];
|
||||
if(!_cs) c = [ c ];
|
||||
|
||||
var al = array_length(a);
|
||||
var bl = array_length(b);
|
||||
var cl = array_length(c);
|
||||
|
||||
var amo = max(al, bl, cl);
|
||||
var val = array_create(amo);
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
val[i] = evalArray(
|
||||
array_safe_get(a, i,, ARRAY_OVERFLOW.loop),
|
||||
array_safe_get(b, i,, ARRAY_OVERFLOW.loop),
|
||||
array_safe_get(c, i,, ARRAY_OVERFLOW.loop),
|
||||
);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
use_mod = getInputData(0);
|
||||
use_deg = getInputData(3);
|
||||
|
||||
var a = getInputData(1);
|
||||
var b = getInputData(2);
|
||||
var c = getInputData(5);
|
||||
|
||||
var mode = getInputData(0);
|
||||
|
||||
inputs[2].setVisible(false, false);
|
||||
|
@ -193,44 +229,6 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
|
||||
function evalArray(a, b, c = 0) {
|
||||
var _as = is_array(a);
|
||||
var _bs = is_array(b);
|
||||
var _cs = is_array(c);
|
||||
|
||||
if(!_as && !_bs && !_cs)
|
||||
return _eval(a, b, c);
|
||||
|
||||
if(!_as) a = [ a ];
|
||||
if(!_bs) b = [ b ];
|
||||
if(!_cs) c = [ c ];
|
||||
|
||||
var al = array_length(a);
|
||||
var bl = array_length(b);
|
||||
var cl = array_length(c);
|
||||
|
||||
var amo = max(al, bl, cl);
|
||||
var val = array_create(amo);
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
val[i] = evalArray(
|
||||
array_safe_get(a, i,, ARRAY_OVERFLOW.loop),
|
||||
array_safe_get(b, i,, ARRAY_OVERFLOW.loop),
|
||||
array_safe_get(c, i,, ARRAY_OVERFLOW.loop),
|
||||
);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
use_mod = getInputData(0);
|
||||
use_deg = getInputData(3);
|
||||
|
||||
var a = getInputData(1);
|
||||
var b = getInputData(2);
|
||||
var c = getInputData(5);
|
||||
|
||||
var val = evalArray(a, b, c);
|
||||
outputs[0].setValue(val);
|
||||
|
|
|
@ -41,24 +41,21 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
inputs[0].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
static setType = function() {
|
||||
var int = getInputData(1);
|
||||
var disp = getInputData(2);
|
||||
var _ch = con_h;
|
||||
|
||||
if(!show_parameter) setDimension(96, 56, false);
|
||||
var _ww = 96, _hh = 56;
|
||||
|
||||
switch(disp) {
|
||||
case 0 :
|
||||
min_h = 0;
|
||||
inputs[3].setVisible(false);
|
||||
inputs[4].setVisible(false);
|
||||
inputs[5].setVisible(false);
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
if(inputs[0].value_from == noone && !show_parameter) setDimension(160, 96, false);
|
||||
min_h = con_h;
|
||||
_ww = 160; _hh = 96;
|
||||
|
||||
inputs[3].setVisible(true);
|
||||
inputs[4].setVisible(true);
|
||||
|
@ -66,8 +63,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
break;
|
||||
|
||||
case 2 :
|
||||
if(inputs[0].value_from == noone && !show_parameter) setDimension(128, 128, false);
|
||||
min_h = con_h;
|
||||
_ww = 128; _hh = 128;
|
||||
|
||||
inputs[3].setVisible(false);
|
||||
inputs[4].setVisible(false);
|
||||
|
@ -75,7 +71,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
break;
|
||||
}
|
||||
|
||||
if(_ch != con_h) will_setHeight = true;
|
||||
setDimension(_ww, _hh);
|
||||
|
||||
for( var i = 0; i < 1; i++ )
|
||||
inputs[i].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float);
|
||||
|
@ -95,12 +91,12 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
|
||||
static update = function() {
|
||||
setType();
|
||||
|
||||
var _dat = getInputData(0);
|
||||
outputs[0].setValue(_dat);
|
||||
|
||||
|
||||
var _int = getInputData(1);
|
||||
|
||||
var _res = processNumber(_dat, _int);
|
||||
outputs[0].setValue(_res);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,10 @@ function Node_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
["Trim", true], 1
|
||||
];
|
||||
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var pal = _data[0];
|
||||
var ran = _data[1];
|
||||
|
@ -35,7 +39,6 @@ function Node_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
if(array_empty(pal)) return;
|
||||
if(!is_array(pal[0])) pal = [ pal ];
|
||||
|
||||
var _h = array_length(pal) * 32;
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(pal);
|
||||
|
||||
|
@ -43,8 +46,5 @@ function Node_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
drawPalette(pal[i], bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Palette Extract";
|
||||
setDimension(96, 48);;
|
||||
setDimension(96, 48);
|
||||
|
||||
newInput(0, nodeValue_Surface("Surface in", self));
|
||||
|
||||
|
@ -35,6 +35,10 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
|||
|
||||
attribute_surface_depth();
|
||||
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
function sortPalette(pal) {
|
||||
array_sort(pal, function(c0, c1) {
|
||||
var r0 = _color_get_red(c0);
|
||||
|
@ -312,7 +316,6 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
|||
if(array_empty(pal)) return;
|
||||
if(!is_array(pal[0])) pal = [ pal ];
|
||||
|
||||
var _h = array_length(pal) * 32;
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(pal);
|
||||
|
||||
|
@ -320,8 +323,5 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
|||
drawPalette(pal[i], bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
}
|
||||
}
|
|
@ -19,7 +19,11 @@ function Node_Palette_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
|||
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.color, [ ] ))
|
||||
.setDisplay(VALUE_DISPLAY.palette);
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var pal = _data[0];
|
||||
var pfr = _data[1];
|
||||
var pto = _data[2];
|
||||
|
@ -45,9 +49,9 @@ function Node_Palette_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
|||
}
|
||||
|
||||
return palo;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
|
@ -55,7 +59,6 @@ function Node_Palette_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
|||
if(array_empty(pal)) return;
|
||||
if(!is_array(pal[0])) pal = [ pal ];
|
||||
|
||||
var _h = array_length(pal) * 32;
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(pal);
|
||||
|
||||
|
@ -63,8 +66,5 @@ function Node_Palette_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
|||
drawPalette(pal[i], bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -21,6 +21,10 @@ function Node_Palette_Shrink(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
0, 4, 1, 2,
|
||||
];
|
||||
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
function kmean(_pal) {
|
||||
_size = max(1, getInputData(2));
|
||||
_space = getInputData(4);
|
||||
|
@ -187,7 +191,6 @@ function Node_Palette_Shrink(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
if(array_empty(pal)) return;
|
||||
if(!is_array(pal[0])) pal = [ pal ];
|
||||
|
||||
var _h = array_length(pal) * 32;
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(pal);
|
||||
|
||||
|
@ -195,8 +198,5 @@ function Node_Palette_Shrink(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
|
|||
drawPalette(pal[i], bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
}
|
||||
}
|
|
@ -23,14 +23,18 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
0, 1, 3, 2,
|
||||
]
|
||||
|
||||
static step = function() { #region
|
||||
static step = function() {
|
||||
var _typ = getInputData(1);
|
||||
|
||||
inputs[3].setVisible(_typ == 10);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static processData_prebatch = function() {
|
||||
setDimension(96, process_length[0] * 32);
|
||||
}
|
||||
|
||||
sort_string = "";
|
||||
static customSort = function(c) { #region
|
||||
static customSort = function(c) {
|
||||
var len = string_length(sort_string);
|
||||
var val = power(256, len - 1);
|
||||
var res = 0;
|
||||
|
@ -55,9 +59,9 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
}
|
||||
|
||||
return res;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _arr = _data[0];
|
||||
var _ord = _data[1];
|
||||
var _rev = _data[2];
|
||||
|
@ -83,9 +87,9 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
if(_rev) _pal = array_reverse(_pal);
|
||||
|
||||
return _pal;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
if(bbox.h < 1) return;
|
||||
|
||||
|
@ -93,7 +97,6 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
if(array_empty(pal)) return;
|
||||
if(!is_array(pal[0])) pal = [ pal ];
|
||||
|
||||
var _h = array_length(pal) * 32;
|
||||
var _y = bbox.y0;
|
||||
var gh = bbox.h / array_length(pal);
|
||||
|
||||
|
@ -101,8 +104,5 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
drawPalette(pal[i], bbox.x0, _y, bbox.w, gh);
|
||||
_y += gh;
|
||||
}
|
||||
|
||||
if(_h != min_h) will_setHeight = true;
|
||||
min_h = _h;
|
||||
} #endregion
|
||||
}
|
||||
}
|
|
@ -52,21 +52,20 @@ function Node_Tunnel_Out(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
static step = function() {
|
||||
var _key = inputs[0].getValue();
|
||||
project.tunnels_out[? node_id] = _key;
|
||||
|
||||
if(ds_map_exists(project.tunnels_in, _key)) {
|
||||
outputs[0].setType(project.tunnels_in[? _key].type);
|
||||
outputs[0].display_type = project.tunnels_in[? _key].display_type;
|
||||
} else {
|
||||
outputs[0].setType(VALUE_TYPE.any);
|
||||
outputs[0].display_type = VALUE_DISPLAY._default;
|
||||
}
|
||||
}
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
var _key = inputs[0].getValue();
|
||||
|
||||
if(ds_map_exists(project.tunnels_in, _key))
|
||||
if(ds_map_exists(project.tunnels_in, _key)) {
|
||||
outputs[0].setType(project.tunnels_in[? _key].type);
|
||||
outputs[0].display_type = project.tunnels_in[? _key].display_type;
|
||||
outputs[0].setValue(project.tunnels_in[? _key].getValue());
|
||||
} else {
|
||||
outputs[0].setType(VALUE_TYPE.any);
|
||||
outputs[0].display_type = VALUE_DISPLAY._default;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -22,8 +22,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
node = _node;
|
||||
x = node.x;
|
||||
y = node.y;
|
||||
rx = x;
|
||||
ry = y;
|
||||
tags = VALUE_TAG.none;
|
||||
|
||||
index = array_length(node.inputs);
|
||||
|
@ -31,8 +29,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
forward = true;
|
||||
_initName = _name;
|
||||
|
||||
node.will_setHeight = true;
|
||||
|
||||
static updateName = function(_name) {
|
||||
name = _name;
|
||||
internalName = string_to_var(name);
|
||||
|
@ -515,10 +511,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
if(connect_type == CONNECT_TYPE.input) {
|
||||
show_in_inspector = inspector;
|
||||
visible = argument_count > 1? argument[1] : visible;
|
||||
|
||||
} else
|
||||
visible = inspector;
|
||||
|
||||
node.will_setHeight |= visible != v;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -526,8 +522,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
visible = _vis;
|
||||
show_in_inspector = _vis;
|
||||
visible_manual = 0;
|
||||
|
||||
node.will_setHeight = true;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -2384,6 +2378,89 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
/////========== FUNCTIONS ==========
|
||||
|
||||
function checkJuncConnection(from, to, params) {
|
||||
#region parameters
|
||||
var _s = params.s;
|
||||
var mx = params.mx;
|
||||
var my = params.my;
|
||||
var _active = params.active;
|
||||
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, miny = params.miny;
|
||||
var maxx = params.maxx, maxy = params.maxy;
|
||||
|
||||
if((jx < minx && frx < minx) || (jx > maxx && frx > maxx) || (jy < miny && fry < miny) || (jy > maxy && fry > 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);
|
||||
to.draw_line_shift_hover = false;
|
||||
|
||||
var downDirection = to.type == VALUE_TYPE.action || from.type == VALUE_TYPE.action;
|
||||
#endregion
|
||||
|
||||
var _drawParam = {
|
||||
extend : PREFERENCES.connection_line_extend,
|
||||
fromIndex : fromIndex,
|
||||
toIndex : toIndex,
|
||||
}
|
||||
var hovDist = max(th * 2, 6);
|
||||
var hover = false;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
if(downDirection) _hdist = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s);
|
||||
else _hdist = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s);
|
||||
break;
|
||||
|
||||
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);
|
||||
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);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
hover = _hdist < hovDist;
|
||||
if(PANEL_GRAPH.value_focus == noone) to.draw_line_shift_hover = hover;
|
||||
}
|
||||
}
|
||||
|
||||
if(_active && hover) hovering = self;
|
||||
|
||||
return hovering;
|
||||
}
|
||||
|
||||
function drawJuncConnection(from, to, params) {
|
||||
#region parameters
|
||||
var log = params.log;
|
||||
|
@ -2391,8 +2468,6 @@ function drawJuncConnection(from, to, params) {
|
|||
var bg = params.bg;
|
||||
var aa = params.aa;
|
||||
|
||||
var _x = params.x;
|
||||
var _y = params.y;
|
||||
var _s = params.s;
|
||||
var mx = params.mx;
|
||||
var my = params.my;
|
||||
|
@ -2402,11 +2477,11 @@ function drawJuncConnection(from, to, params) {
|
|||
|
||||
var hovering = noone;
|
||||
|
||||
var jx = to.x;
|
||||
var jy = to.y;
|
||||
var jx = to.x, jy = to.y;
|
||||
var frx = from.x, fry = from.y;
|
||||
|
||||
var frx = from.x;
|
||||
var fry = from.y;
|
||||
var fromIndex = from.drawLineIndex;
|
||||
var toIndex = to.drawLineIndex;
|
||||
|
||||
var _loop = struct_try_get(params, "loop");
|
||||
|
||||
|
@ -2439,6 +2514,8 @@ function drawJuncConnection(from, to, params) {
|
|||
#region +++++ CHECK HOVER +++++
|
||||
var _drawParam = {
|
||||
extend : PREFERENCES.connection_line_extend,
|
||||
fromIndex : fromIndex,
|
||||
toIndex : toIndex,
|
||||
}
|
||||
var hovDist = max(th * 2, 6);
|
||||
|
||||
|
|
|
@ -623,8 +623,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
__temp_show = false;
|
||||
array_foreach(nodes_selecting, function(node, index) {
|
||||
if(index == 0) __temp_show = !node.show_parameter;
|
||||
node.show_parameter = __temp_show;
|
||||
node.refreshNodeDisplay();
|
||||
node.setShowParameter(__temp_show);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1199,16 +1198,22 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
|
||||
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);
|
||||
|
||||
var _focus = pFOCUS && !view_hovering;
|
||||
var gr_x = graph_x * graph_s;
|
||||
var gr_y = graph_y * graph_s;
|
||||
|
||||
display_parameter.highlight =
|
||||
!array_empty(nodes_selecting) && (
|
||||
(PREFERENCES.connection_line_highlight == 1 && key_mod_press(ALT)) ||
|
||||
PREFERENCES.connection_line_highlight == 2
|
||||
);
|
||||
__gr_x = gr_x;
|
||||
__gr_y = gr_y;
|
||||
__gr_s = graph_s;
|
||||
__gr_w = w;
|
||||
__gr_h = h;
|
||||
|
||||
var gr_x = graph_x * graph_s;
|
||||
var gr_y = graph_y * graph_s;
|
||||
__mx = mx;
|
||||
__my = my;
|
||||
|
||||
__self = self;
|
||||
|
||||
var log = false;
|
||||
var t = get_timer();
|
||||
|
@ -1217,282 +1222,260 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
_frame_hovering = frame_hovering;
|
||||
frame_hovering = noone;
|
||||
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
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) /*=>*/ {
|
||||
_n.preDraw(__gr_x, __gr_y, __gr_s, __gr_x, __gr_y);
|
||||
return _n.cullCheck(__gr_x, __gr_y, __gr_s, -32, -32, __gr_w + 32, __gr_h + 64);
|
||||
});
|
||||
|
||||
_node.cullCheck(gr_x, gr_y, graph_s, -32, -32, w + 32, h + 64);
|
||||
_node.preDraw(gr_x, gr_y, graph_s, gr_x, gr_y);
|
||||
}
|
||||
printIf(log, $"Predraw time: {get_timer() - t}"); t = get_timer();
|
||||
|
||||
// draw frame
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
|
||||
if(_node.drawNodeBG(gr_x, gr_y, mx, my, graph_s, display_parameter, self))
|
||||
frame_hovering = _node;
|
||||
}
|
||||
|
||||
array_foreach(_node_draw, function(_n) /*=>*/ { if(_n.drawNodeBG(__gr_x, __gr_y, __mx, __my, __gr_s, display_parameter, __self)) frame_hovering = _n; });
|
||||
printIf(log, $"Frame draw time: {get_timer() - t}"); t = get_timer();
|
||||
|
||||
// hover
|
||||
node_hovering = noone;
|
||||
if(pHOVER)
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
node_hovering = noone;
|
||||
if(pHOVER) array_foreach(_node_draw, function(_n) /*=>*/ {
|
||||
_n.branch_drawing = false;
|
||||
if(_n.pointIn(__gr_x, __gr_y, __mx, __my, __gr_s))
|
||||
node_hovering = _n;
|
||||
});
|
||||
|
||||
_node.branch_drawing = false;
|
||||
if(node_hovering != noone) {
|
||||
_HOVERING_ELEMENT = node_hovering;
|
||||
|
||||
if(_node.pointIn(gr_x, gr_y, mx, my, graph_s))
|
||||
node_hovering = _node;
|
||||
if(_focus && DOUBLE_CLICK && node_hovering.onDoubleClick != -1 && node_hovering.onDoubleClick(self)) {
|
||||
DOUBLE_CLICK = false;
|
||||
node_hovering = noone;
|
||||
}
|
||||
}
|
||||
|
||||
if(node_hovering != noone)
|
||||
_HOVERING_ELEMENT = node_hovering;
|
||||
|
||||
if(DOUBLE_CLICK) {
|
||||
// print($"Double click {node_hovering} || {_focus} || {instanceof(node_hovering)}");
|
||||
|
||||
if(node_hovering != noone && _focus && node_hovering.onDoubleClick != -1)
|
||||
if(node_hovering.onDoubleClick(self)) {
|
||||
DOUBLE_CLICK = false;
|
||||
node_hovering = noone;
|
||||
}
|
||||
}
|
||||
|
||||
if(node_hovering) node_hovering.onDrawHover(gr_x, gr_y, mx, my, graph_s);
|
||||
if(node_hovering) node_hovering.onDrawHover(gr_x, gr_y, mx, my, graph_s);
|
||||
|
||||
printIf(log, $"Hover time: {get_timer() - t}"); t = get_timer();
|
||||
|
||||
// ++++++++++++ interaction ++++++++++++
|
||||
if(mouse_on_graph && pHOVER) {
|
||||
if(node_dragging == noone && value_dragging == noone) {
|
||||
if(value_focus)
|
||||
addKeyOverlay("Select junction(s)", [[ "Shift", "Peek content" ]]);
|
||||
else if(node_hovering)
|
||||
addKeyOverlay("Select node(s)", [[ "Shift", "Toggle selection" ]]);
|
||||
}
|
||||
if(mouse_on_graph && pHOVER) {
|
||||
if(node_dragging == noone && value_dragging == noone) {
|
||||
if(value_focus)
|
||||
addKeyOverlay("Select junction(s)", [[ "Shift", "Peek content" ]]);
|
||||
else if(node_hovering)
|
||||
addKeyOverlay("Select node(s)", [[ "Shift", "Toggle selection" ]]);
|
||||
}
|
||||
|
||||
// select
|
||||
var _anc = nodes_select_anchor;
|
||||
if(mouse_press(mb_left, _focus)) _anc = noone;
|
||||
// select
|
||||
var _anc = nodes_select_anchor;
|
||||
if(mouse_press(mb_left, _focus)) _anc = noone;
|
||||
|
||||
if(NODE_DROPPER_TARGET != noone && node_hovering) {
|
||||
node_hovering.draw_droppable = true;
|
||||
if(mouse_press(mb_left, NODE_DROPPER_TARGET_CAN)) {
|
||||
NODE_DROPPER_TARGET.expression += node_hovering.internalName;
|
||||
NODE_DROPPER_TARGET.expressionUpdate();
|
||||
}
|
||||
} else if(mouse_press(mb_left, _focus)) {
|
||||
if(NODE_DROPPER_TARGET != noone && node_hovering) {
|
||||
node_hovering.draw_droppable = true;
|
||||
if(mouse_press(mb_left, NODE_DROPPER_TARGET_CAN)) {
|
||||
NODE_DROPPER_TARGET.expression += node_hovering.internalName;
|
||||
NODE_DROPPER_TARGET.expressionUpdate();
|
||||
}
|
||||
} else if(mouse_press(mb_left, _focus)) {
|
||||
|
||||
if(key_mod_press(SHIFT)) {
|
||||
if(node_hovering) {
|
||||
if(array_exists(nodes_selecting, node_hovering))
|
||||
array_remove(nodes_selecting, node_hovering);
|
||||
else
|
||||
array_push(nodes_selecting, node_hovering);
|
||||
} else
|
||||
nodes_selecting = [];
|
||||
|
||||
} else if(value_focus || node_hovering == noone) {
|
||||
if(key_mod_press(SHIFT)) {
|
||||
if(node_hovering) {
|
||||
if(array_exists(nodes_selecting, node_hovering))
|
||||
array_remove(nodes_selecting, node_hovering);
|
||||
else
|
||||
array_push(nodes_selecting, node_hovering);
|
||||
} else
|
||||
nodes_selecting = [];
|
||||
|
||||
if(DOUBLE_CLICK && !PANEL_INSPECTOR.locked)
|
||||
PANEL_INSPECTOR.inspecting = noone;
|
||||
} else if(value_focus || node_hovering == noone) {
|
||||
nodes_selecting = [];
|
||||
|
||||
if(DOUBLE_CLICK && !PANEL_INSPECTOR.locked)
|
||||
PANEL_INSPECTOR.inspecting = noone;
|
||||
|
||||
} else {
|
||||
if(is_instanceof(node_hovering, Node_Frame)) {
|
||||
addKeyOverlay("Frames selection", [[ "Ctrl", "Exclude contents" ]]);
|
||||
|
||||
var fx0 = (node_hovering.x + graph_x) * graph_s;
|
||||
var fy0 = (node_hovering.y + graph_y) * graph_s;
|
||||
var fx1 = fx0 + node_hovering.w * graph_s;
|
||||
var fy1 = fy0 + node_hovering.h * graph_s;
|
||||
|
||||
nodes_selecting = [ node_hovering ];
|
||||
|
||||
if(!key_mod_press(CTRL))
|
||||
for(var i = 0; i < array_length(nodes_list); i++) { //select content
|
||||
var _node = nodes_list[i];
|
||||
if(_node == node_hovering) continue;
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
|
||||
if(!_node.selectable) continue;
|
||||
|
||||
var _x = (_node.x + graph_x) * graph_s;
|
||||
var _y = (_node.y + graph_y) * graph_s;
|
||||
var _w = _node.w * graph_s;
|
||||
var _h = _node.h * graph_s;
|
||||
|
||||
if(_w && _h && rectangle_inside_rectangle(fx0, fy0, fx1, fy1, _x, _y, _x + _w, _y + _h))
|
||||
array_push_unique(nodes_selecting, _node);
|
||||
}
|
||||
|
||||
} else if(DOUBLE_CLICK) {
|
||||
PANEL_PREVIEW.setNodePreview(node_hovering);
|
||||
|
||||
if(PREFERENCES.inspector_focus_on_double_click) {
|
||||
if(PANEL_INSPECTOR.panel && struct_has(PANEL_INSPECTOR.panel, "switchContent"))
|
||||
PANEL_INSPECTOR.panel.switchContent(PANEL_INSPECTOR);
|
||||
}
|
||||
|
||||
} else {
|
||||
if(is_instanceof(node_hovering, Node_Frame)) {
|
||||
addKeyOverlay("Frames selection", [[ "Ctrl", "Exclude contents" ]]);
|
||||
var hover_selected = false;
|
||||
for( var i = 0; i < array_length(nodes_selecting); i++ ) {
|
||||
if(nodes_selecting[i] != node_hovering) continue;
|
||||
|
||||
var fx0 = (node_hovering.x + graph_x) * graph_s;
|
||||
var fy0 = (node_hovering.y + graph_y) * graph_s;
|
||||
var fx1 = fx0 + node_hovering.w * graph_s;
|
||||
var fy1 = fy0 + node_hovering.h * graph_s;
|
||||
hover_selected = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!hover_selected)
|
||||
nodes_selecting = [ node_hovering ];
|
||||
|
||||
if(!key_mod_press(CTRL))
|
||||
for(var i = 0; i < array_length(nodes_list); i++) { //select content
|
||||
var _node = nodes_list[i];
|
||||
if(_node == node_hovering) continue;
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
|
||||
if(!_node.selectable) continue;
|
||||
|
||||
var _x = (_node.x + graph_x) * graph_s;
|
||||
var _y = (_node.y + graph_y) * graph_s;
|
||||
var _w = _node.w * graph_s;
|
||||
var _h = _node.h * graph_s;
|
||||
|
||||
if(_w && _h && rectangle_inside_rectangle(fx0, fy0, fx1, fy1, _x, _y, _x + _w, _y + _h))
|
||||
array_push_unique(nodes_selecting, _node);
|
||||
}
|
||||
|
||||
} else if(DOUBLE_CLICK) {
|
||||
PANEL_PREVIEW.setNodePreview(node_hovering);
|
||||
|
||||
if(PREFERENCES.inspector_focus_on_double_click) {
|
||||
if(PANEL_INSPECTOR.panel && struct_has(PANEL_INSPECTOR.panel, "switchContent"))
|
||||
PANEL_INSPECTOR.panel.switchContent(PANEL_INSPECTOR);
|
||||
}
|
||||
|
||||
} else {
|
||||
var hover_selected = false;
|
||||
for( var i = 0; i < array_length(nodes_selecting); i++ ) {
|
||||
if(nodes_selecting[i] != node_hovering) continue;
|
||||
|
||||
hover_selected = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!hover_selected)
|
||||
nodes_selecting = [ node_hovering ];
|
||||
|
||||
if(array_length(nodes_selecting) > 1)
|
||||
_anc = nodes_select_anchor == node_hovering? noone : node_hovering;
|
||||
}
|
||||
|
||||
if(WIDGET_CURRENT) WIDGET_CURRENT.deactivate();
|
||||
array_foreach(nodes_selecting, function(node) { bringNodeToFront(node); });
|
||||
}
|
||||
}
|
||||
|
||||
nodes_select_anchor = _anc;
|
||||
|
||||
|
||||
if(mouse_press(mb_right, _focus)) { //
|
||||
node_hover = node_hovering;
|
||||
__junction_hovering = noone;
|
||||
|
||||
if(value_focus) {
|
||||
// print($"Right click value focus {value_focus}");
|
||||
|
||||
__junction_hovering = value_focus;
|
||||
|
||||
var menu = [ menu_junc_color ];
|
||||
|
||||
if(value_focus.connect_type == CONNECT_TYPE.output) {
|
||||
var sep = false;
|
||||
|
||||
for( var i = 0, n = array_length(value_focus.value_to); i < n; i++ ) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _to = value_focus.value_to[i];
|
||||
var _lb = $"[{_to.node.display_name}] {_to.getName()}";
|
||||
array_push(menu, menuItem(_lb, function(data) /*=>*/ { data.juncTo.removeFrom(); }, THEME.cross, noone, noone, { juncTo: _to }));
|
||||
}
|
||||
|
||||
for( var i = 0, n = array_length(value_focus.value_to_loop); i < n; i++ ) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _to = value_focus.value_to_loop[i];
|
||||
var _lb = $"[{_to.junc_in.node.display_name}] {_to.junc_in.getName()}";
|
||||
array_push(menu, menuItem(_lb, function(data) /*=>*/ { data.juncTo.destroy(); }, _to.icon_24, noone, noone, { juncTo: _to }));
|
||||
}
|
||||
} else {
|
||||
var sep = false;
|
||||
|
||||
if(value_focus.value_from) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _jun = value_focus.value_from;
|
||||
var _lb = $"[{_jun.node.display_name}] {_jun.getName()}";
|
||||
array_push(menu, menuItem(_lb, function() /*=>*/ { __junction_hovering.removeFrom(); }, THEME.cross));
|
||||
}
|
||||
|
||||
if(value_focus.value_from_loop) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _jun = value_focus.value_from_loop.junc_out;
|
||||
var _lb = $"[{_jun.node.display_name}] {_jun.getName()}";
|
||||
array_push(menu, menuItem(_lb, function() /*=>*/ { __junction_hovering.removeFromLoop(); }, value_focus.value_from_loop.icon_24));
|
||||
}
|
||||
if(array_length(nodes_selecting) > 1)
|
||||
_anc = nodes_select_anchor == node_hovering? noone : node_hovering;
|
||||
}
|
||||
|
||||
menuCall("graph_node_selected_menu", menu);
|
||||
|
||||
} else if(node_hover && node_hover.draggable) {
|
||||
// print($"Right click node hover {node_hover}");
|
||||
|
||||
var menu = [];
|
||||
array_push(menu, menu_node_color, -1, menu_sent_to_preview, menu_send_to_window, menu_sent_to_inspector);
|
||||
if(!DEMO)
|
||||
array_push(menu, menu_send_export);
|
||||
array_push(menu, -1, menu_toggle_preview, menu_toggle_render, menu_toggle_param, menu_hide_disconnect);
|
||||
|
||||
if(is_instanceof(node_hover, Node_Collection))
|
||||
array_push(menu, -1, menu_open_group, menu_open_group_tab, menu_group_ungroup);
|
||||
|
||||
if(node_hover.group != noone)
|
||||
array_push(menu, menu_group_tool);
|
||||
if(array_length(nodes_selecting) >= 2)
|
||||
array_push(menu, -1, menu_nodes_group, menu_nodes_frame);
|
||||
|
||||
array_push(menu, -1, menu_node_delete_merge, menu_node_delete_cut, menu_node_duplicate, menu_node_copy);
|
||||
if(array_empty(nodes_selecting)) array_push(menu, menu_node_copy_prop, menu_node_paste_prop);
|
||||
|
||||
array_push(menu, -1, menu_node_transform, menu_node_canvas);
|
||||
|
||||
if(array_length(nodes_selecting) >= 2)
|
||||
array_push(menu, -1, menu_nodes_align, menu_nodes_blend, menu_nodes_compose, menu_nodes_array);
|
||||
|
||||
menuCall("graph_node_selected_multiple_menu", menu );
|
||||
|
||||
} else if(node_hover == noone) {
|
||||
// print($"Right click not node hover");
|
||||
|
||||
var menu = [];
|
||||
|
||||
__junction_hovering = junction_hovering;
|
||||
if(junction_hovering != noone)
|
||||
array_push(menu, menu_junc_color, menu_connection_tunnel, -1);
|
||||
|
||||
array_push(menu, MENU_ITEMS.graph_copy.setActive(array_length(nodes_selecting)));
|
||||
array_push(menu, MENU_ITEMS.graph_paste.setActive(clipboard_get_text() != ""));
|
||||
|
||||
if(junction_hovering != noone) {
|
||||
array_push(menu, -1);
|
||||
|
||||
if(is_instanceof(junction_hovering, Node_Feedback_Inline)) {
|
||||
var _jun = junction_hovering.junc_out;
|
||||
array_push(menu, menuItem($"[{_jun.node.display_name}] {_jun.getName()}", function(data) /*=>*/ { __junction_hovering.destroy(); }, THEME.feedback));
|
||||
|
||||
} else {
|
||||
var _jun = junction_hovering.value_from;
|
||||
array_push(menu, menuItem($"[{_jun.node.display_name}] {_jun.getName()}", function(data) /*=>*/ { __junction_hovering.removeFrom(); }, THEME.cross));
|
||||
}
|
||||
}
|
||||
|
||||
var ctx = is_instanceof(frame_hovering, Node_Collection_Inline)? frame_hovering : getCurrentContext();
|
||||
var _diaAdd = callAddDialog(ctx);
|
||||
|
||||
var _dia = menuCall("graph_node_selected_menu", menu, o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), fa_right );
|
||||
_dia.passthrough = true;
|
||||
setFocus(_diaAdd, "Dialog");
|
||||
if(WIDGET_CURRENT) WIDGET_CURRENT.deactivate();
|
||||
array_foreach(nodes_selecting, function(node) { bringNodeToFront(node); });
|
||||
}
|
||||
}
|
||||
|
||||
if(is_instanceof(frame_hovering, Node_Collection_Inline) && DOUBLE_CLICK && array_empty(nodes_selecting)) { //
|
||||
nodes_selecting = [ frame_hovering ];
|
||||
nodes_select_anchor = _anc;
|
||||
|
||||
if(frame_hovering.onDoubleClick != -1) frame_hovering.onDoubleClick(self)
|
||||
if(frame_hovering.previewable) PANEL_PREVIEW.setNodePreview(frame_hovering);
|
||||
|
||||
if(mouse_press(mb_right, _focus)) { //
|
||||
node_hover = node_hovering;
|
||||
__junction_hovering = noone;
|
||||
|
||||
if(value_focus) {
|
||||
// print($"Right click value focus {value_focus}");
|
||||
|
||||
__junction_hovering = value_focus;
|
||||
|
||||
var menu = [ menu_junc_color ];
|
||||
|
||||
if(value_focus.connect_type == CONNECT_TYPE.output) {
|
||||
var sep = false;
|
||||
|
||||
for( var i = 0, n = array_length(value_focus.value_to); i < n; i++ ) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _to = value_focus.value_to[i];
|
||||
var _lb = $"[{_to.node.display_name}] {_to.getName()}";
|
||||
array_push(menu, menuItem(_lb, function(data) /*=>*/ { data.juncTo.removeFrom(); }, THEME.cross, noone, noone, { juncTo: _to }));
|
||||
}
|
||||
|
||||
for( var i = 0, n = array_length(value_focus.value_to_loop); i < n; i++ ) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _to = value_focus.value_to_loop[i];
|
||||
var _lb = $"[{_to.junc_in.node.display_name}] {_to.junc_in.getName()}";
|
||||
array_push(menu, menuItem(_lb, function(data) /*=>*/ { data.juncTo.destroy(); }, _to.icon_24, noone, noone, { juncTo: _to }));
|
||||
}
|
||||
} else {
|
||||
var sep = false;
|
||||
|
||||
if(value_focus.value_from) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _jun = value_focus.value_from;
|
||||
var _lb = $"[{_jun.node.display_name}] {_jun.getName()}";
|
||||
array_push(menu, menuItem(_lb, function() /*=>*/ { __junction_hovering.removeFrom(); }, THEME.cross));
|
||||
}
|
||||
|
||||
if(value_focus.value_from_loop) {
|
||||
if(!sep) { array_push(menu, -1); sep = true; }
|
||||
|
||||
var _jun = value_focus.value_from_loop.junc_out;
|
||||
var _lb = $"[{_jun.node.display_name}] {_jun.getName()}";
|
||||
array_push(menu, menuItem(_lb, function() /*=>*/ { __junction_hovering.removeFromLoop(); }, value_focus.value_from_loop.icon_24));
|
||||
}
|
||||
}
|
||||
|
||||
menuCall("graph_node_selected_menu", menu);
|
||||
|
||||
} else if(node_hover && node_hover.draggable) {
|
||||
// print($"Right click node hover {node_hover}");
|
||||
|
||||
var menu = [];
|
||||
array_push(menu, menu_node_color, -1, menu_sent_to_preview, menu_send_to_window, menu_sent_to_inspector);
|
||||
if(!DEMO)
|
||||
array_push(menu, menu_send_export);
|
||||
array_push(menu, -1, menu_toggle_preview, menu_toggle_render, menu_toggle_param, menu_hide_disconnect);
|
||||
|
||||
if(is_instanceof(node_hover, Node_Collection))
|
||||
array_push(menu, -1, menu_open_group, menu_open_group_tab, menu_group_ungroup);
|
||||
|
||||
if(node_hover.group != noone)
|
||||
array_push(menu, menu_group_tool);
|
||||
if(array_length(nodes_selecting) >= 2)
|
||||
array_push(menu, -1, menu_nodes_group, menu_nodes_frame);
|
||||
|
||||
array_push(menu, -1, menu_node_delete_merge, menu_node_delete_cut, menu_node_duplicate, menu_node_copy);
|
||||
if(array_empty(nodes_selecting)) array_push(menu, menu_node_copy_prop, menu_node_paste_prop);
|
||||
|
||||
array_push(menu, -1, menu_node_transform, menu_node_canvas);
|
||||
|
||||
if(array_length(nodes_selecting) >= 2)
|
||||
array_push(menu, -1, menu_nodes_align, menu_nodes_blend, menu_nodes_compose, menu_nodes_array);
|
||||
|
||||
menuCall("graph_node_selected_multiple_menu", menu );
|
||||
|
||||
} else if(node_hover == noone) {
|
||||
// print($"Right click not node hover");
|
||||
|
||||
var menu = [];
|
||||
|
||||
__junction_hovering = junction_hovering;
|
||||
if(junction_hovering != noone)
|
||||
array_push(menu, menu_junc_color, menu_connection_tunnel, -1);
|
||||
|
||||
array_push(menu, MENU_ITEMS.graph_copy.setActive(array_length(nodes_selecting)));
|
||||
array_push(menu, MENU_ITEMS.graph_paste.setActive(clipboard_get_text() != ""));
|
||||
|
||||
if(junction_hovering != noone) {
|
||||
array_push(menu, -1);
|
||||
|
||||
if(is_instanceof(junction_hovering, Node_Feedback_Inline)) {
|
||||
var _jun = junction_hovering.junc_out;
|
||||
array_push(menu, menuItem($"[{_jun.node.display_name}] {_jun.getName()}", function(data) /*=>*/ { __junction_hovering.destroy(); }, THEME.feedback));
|
||||
|
||||
} else {
|
||||
var _jun = junction_hovering.value_from;
|
||||
array_push(menu, menuItem($"[{_jun.node.display_name}] {_jun.getName()}", function(data) /*=>*/ { __junction_hovering.removeFrom(); }, THEME.cross));
|
||||
}
|
||||
}
|
||||
|
||||
var ctx = is_instanceof(frame_hovering, Node_Collection_Inline)? frame_hovering : getCurrentContext();
|
||||
var _diaAdd = callAddDialog(ctx);
|
||||
|
||||
var _dia = menuCall("graph_node_selected_menu", menu, o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), fa_right );
|
||||
_dia.passthrough = true;
|
||||
setFocus(_diaAdd, "Dialog");
|
||||
}
|
||||
}
|
||||
|
||||
if(is_instanceof(frame_hovering, Node_Collection_Inline) && DOUBLE_CLICK && array_empty(nodes_selecting)) { //
|
||||
nodes_selecting = [ frame_hovering ];
|
||||
|
||||
if(frame_hovering.onDoubleClick != -1) frame_hovering.onDoubleClick(self)
|
||||
if(frame_hovering.previewable) PANEL_PREVIEW.setNodePreview(frame_hovering);
|
||||
}
|
||||
}
|
||||
|
||||
printIf(log, $"Node selection time: {get_timer() - t}"); t = get_timer();
|
||||
|
||||
// draw active
|
||||
for(var i = 0; i < array_length(nodes_selecting); i++) {
|
||||
var _node = nodes_selecting[i];
|
||||
if(!_node) continue;
|
||||
_node.drawActive(gr_x, gr_y, graph_s);
|
||||
}
|
||||
|
||||
if(nodes_select_anchor) nodes_select_anchor.active_draw_anchor = true;
|
||||
array_foreach(nodes_selecting, function(_n) /*=>*/ { _n.drawActive(__gr_x, __gr_y, __gr_s); });
|
||||
if(nodes_select_anchor) nodes_select_anchor.active_draw_anchor = true;
|
||||
|
||||
printIf(log, $"Draw active: {get_timer() - t}"); t = get_timer();
|
||||
|
||||
|
@ -1502,62 +1485,65 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
connection_surface = surface_verify(connection_surface, w * aa, h * aa);
|
||||
connection_surface_aa = surface_verify(connection_surface_aa, w, h);
|
||||
surface_set_target(connection_surface);
|
||||
DRAW_CLEAR
|
||||
DRAW_CLEAR
|
||||
|
||||
var hov = noone;
|
||||
var hoverable = !bool(node_dragging) && pHOVER;
|
||||
var param = connection_param;
|
||||
var hov = noone;
|
||||
var hoverable = !bool(node_dragging) && pHOVER;
|
||||
var param = connection_param;
|
||||
|
||||
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);
|
||||
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; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
|
||||
param.cur_layer = i + 1;
|
||||
param.cur_layer = i + 1;
|
||||
|
||||
var _hov = _node.drawConnections(param);
|
||||
if(_hov != noone && is_struct(_hov)) hov = _hov;
|
||||
}
|
||||
var _hov = _node.drawConnections(param);
|
||||
if(_hov != noone && is_struct(_hov)) hov = _hov;
|
||||
}
|
||||
|
||||
if(value_dragging && connection_draw_mouse != noone && !key_mod_press(SHIFT)) {
|
||||
var _cmx = connection_draw_mouse[0];
|
||||
var _cmy = connection_draw_mouse[1];
|
||||
var _cmt = connection_draw_target;
|
||||
if(value_dragging && connection_draw_mouse != noone && !key_mod_press(SHIFT)) {
|
||||
var _cmx = connection_draw_mouse[0];
|
||||
var _cmy = connection_draw_mouse[1];
|
||||
var _cmt = connection_draw_target;
|
||||
|
||||
if(array_empty(value_draggings))
|
||||
value_dragging.drawConnectionMouse(param, _cmx, _cmy, _cmt);
|
||||
else {
|
||||
var _stIndex = array_find(value_draggings, value_dragging);
|
||||
if(array_empty(value_draggings))
|
||||
value_dragging.drawConnectionMouse(param, _cmx, _cmy, _cmt);
|
||||
else {
|
||||
var _stIndex = array_find(value_draggings, value_dragging);
|
||||
|
||||
for( var i = 0, n = array_length(value_draggings); i < n; i++ ) {
|
||||
var _dmx = _cmx;
|
||||
var _dmy = value_draggings[i].connect_type == CONNECT_TYPE.output? _cmy + (i - _stIndex) * 24 * graph_s : _cmy;
|
||||
for( var i = 0, n = array_length(value_draggings); i < n; i++ ) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
} else if(add_node_draw_junc != noone) {
|
||||
value_draggings[i].drawConnectionMouse(param, _dmx, _dmy, _cmt);
|
||||
}
|
||||
}
|
||||
} else if(add_node_draw_junc != noone) {
|
||||
|
||||
if(!instance_exists(o_dialog_add_node))
|
||||
add_node_draw_junc = noone;
|
||||
else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
if(!instance_exists(o_dialog_add_node))
|
||||
add_node_draw_junc = noone;
|
||||
else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
surface_reset_target();
|
||||
|
||||
gpu_set_texfilter(true);
|
||||
surface_set_shader(connection_surface_aa, sh_downsample);
|
||||
shader_set_f("down", aa);
|
||||
shader_set_f("dimension", w, h);
|
||||
shader_set_f("cornerDis", 0.5);
|
||||
shader_set_f("mixAmo", 1);
|
||||
|
||||
shader_set_dim("dimension", connection_surface);
|
||||
draw_surface_safe(connection_surface);
|
||||
surface_reset_shader();
|
||||
|
@ -1576,46 +1562,22 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
value_focus = noone;
|
||||
|
||||
var t = get_timer();
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
nodes_list[i].drawNodeBehind(gr_x, gr_y, mx, my, graph_s);
|
||||
}
|
||||
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; });
|
||||
|
||||
for( var i = 0, n = array_length(value_draggings); i < n; i++ )
|
||||
value_draggings[i].graph_selecting = true;
|
||||
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
if(is_instanceof(_node, Node_Frame)) continue;
|
||||
array_foreach(_node_draw, function(_n) /*=>*/ {
|
||||
try {
|
||||
var val = _node.drawNode(gr_x, gr_y, mx, my, graph_s, display_parameter, self);
|
||||
var val = _n.drawNode(__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 ];
|
||||
}
|
||||
} catch(e) {
|
||||
log_warning("NODE DRAW", exception_print(e));
|
||||
}
|
||||
}
|
||||
} catch(e) { log_warning("NODE DRAW", exception_print(e)); }
|
||||
});
|
||||
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
if(!is_instanceof(nodes_list[i], Node_Frame))
|
||||
nodes_list[i].drawBadge(gr_x, gr_y, graph_s);
|
||||
}
|
||||
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
var _node = nodes_list[i];
|
||||
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
nodes_list[i].drawNodeFG(gr_x, gr_y, mx, my, graph_s, display_parameter, self);
|
||||
}
|
||||
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(PANEL_INSPECTOR && PANEL_INSPECTOR.prop_hover != noone)
|
||||
value_focus = PANEL_INSPECTOR.prop_hover;
|
||||
|
@ -3338,7 +3300,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
_jun.visible_manual = -1;
|
||||
}
|
||||
|
||||
_node.will_setHeight = true;
|
||||
_node.setHeight();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ function Panel_Patreon() : PanelContent() constructor {
|
|||
switch(page) {
|
||||
case 0 :
|
||||
draw_set_text(f_p0, fa_center, fa_center, COLORS._main_text_inner);
|
||||
draw_text(w / 2, _yy, "Enter your Pateron email:");
|
||||
draw_text(w / 2, _yy, "Enter your Patreon email:");
|
||||
|
||||
tb_email.setInteract(!mail_checking);
|
||||
tb_email.setFocusHover(pFOCUS, pHOVER);
|
||||
|
|
Loading…
Add table
Reference in a new issue