[Tunnel out] Fix junction color not update properly.

This commit is contained in:
Tanasart 2024-09-04 14:23:35 +07:00
parent 6dedae85df
commit 9259b43b28
4 changed files with 17 additions and 11 deletions

View File

@ -56,7 +56,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
if(array_length(inputs_data[i]) == 0) continue;
if(!inputs[i].isArray(inputs_data[i])) continue;
if(typeArray(inputs[i].display_type)) {
if(typeArray(inputs[i])) {
process_amount = max(process_amount, array_length(inputs_data[i][0]));
} else
process_amount = max(process_amount, array_length(inputs_data[i]));

View File

@ -53,7 +53,7 @@ function valueKey(_time, _value, _anim = noone, _in = 0, _ot = 0) constructor {
return noone;
}
if(typeArray(self.anim.prop.display_type) != typeArray(anim.prop.display_type)) {
if(typeArray(self.anim.prop) != typeArray(anim.prop)) {
noti_warning("Type incompatible");
return noone;
}
@ -376,7 +376,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
}
static processTypeDefault = function() {
if(!sep_axis && typeArray(prop.display_type)) return [];
if(!sep_axis && typeArray(prop)) return [];
return 0;
}
@ -421,7 +421,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
if(PROJECT.attributes.strict) return processValue(_val);
var _res = _val;
if(!sep_axis && typeArray(prop.display_type) && is_array(_val)) {
if(!sep_axis && typeArray(prop) && is_array(_val)) {
for(var i = 0; i < array_length(_val); i++)
_res[i] = processValue(_val[i]);
} else
@ -604,7 +604,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
} else if(is_struct(val) && struct_has(val, "serialize")) {
val = val.serialize();
} else if(!sep_axis && typeArray(prop.display_type) && is_array(val)) {
} else if(!sep_axis && typeArray(prop) && is_array(val)) {
var __v = [];
for(var j = 0; j < array_length(val); j++) {
if(is_struct(val[j]) && struct_has(val[j], "serialize"))
@ -695,7 +695,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
} else
_val = LOADING_VERSION < 11640 && !is_int64(_val)? cola(_val) : int64(_val);
} else if(!sep_axis && typeArray(prop.display_type)) {
} else if(!sep_axis && typeArray(prop)) {
_val = [];
if(is_array(value)) {

View File

@ -122,8 +122,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
dyna_depo = ds_list_create();
value_tag = "";
type_array = 0;
is_modified = false;
cache_value = [ false, false, undefined, undefined ];
cache_array = [ false, false ];
@ -204,6 +202,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
display_attribute = noone;
popup_dialog = noone;
type_array = typeArray(self);
#endregion
#region ---- graph ----
@ -302,6 +301,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
type = _type;
draw_junction_index = type;
updateColor();
if(bypass_junc) bypass_junc.setType(_type);
return true;
@ -546,7 +547,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
static setDisplay = function(_type = VALUE_DISPLAY._default, _data = {}) {
display_type = _type;
display_data = _data;
type_array = typeArray(display_type);
type_array = typeArray(self);
resetDisplay();
return self;

View File

@ -407,10 +407,15 @@ function typeNumeric(type) {
return false;
}
function typeArray(_type) {
function typeArray(_value) {
INLINE
switch(_type) {
switch(_value.type) {
case VALUE_TYPE.curve :
return 1;
}
switch(_value.display_type) {
case VALUE_DISPLAY.range :
case VALUE_DISPLAY.vector_range :
case VALUE_DISPLAY.rotation_range :