mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-03 16:55:14 +01:00
Group io change
This commit is contained in:
parent
9bca08fd57
commit
6c283eec85
14 changed files with 288 additions and 115 deletions
|
@ -952,6 +952,7 @@
|
|||
{"name":"node_guide","order":10,"path":"scripts/node_guide/node_guide.yy",},
|
||||
{"name":"fd_rectangle_get_velocity_surface","order":24,"path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",},
|
||||
{"name":"s_node_text_char_get","order":2,"path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},
|
||||
{"name":"o_dialog_group_output_order","order":4,"path":"objects/o_dialog_group_output_order/o_dialog_group_output_order.yy",},
|
||||
{"name":"fd_rectangle_get_initial_value_pressure","order":7,"path":"scripts/fd_rectangle_get_initial_value_pressure/fd_rectangle_get_initial_value_pressure.yy",},
|
||||
{"name":"node_timeline_preview","order":2,"path":"scripts/node_timeline_preview/node_timeline_preview.yy",},
|
||||
{"name":"__polygon","order":2,"path":"scripts/__polygon/__polygon.yy",},
|
||||
|
|
|
@ -1601,6 +1601,7 @@
|
|||
{"id":{"name":"node_guide","path":"scripts/node_guide/node_guide.yy",},},
|
||||
{"id":{"name":"fd_rectangle_get_velocity_surface","path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",},},
|
||||
{"id":{"name":"s_node_text_char_get","path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},},
|
||||
{"id":{"name":"o_dialog_group_output_order","path":"objects/o_dialog_group_output_order/o_dialog_group_output_order.yy",},},
|
||||
{"id":{"name":"fd_rectangle_get_initial_value_pressure","path":"scripts/fd_rectangle_get_initial_value_pressure/fd_rectangle_get_initial_value_pressure.yy",},},
|
||||
{"id":{"name":"node_timeline_preview","path":"scripts/node_timeline_preview/node_timeline_preview.yy",},},
|
||||
{"id":{"name":"__polygon","path":"scripts/__polygon/__polygon.yy",},},
|
||||
|
|
|
@ -5,22 +5,48 @@ event_inherited();
|
|||
dialog_w = ui(320);
|
||||
dialog_h = ui(400);
|
||||
|
||||
node = noone;
|
||||
destroy_on_click_out = true;
|
||||
|
||||
sep_dragging = -1;
|
||||
dragging = noone;
|
||||
|
||||
sep_editing = -1;
|
||||
tb_edit = new textBox(TEXTBOX_INPUT.text, function(str) {
|
||||
if(sep_editing == -1) return;
|
||||
|
||||
var sep = node.attributes.separator;
|
||||
sep[sep_editing][1] = str;
|
||||
node.attributes.separator = sep;
|
||||
|
||||
node.sortIO();
|
||||
display_list[sep_editing][0] = str;
|
||||
sep_editing = -1;
|
||||
refreshDisplay();
|
||||
} );
|
||||
tb_edit.align = fa_left;
|
||||
|
||||
node = noone;
|
||||
display_list = [];
|
||||
|
||||
function setNode(node) {
|
||||
self.node = node;
|
||||
self.display_list = node.input_display_list;
|
||||
}
|
||||
|
||||
function refreshDisplay() {
|
||||
var sep = [];
|
||||
var _ord = 0;
|
||||
|
||||
for( var i = 0, n = array_length(display_list); i < n; i++ ) {
|
||||
var ls = display_list[i];
|
||||
|
||||
if(is_array(ls)) array_push(sep, [ _ord, ls[0] ]);
|
||||
else {
|
||||
var _inp = node.inputs[| ls];
|
||||
_inp.from.attributes.input_priority = _ord;
|
||||
_ord++;
|
||||
}
|
||||
}
|
||||
|
||||
node.attributes.separator = sep;
|
||||
node.sortIO();
|
||||
display_list = node.input_display_list;
|
||||
|
||||
PROJECT.modified = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region content
|
||||
|
@ -31,39 +57,46 @@ event_inherited();
|
|||
var hg = ui(32);
|
||||
var con_w = sc_group.surface_w;
|
||||
var inpt = 0;
|
||||
var hovr = -1;
|
||||
var hovr = 0;
|
||||
var padd = ui(4);
|
||||
var _drag = -1;
|
||||
var _ly = _y;
|
||||
|
||||
for( var i = 0, n = array_length(node.input_display_list); i < n; i++ ) {
|
||||
var disp = node.input_display_list[i];
|
||||
if(is_array(disp)) {
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, _y, hg, _y + hg)) {
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, 0, _y, hg, hg, COLORS._main_icon, 1);
|
||||
for( var i = 0, n = array_length(display_list); i < n; i++ ) {
|
||||
var disp = display_list[i];
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0 + padd, _y + padd, hg - padd, _y + hg - padd)) {
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, padd, _y + padd, hg - padd * 2, hg - padd * 2, COLORS._main_icon, 1);
|
||||
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
sep_dragging = disp[2];
|
||||
} else
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, 0, _y, hg, hg, COLORS._main_icon_light, 1);
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
_drag = i;
|
||||
} else
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, padd, _y + padd, hg - padd * 2, hg - padd * 2, COLORS._main_icon_light, 1);
|
||||
draw_sprite_ui(THEME.hamburger, 0, hg / 2, _y + hg / 2, 0.5, 0.5,, COLORS._main_icon_light);
|
||||
|
||||
if(dragging != noone && _m[1] > _y + ui(28)) {
|
||||
hovr = i + 1;
|
||||
_ly = _y + (is_array(disp)? hg : ui(28)) + ui(4);
|
||||
}
|
||||
|
||||
if(is_array(disp)) {
|
||||
var ed_x = hg + ui(4);
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], ed_x, _y, con_w, _y + hg)) {
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, ed_x, _y, con_w - ed_x, hg, COLORS._main_icon, 1);
|
||||
|
||||
if(mouse_press(mb_left, sFOCUS)) {
|
||||
sep_editing = sep_editing == disp[2]? -1 : disp[2];
|
||||
if(sep_editing > -1)
|
||||
tb_edit.activate();
|
||||
sep_editing = i;
|
||||
tb_edit.activate();
|
||||
}
|
||||
} else
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, ed_x, _y, con_w - ed_x, hg, COLORS._main_icon_light, 1);
|
||||
|
||||
draw_sprite_ui(THEME.hamburger, 0, hg / 2, _y + hg / 2, 0.5, 0.5,, COLORS._main_icon_light);
|
||||
|
||||
if(sep_editing == disp[2]) {
|
||||
if(sep_editing == i) {
|
||||
var sep = node.attributes.separator;
|
||||
|
||||
WIDGET_CURRENT = tb_edit;
|
||||
tb_edit.setFocusHover(sFOCUS, sHOVER);
|
||||
tb_edit.draw(ed_x + ui(4), _y + ui(4), con_w - (ed_x + ui(8)), hg - ui(8), sep[sep_editing][1], mouse_ui);
|
||||
tb_edit.draw(ed_x + ui(4), _y + ui(4), con_w - (ed_x + ui(8)), hg - ui(8), disp[0], mouse_ui);
|
||||
|
||||
if(keyboard_check_pressed(vk_enter))
|
||||
sep_editing = -1;
|
||||
|
@ -72,26 +105,12 @@ event_inherited();
|
|||
draw_text(ed_x + ui(8), _y + hg / 2 - 1, disp[0]);
|
||||
}
|
||||
|
||||
if(sep_dragging > -1 && point_in_rectangle(_m[0], _m[1], 0, _y - ui(4), con_w, _y + hg)) {
|
||||
draw_set_color(COLORS._main_icon_dark);
|
||||
draw_line_round(ui(4), _y, con_w - ui(4), _y, 4);
|
||||
|
||||
hovr = inpt;
|
||||
}
|
||||
|
||||
_y += hg + ui(4);
|
||||
_h += hg + ui(4);
|
||||
} else {
|
||||
var ind = node.inputs[| disp];
|
||||
draw_set_text(f_p0b, fa_left, fa_center, COLORS._main_text_sub);
|
||||
draw_text(ui(8), _y + ui(14), ind.name);
|
||||
|
||||
if(sep_dragging > -1 && point_in_rectangle(_m[0], _m[1], 0, _y - ui(4), con_w, _y + ui(28))) {
|
||||
draw_set_color(COLORS._main_icon_dark);
|
||||
draw_line_round(ui(4), _y, con_w - ui(4), _y, 4);
|
||||
|
||||
hovr = inpt;
|
||||
}
|
||||
draw_text(hg + ui(8), _y + ui(14), ind.name);
|
||||
|
||||
inpt++;
|
||||
_y += ui(28) + ui(4);
|
||||
|
@ -99,19 +118,21 @@ event_inherited();
|
|||
}
|
||||
}
|
||||
|
||||
if(sep_dragging > -1 && hovr == -1) {
|
||||
hovr = ds_list_size(node.inputs) - node.custom_input_index
|
||||
if(_drag > -1) {
|
||||
dragging = display_list[_drag];
|
||||
array_delete(display_list, _drag, 1);
|
||||
}
|
||||
|
||||
if(dragging != noone && _ly > -1) {
|
||||
draw_set_color(COLORS._main_icon_dark);
|
||||
draw_line_round(ui(4), _y, con_w - ui(4), _y, 4);
|
||||
draw_line_round(ui(4), _ly, con_w - ui(4), _ly, 4);
|
||||
}
|
||||
|
||||
if(sep_dragging > -1 && mouse_release(mb_left)) {
|
||||
var sep = node.attributes.separator;
|
||||
sep[sep_dragging][0] = hovr;
|
||||
node.attributes.separator = sep;
|
||||
node.sortIO();
|
||||
|
||||
sep_dragging = -1;
|
||||
if(dragging != noone && mouse_release(mb_left)) {
|
||||
array_insert(display_list, hovr, dragging);
|
||||
refreshDisplay();
|
||||
|
||||
dragging = noone;
|
||||
}
|
||||
|
||||
return _h;
|
||||
|
|
|
@ -26,7 +26,8 @@ if !ready exit;
|
|||
var _txt = __txtx("dialog_group_order_add", "Add separator");
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, _txt, THEME.add, 1, COLORS._main_value_positive) == 2) {
|
||||
var sep = node.attributes.separator;
|
||||
array_push(sep, [ds_list_size(node.inputs) - node.custom_input_index, ""]);
|
||||
array_push(sep, [ ds_list_size(node.inputs) - node.custom_input_index, "" ]);
|
||||
node.sortIO();
|
||||
display_list = node.input_display_list;
|
||||
}
|
||||
#endregion
|
95
objects/o_dialog_group_output_order/Create_0.gml
Normal file
95
objects/o_dialog_group_output_order/Create_0.gml
Normal file
|
@ -0,0 +1,95 @@
|
|||
/// @description init
|
||||
event_inherited();
|
||||
|
||||
#region data
|
||||
dialog_w = ui(320);
|
||||
dialog_h = ui(400);
|
||||
|
||||
destroy_on_click_out = true;
|
||||
dragging = noone;
|
||||
|
||||
node = noone;
|
||||
display_list = [];
|
||||
|
||||
function setNode(node) {
|
||||
self.node = node;
|
||||
self.display_list = node.output_display_list;
|
||||
}
|
||||
|
||||
function refreshDisplay() {
|
||||
var _ord = 0;
|
||||
|
||||
for( var i = 0, n = array_length(display_list); i < n; i++ ) {
|
||||
var ls = display_list[i];
|
||||
|
||||
var _inp = node.outputs[| ls];
|
||||
_inp.from.attributes.input_priority = _ord;
|
||||
_ord++;
|
||||
}
|
||||
|
||||
node.sortIO();
|
||||
display_list = node.output_display_list;
|
||||
|
||||
PROJECT.modified = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region content
|
||||
sc_group = new scrollPane(dialog_w - ui(padding + padding), dialog_h - ui(title_height + padding), function(_y, _m) {
|
||||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
if(node == noone) return 0;
|
||||
var _h = 0;
|
||||
var hg = ui(32);
|
||||
var con_w = sc_group.surface_w;
|
||||
var inpt = 0;
|
||||
var hovr = 0;
|
||||
var padd = ui(4);
|
||||
var _drag = -1;
|
||||
var _ly = _y;
|
||||
|
||||
for( var i = 0, n = array_length(display_list); i < n; i++ ) {
|
||||
var disp = display_list[i];
|
||||
|
||||
if(sHOVER && point_in_rectangle(_m[0], _m[1], 0 + padd, _y + padd, hg - padd, _y + hg - padd)) {
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, padd, _y + padd, hg - padd * 2, hg - padd * 2, COLORS._main_icon, 1);
|
||||
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
_drag = i;
|
||||
} else
|
||||
draw_sprite_stretched_ext(THEME.group_label, 0, padd, _y + padd, hg - padd * 2, hg - padd * 2, COLORS._main_icon_light, 1);
|
||||
draw_sprite_ui(THEME.hamburger, 0, hg / 2, _y + hg / 2, 0.5, 0.5,, COLORS._main_icon_light);
|
||||
|
||||
if(dragging != noone && _m[1] > _y + ui(28)) {
|
||||
hovr = i + 1;
|
||||
_ly = _y + (is_array(disp)? hg : ui(28)) + ui(4);
|
||||
}
|
||||
|
||||
var ind = node.outputs[| disp];
|
||||
draw_set_text(f_p0b, fa_left, fa_center, COLORS._main_text_sub);
|
||||
draw_text(hg + ui(8), _y + ui(14), ind.name);
|
||||
|
||||
inpt++;
|
||||
_y += ui(28) + ui(4);
|
||||
_h += ui(28) + ui(4);
|
||||
}
|
||||
|
||||
if(_drag > -1) {
|
||||
dragging = display_list[_drag];
|
||||
array_delete(display_list, _drag, 1);
|
||||
}
|
||||
|
||||
if(dragging != noone && _ly > -1) {
|
||||
draw_set_color(COLORS._main_icon_dark);
|
||||
draw_line_round(ui(4), _ly, con_w - ui(4), _ly, 4);
|
||||
}
|
||||
|
||||
if(dragging != noone && mouse_release(mb_left)) {
|
||||
array_insert(display_list, hovr, dragging);
|
||||
refreshDisplay();
|
||||
|
||||
dragging = noone;
|
||||
}
|
||||
|
||||
return _h;
|
||||
})
|
||||
#endregion
|
22
objects/o_dialog_group_output_order/Draw_64.gml
Normal file
22
objects/o_dialog_group_output_order/Draw_64.gml
Normal file
|
@ -0,0 +1,22 @@
|
|||
/// @description init
|
||||
if !ready exit;
|
||||
|
||||
#region base UI
|
||||
draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
|
||||
if(sFOCUS)
|
||||
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
|
||||
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
|
||||
draw_text(dialog_x + ui(24), dialog_y + ui(20), __txtx("dialog_group_order_title", "Input order"));
|
||||
#endregion
|
||||
|
||||
#region preset
|
||||
var px = dialog_x + ui(padding);
|
||||
var py = dialog_y + ui(title_height);
|
||||
var pw = dialog_w - ui(padding + padding);
|
||||
var ph = dialog_h - ui(title_height + padding)
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16));
|
||||
sc_group.setFocusHover(sFOCUS, sHOVER);
|
||||
sc_group.draw(px, py);
|
||||
#endregion
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"resourceType": "GMObject",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "o_dialog_group_output_order",
|
||||
"eventList": [
|
||||
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,},
|
||||
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,},
|
||||
],
|
||||
"managed": true,
|
||||
"overriddenProperties": [],
|
||||
"parent": {
|
||||
"name": "inspector",
|
||||
"path": "folders/dialog/inspector.yy",
|
||||
},
|
||||
"parentObjectId": {
|
||||
"name": "_p_dialog",
|
||||
"path": "objects/_p_dialog/_p_dialog.yy",
|
||||
},
|
||||
"persistent": false,
|
||||
"physicsAngularDamping": 0.1,
|
||||
"physicsDensity": 0.5,
|
||||
"physicsFriction": 0.2,
|
||||
"physicsGroup": 1,
|
||||
"physicsKinematic": false,
|
||||
"physicsLinearDamping": 0.1,
|
||||
"physicsObject": false,
|
||||
"physicsRestitution": 0.1,
|
||||
"physicsSensor": false,
|
||||
"physicsShape": 1,
|
||||
"physicsShapePoints": [],
|
||||
"physicsStartAwake": true,
|
||||
"properties": [],
|
||||
"solid": false,
|
||||
"spriteId": null,
|
||||
"spriteMaskId": null,
|
||||
"visible": true,
|
||||
}
|
|
@ -30,7 +30,7 @@
|
|||
win_hp = WIN_H;
|
||||
win_resize = false;
|
||||
|
||||
room_width = WIN_W;
|
||||
room_width = WIN_W;
|
||||
room_height = WIN_H;
|
||||
|
||||
draw_set_circle_precision(64);
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
|
||||
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
|
||||
|
||||
VERSION = 11550;
|
||||
VERSION = 11551;
|
||||
SAVE_VERSION = 11550;
|
||||
VERSION_STRING = "1.15.5";
|
||||
BUILD_NUMBER = 11550;
|
||||
VERSION_STRING = "1.15.5.1";
|
||||
BUILD_NUMBER = 11551;
|
||||
|
||||
globalvar APPEND_MAP;
|
||||
APPEND_MAP = ds_map_create();
|
||||
|
|
|
@ -106,10 +106,16 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
tool_node = noone;
|
||||
draw_input_overlay = true;
|
||||
|
||||
array_push(attributeEditors, ["Edit separator", function() { return attributes.separator; },
|
||||
array_push(attributeEditors, ["Edit Input Display", function() { return attributes.separator; },
|
||||
button(function() {
|
||||
var dia = dialogCall(o_dialog_group_input_order);
|
||||
dia.node = self;
|
||||
dia.setNode(self);
|
||||
}) ]);
|
||||
|
||||
array_push(attributeEditors, ["Edit Output Display", function() { return attributes.separator; },
|
||||
button(function() {
|
||||
var dia = dialogCall(o_dialog_group_output_order);
|
||||
dia.setNode(self);
|
||||
}) ]);
|
||||
|
||||
insp1UpdateTooltip = __txtx("panel_inspector_execute", "Execute node contents");
|
||||
|
@ -386,40 +392,39 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
draw_dummy = false;
|
||||
} #endregion
|
||||
|
||||
static resolveGroupOrdering = function() { #region
|
||||
var siz = ds_list_size(inputs);
|
||||
var ar = ds_priority_create();
|
||||
static getListFreeOrder = function(list) { #region
|
||||
var _or = 0;
|
||||
var _ors = [];
|
||||
|
||||
for( var i = custom_input_index; i < siz; i++ ) {
|
||||
var _in = inputs[| i];
|
||||
var _or = _in.from.attributes.input_priority;
|
||||
|
||||
ds_priority_add(ar, _in, _or);
|
||||
for( var i = custom_input_index; i < ds_list_size(list); i++ ) {
|
||||
var _in = list[| i];
|
||||
array_push(_ors, _in.from.attributes.input_priority);
|
||||
}
|
||||
|
||||
var _order = 0;
|
||||
for( var i = custom_input_index; i < siz; i++ ) {
|
||||
var _jin = ds_priority_delete_min(ar);
|
||||
|
||||
var _in = inputs[| i];
|
||||
_in.from.attributes.input_priority = _order;
|
||||
_order++;
|
||||
}
|
||||
array_sort(_ors, true);
|
||||
for( var i = 0, n = array_length(_ors); i < n; i++ )
|
||||
if(_or == _ors[i]) _or++;
|
||||
|
||||
ds_priority_destroy(ar);
|
||||
return _or;
|
||||
} #endregion
|
||||
|
||||
static getInputFreeOrder = function() { return getListFreeOrder(inputs); }
|
||||
static getOutputFreeOrder = function() { return getListFreeOrder(outputs); }
|
||||
|
||||
static sortIO = function() { #region
|
||||
resolveGroupOrdering();
|
||||
var sep = attributes.separator;
|
||||
var siz = ds_list_size(inputs);
|
||||
var ar = ds_priority_create();
|
||||
var _ors = {};
|
||||
var _dup = false;
|
||||
|
||||
var sep = attributes.separator;
|
||||
array_sort(sep, function(a0, a1) { return a0[0] - a1[0]; });
|
||||
var siz = ds_list_size(inputs);
|
||||
var ar = ds_priority_create();
|
||||
|
||||
for( var i = custom_input_index; i < siz; i++ ) {
|
||||
var _in = inputs[| i];
|
||||
var _or = _in.from.attributes.input_priority;
|
||||
if(struct_has(_ors, _or)) _dup = true;
|
||||
_ors[$ _or] = 1;
|
||||
|
||||
ds_priority_add(ar, _in, _or);
|
||||
}
|
||||
|
@ -447,8 +452,10 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
|
||||
ds_priority_destroy(ar);
|
||||
|
||||
var siz = ds_list_size(outputs);
|
||||
var ar = ds_priority_create();
|
||||
output_display_list = [];
|
||||
var siz = ds_list_size(outputs);
|
||||
var ar = ds_priority_create();
|
||||
var _dup = false;
|
||||
|
||||
for( var i = custom_output_index; i < siz; i++ ) {
|
||||
var _out = outputs[| i];
|
||||
|
@ -457,14 +464,14 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
ds_priority_add(ar, _out, _or);
|
||||
}
|
||||
|
||||
for( var i = siz - 1; i >= custom_output_index; i-- ) {
|
||||
for( var i = siz - 1; i >= custom_output_index; i-- )
|
||||
ds_list_delete(outputs, i);
|
||||
}
|
||||
|
||||
for( var i = custom_output_index; i < siz; i++ ) {
|
||||
var _jout = ds_priority_delete_min(ar);
|
||||
_jout.index = i;
|
||||
ds_list_add(outputs, _jout);
|
||||
array_push(output_display_list, i);
|
||||
}
|
||||
|
||||
ds_priority_destroy(ar);
|
||||
|
|
|
@ -8,15 +8,8 @@ function Node_DynaSurf_In(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
inParent = undefined;
|
||||
|
||||
attributes.input_priority = group == noone? 0 : ds_list_size(group.inputs);
|
||||
array_push(attributeEditors, "Group");
|
||||
array_push(attributeEditors, ["Input Order", function() { return attributes.input_priority; },
|
||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||
attributes.input_priority = val;
|
||||
group.setHeight();
|
||||
group.sortIO();
|
||||
})]);
|
||||
|
||||
attributes.input_priority = group == noone? 0 : group.getInputFreeOrder();
|
||||
|
||||
outputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone);
|
||||
|
||||
static createInput = function(override_order = true) { #region
|
||||
|
@ -51,14 +44,22 @@ function Node_DynaSurf_In(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
}
|
||||
} #endregion
|
||||
|
||||
static update = function(frame = CURRENT_FRAME) {
|
||||
static update = function(frame = CURRENT_FRAME) { #region
|
||||
if(is_undefined(inParent)) return;
|
||||
var _val = inParent.getValue();
|
||||
|
||||
outputs[| 0].setValue(new __funcTree("", _val));
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static postDeserialize = function() { #region
|
||||
createInput(false);
|
||||
} #endregion
|
||||
|
||||
static doApplyDeserialize = function() { #region
|
||||
if(group == noone) return;
|
||||
|
||||
if(CLONING) attributes.input_priority = group.getInputFreeOrder();
|
||||
group.sortIO();
|
||||
} #endregion
|
||||
|
||||
}
|
|
@ -6,14 +6,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
|
||||
inParent = undefined;
|
||||
|
||||
attributes.input_priority = group == noone? 0 : ds_list_size(group.inputs);
|
||||
array_push(attributeEditors, "Group");
|
||||
array_push(attributeEditors, ["Input Order", function() { return attributes.input_priority; },
|
||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||
attributes.input_priority = val;
|
||||
group.setHeight();
|
||||
group.sortIO();
|
||||
})]);
|
||||
attributes.input_priority = group == noone? 0 : group.getInputFreeOrder();
|
||||
|
||||
w = 96;
|
||||
h = 32 + 24;
|
||||
|
@ -258,9 +251,6 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
inParent.setDisplay(VALUE_DISPLAY.button, { name: bname, onClick: function() { doTrigger = 1; } });
|
||||
break;
|
||||
}
|
||||
|
||||
if(index == 5)
|
||||
group.sortIO();
|
||||
} #endregion
|
||||
|
||||
static createInput = function(override_order = true) { #region
|
||||
|
@ -372,6 +362,8 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
getInputs();
|
||||
if(PROJECT.version < 11520) attributes.input_priority = getInputData(5);
|
||||
onValueUpdate();
|
||||
|
||||
if(CLONING) attributes.input_priority = group.getInputFreeOrder();
|
||||
group.sortIO();
|
||||
} #endregion
|
||||
|
||||
|
|
|
@ -4,14 +4,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
color = COLORS.node_blend_collection;
|
||||
previewable = false;
|
||||
|
||||
attributes.input_priority = group == noone? 0 : ds_list_size(group.inputs);
|
||||
array_push(attributeEditors, "Group");
|
||||
array_push(attributeEditors, ["Input Order", function() { return attributes.input_priority; },
|
||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||
attributes.input_priority = val;
|
||||
group.setHeight();
|
||||
group.sortIO();
|
||||
})]);
|
||||
attributes.input_priority = group == noone? 0 : group.getOutputFreeOrder();
|
||||
|
||||
w = 96;
|
||||
h = 32 + 24;
|
||||
|
@ -39,8 +32,6 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
static onValueUpdate = function(index = 0) { #region
|
||||
if(is_undefined(outParent)) return;
|
||||
|
||||
group.sortIO();
|
||||
} #endregion
|
||||
|
||||
static getNextNodes = function() { #region
|
||||
|
@ -129,6 +120,10 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
group.sortIO();
|
||||
} #endregion
|
||||
|
||||
static doApplyDeserialize = function() { #region
|
||||
if(CLONING) attributes.input_priority = group.getOutputFreeOrder();
|
||||
} #endregion
|
||||
|
||||
static onDestroy = function() { #region
|
||||
if(is_undefined(outParent)) return;
|
||||
ds_list_delete(group.outputs, ds_list_find_index(group.outputs, outParent));
|
||||
|
|
|
@ -1713,7 +1713,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
var _app = __APPEND_MAP(_map);
|
||||
APPENDING = false;
|
||||
CLONING = false;
|
||||
|
||||
|
||||
if(_app == noone)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue