This commit is contained in:
Tanasart 2024-10-06 08:25:07 +07:00
parent 103bb06491
commit a04a4c7b94
6 changed files with 25 additions and 13 deletions

View file

@ -42,7 +42,7 @@
LATEST_VERSION = 1_18_00_0;
VERSION = 1_18_01_0;
SAVE_VERSION = 1_18_00_0;
VERSION_STRING = MAC? "1.18.003m" : "1.18.1.004";
VERSION_STRING = MAC? "1.18.003m" : "1.18.1.005";
BUILD_NUMBER = 1_18_00_4;
HOTKEYS = ds_map_create();

View file

@ -188,7 +188,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
in_cache_len = 0;
inputDisplayList = [];
outputs_amount = 0;
outputs_index = [];
out_cache_len = 0;
@ -621,6 +620,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
static newInput = function(index, junction) { inputs[index] = junction; return junction; }
static newOutput = function(index, junction) { outputs[index] = junction; return junction; }
static getInputJunctionAmount = function() { return (input_display_list == -1 || !use_display_list)? array_length(inputs) : array_length(input_display_list); }
static getInputJunctionIndex = function(index) {
INLINE
@ -642,7 +642,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
for( var i = 0, n = array_length(inputs); i < n; i++ )
inputs[i].visible_in_list = false;
inputs_amount = (input_display_list == -1 || !use_display_list)? array_length(inputs) : array_length(input_display_list);
inputs_amount = getInputJunctionAmount();
inputs_index = [];
for( var i = 0; i < inputs_amount; i++ ) {
@ -657,8 +657,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
}
inputs_amount = array_length(inputs_index);
outputs_amount = output_display_list == -1? array_length(outputs) : array_length(output_display_list);
outputs_index = array_create_ext(outputs_amount, function(index) { return getOutputJunctionIndex(index); });
outputs_index = array_create_ext(getOutputJunctionAmount(), function(index) { return getOutputJunctionIndex(index); });
} //run_in(1, () => { updateIO() });
static setHeight = function() {
@ -1277,7 +1276,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
var ry = y + _junRy;
var idx;
for(var i = 0; i < outputs_amount; i++) {
var _oamo = getOutputJunctionAmount();
for(var i = 0; i < _oamo; i++) {
idx = outputs_index[i];
jun = outputs[idx];

View file

@ -379,9 +379,13 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
inParent = nodeValue("Value", group, CONNECT_TYPE.input, VALUE_TYPE.any, -1)
.uncache()
.setVisible(true, true);
inParent.from = self;
inParent.index = array_length(group.inputs);
array_push(group.inputs, inParent);
if(is_array(group.input_display_list))
array_push(group.input_display_list, inParent.index);
if(!LOADING && !APPENDING) {
group.refreshNodeDisplay();

View file

@ -57,9 +57,13 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
outParent = nodeValue("Value", group, CONNECT_TYPE.output, VALUE_TYPE.any, -1)
.uncache()
.setVisible(true, true);
outParent.from = self;
outParent.from = self;
outParent.index = array_length(group.outputs);
array_push(group.outputs, outParent);
if(is_array(group.output_display_list))
array_push(group.output_display_list, outParent.index);
if(!LOADING && !APPENDING) {
group.refreshNodeDisplay();

View file

@ -249,7 +249,10 @@ function Panel_Preview() : PanelContent() constructor {
var node = __getNodePreview();
if(node == noone) return;
node.preview_channel = sbChannelIndex[index].index;
var _ind = array_safe_get(sbChannelIndex, index, -1);
if(_ind == -1) return;
node.preview_channel = _ind;
node.setHeight();
});
@ -776,20 +779,21 @@ function Panel_Preview() : PanelContent() constructor {
var currName = _node.outputs[_node.preview_channel].name;
draw_set_text(sbChannel.font, fa_center, fa_center);
var ww = 0;
var hh = TEXTBOX_HEIGHT - ui(2);
var _am = _node.getOutputJunctionAmount();
var amo = _node.getOutputJunctionAmount();
for( var i = 0; i < _am; i++ ) {
for( var i = 0; i < amo; i++ ) {
var _outi = _node.getOutputJunctionIndex(i);
var _outj = _node.outputs[_outi];
array_push(chName, _outj.name);
array_push(sbChannelIndex, _outj);
array_push(sbChannelIndex, _outi);
ww = max(ww, string_width(_outj.name) + ui(40));
}
if(!array_empty(chName)) {
sbChannel.data_list = chName;
sbChannel.setFocusHover(pFOCUS, pHOVER);