mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
- [Group] Fix output junction order changing between session.
This commit is contained in:
parent
dcfc41379c
commit
aec420ef15
5 changed files with 26 additions and 14 deletions
|
@ -682,7 +682,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
for( var i = 0, n = array_length(_ilist); i < n; i++ ) {
|
||||
if(!struct_has(_inarr, _ilist[i])) continue;
|
||||
|
||||
ds_list_add(inputs, _inarr[$ _ilist[i]]);
|
||||
var _inJunc = _inarr[$ _ilist[i]];
|
||||
_inJunc.index = ds_list_size(inputs);
|
||||
ds_list_add(inputs, _inJunc);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -708,7 +710,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
for( var i = 0, n = array_length(_ilist); i < n; i++ ) {
|
||||
if(!struct_has(_inarr, _ilist[i])) continue;
|
||||
|
||||
ds_list_add(outputs, _inarr[$ _ilist[i]]);
|
||||
var _outJunc = _inarr[$ _ilist[i]];
|
||||
_outJunc.index = ds_list_size(outputs);
|
||||
ds_list_add(outputs, _outJunc);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ enum NODE_3D {
|
|||
function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||
|
||||
#region ---- main & active ----
|
||||
project = PROJECT;
|
||||
|
||||
active = true;
|
||||
renderActive = true;
|
||||
|
||||
|
|
|
@ -165,14 +165,15 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
var x0 = x1 - 16;
|
||||
var y0 = y1 - 16;
|
||||
var ics = 0.5;
|
||||
var shf = 8 + 8 * ics;
|
||||
|
||||
if(w * _s < 32 || h * _s < 32) return point_in_rectangle(_mx, _my, xx, yy, x1, y1);
|
||||
|
||||
if(point_in_rectangle(_mx, _my, xx, yy, x1, y1) || size_dragging)
|
||||
draw_sprite_ext_add(THEME.node_resize, 0, x1 - 4, y1 - 4, ics, ics, 0, c_white, 0.5);
|
||||
draw_sprite_ext_add(THEME.node_resize, 0, x1 - shf, y1 - shf, ics, ics, 0, c_white, 0.5);
|
||||
|
||||
if(!name_hover && point_in_rectangle(_mx, _my, x0, y0, x1, y1)) {
|
||||
draw_sprite_ext_add(THEME.node_resize, 0, x1 - 4, y1 - 4, ics, ics, 0, c_white, 1);
|
||||
draw_sprite_ext_add(THEME.node_resize, 0, x1 - shf, y1 - shf, ics, ics, 0, c_white, 1);
|
||||
|
||||
PANEL_GRAPH.drag_locking = true;
|
||||
|
||||
|
|
|
@ -527,8 +527,8 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
_inspecting.inspecting = true;
|
||||
prop_hover = noone;
|
||||
var jun = noone;
|
||||
var amoIn = _inspecting.input_display_list == -1? ds_list_size(_inspecting.inputs) : array_length(_inspecting.input_display_list);
|
||||
var amoOut = _inspecting.output_display_list == -1? ds_list_size(_inspecting.outputs) : array_length(_inspecting.output_display_list);
|
||||
var amoIn = is_array(_inspecting.input_display_list)? array_length(_inspecting.input_display_list) : ds_list_size(_inspecting.inputs);
|
||||
var amoOut = is_array(_inspecting.output_display_list)? array_length(_inspecting.output_display_list) : ds_list_size(_inspecting.outputs);
|
||||
var amo = inspectGroup == 0? amoIn + 1 + amoOut : amoIn;
|
||||
var hh = 0;
|
||||
|
||||
|
@ -637,9 +637,9 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var yy = hh + _y;
|
||||
|
||||
if(i < amoIn) { // inputs
|
||||
if(_inspecting.input_display_list == -1) jun = _inspecting.inputs[| i];
|
||||
else if(is_real(_inspecting.input_display_list[i])) jun = _inspecting.inputs[| _inspecting.input_display_list[i]];
|
||||
else jun = _inspecting.input_display_list[i];
|
||||
if(!is_array(_inspecting.input_display_list)) jun = _inspecting.inputs[| i];
|
||||
else if(is_real(_inspecting.input_display_list[i])) jun = _inspecting.inputs[| _inspecting.input_display_list[i]];
|
||||
else jun = _inspecting.input_display_list[i];
|
||||
|
||||
} else if(i == amoIn) { // output label
|
||||
hh += ui(8 + 32 + 8);
|
||||
|
@ -652,8 +652,8 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
} else { // outputs
|
||||
var _oi = i - amoIn - 1;
|
||||
|
||||
if(_inspecting.output_display_list == -1) jun = _inspecting.outputs[| _oi];
|
||||
else if(is_real(_inspecting.output_display_list[i])) jun = _inspecting.outputs[| _inspecting.output_display_list[_oi]];
|
||||
if(!is_array(_inspecting.output_display_list)) jun = _inspecting.outputs[| _oi];
|
||||
else if(is_real(_inspecting.output_display_list[_oi])) jun = _inspecting.outputs[| _inspecting.output_display_list[_oi]];
|
||||
else jun = _inspecting.output_display_list[_oi];
|
||||
}
|
||||
|
||||
|
|
|
@ -389,14 +389,20 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
if(preview_node[1] == node) preview_node[1] = noone;
|
||||
} #endregion
|
||||
|
||||
function resetNodePreview() { #region
|
||||
function resetNodePreview() {
|
||||
preview_node = [ noone, noone ];
|
||||
locked = false;
|
||||
} #endregion
|
||||
}
|
||||
|
||||
function __getNodePreview() { return preview_node[splitView? splitSelection : 0]; }
|
||||
function getNodePreview() {
|
||||
var _node = __getNodePreview();
|
||||
if(_node == noone) return noone;
|
||||
|
||||
if(!_node.project.active) {
|
||||
resetNodePreview();
|
||||
return noone;
|
||||
}
|
||||
|
||||
if(is_instanceof(_node, Node))
|
||||
_node = _node.getPreviewingNode();
|
||||
|
@ -2030,7 +2036,6 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
|
||||
var _prev_node = getNodePreview();
|
||||
d3_active = _prev_node == noone? NODE_3D.none : _prev_node.is_3D;
|
||||
//print($"{_prev_node} : {d3_active}")
|
||||
bg_color = lerp_color(bg_color, d3_active? COLORS.panel_3d_bg : COLORS.panel_bg_clear, 0.3);
|
||||
|
||||
draw_clear(bg_color);
|
||||
|
|
Loading…
Reference in a new issue