mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 22:46:19 +01:00
- [PCX] Fix expression not evaluate if the junction is connected.
- [PCX] Fix square bracket break autocomplete.
This commit is contained in:
parent
4b1ff8bf07
commit
81d54ea3e3
7 changed files with 33 additions and 24 deletions
|
@ -6,6 +6,7 @@ function __Node_Base(x, y) constructor {
|
||||||
inputs = ds_list_create();
|
inputs = ds_list_create();
|
||||||
outputs = ds_list_create();
|
outputs = ds_list_create();
|
||||||
|
|
||||||
|
active_index = -1;
|
||||||
preview_index = 0;
|
preview_index = 0;
|
||||||
anim_show = true;
|
anim_show = true;
|
||||||
anim_priority = -999;
|
anim_priority = -999;
|
||||||
|
|
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
|
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
|
||||||
|
|
||||||
VERSION = 11542;
|
VERSION = 11543;
|
||||||
SAVE_VERSION = 11530;
|
SAVE_VERSION = 11530;
|
||||||
VERSION_STRING = "1.15.4.2";
|
VERSION_STRING = "1.14.3";
|
||||||
BUILD_NUMBER = 11542;
|
BUILD_NUMBER = 11543;
|
||||||
|
|
||||||
globalvar APPEND_MAP;
|
globalvar APPEND_MAP;
|
||||||
APPEND_MAP = ds_map_create();
|
APPEND_MAP = ds_map_create();
|
||||||
|
|
|
@ -1437,13 +1437,13 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getValueRecursive = function(_time = CURRENT_FRAME) { #region
|
static getValueRecursive = function(_time = CURRENT_FRAME) { #region
|
||||||
var val = [ -1, self ];
|
var val = [ __getAnimValue(_time), self ];
|
||||||
|
|
||||||
if(type == VALUE_TYPE.trigger && connect_type == JUNCTION_CONNECT.output) //trigger even will not propagate from input to output, need to be done manually
|
if(type == VALUE_TYPE.trigger && connect_type == JUNCTION_CONNECT.output) //trigger event will not propagate from input to output, need to be done manually
|
||||||
return [ __getAnimValue(_time), self ];
|
return val;
|
||||||
|
|
||||||
if(value_from && value_from != self)
|
if(value_from && value_from != self)
|
||||||
return value_from.getValueRecursive(_time);
|
val = value_from.getValueRecursive(_time);
|
||||||
|
|
||||||
if(expUse && is_struct(expTree) && expTree.validate()) {
|
if(expUse && is_struct(expTree) && expTree.validate()) {
|
||||||
//print($"========== EXPRESSION CALLED ==========");
|
//print($"========== EXPRESSION CALLED ==========");
|
||||||
|
@ -1452,13 +1452,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
if(global.EVALUATE_HEAD != noone && global.EVALUATE_HEAD == self) {
|
if(global.EVALUATE_HEAD != noone && global.EVALUATE_HEAD == self) {
|
||||||
noti_warning($"Expression evaluation error : recursive call detected.");
|
noti_warning($"Expression evaluation error : recursive call detected.");
|
||||||
} else {
|
} else {
|
||||||
//printIf(global.LOG_EXPRESSION, $"==================== EVAL BEGIN {expTree} ====================");
|
//print($"==================== EVAL BEGIN {expTree} ====================");
|
||||||
//printCallStack();
|
//printCallStack();
|
||||||
|
|
||||||
global.EVALUATE_HEAD = self;
|
global.EVALUATE_HEAD = self;
|
||||||
var params = {
|
var params = {
|
||||||
name: name,
|
name: name,
|
||||||
node_name: node.display_name,
|
node_name: node.display_name,
|
||||||
|
node: self,
|
||||||
value: val[0]
|
value: val[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1477,7 +1478,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [ __getAnimValue(_time), self ];
|
return val;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static setAnim = function(anim) { #region
|
static setAnim = function(anim) { #region
|
||||||
|
|
|
@ -25,8 +25,9 @@ function Panel_Globalvar() : PanelContent() constructor {
|
||||||
|
|
||||||
var hh = 0;
|
var hh = 0;
|
||||||
var yy = _y;
|
var yy = _y;
|
||||||
|
var _x = ui(8);
|
||||||
|
|
||||||
var gvh = globalvar_viewer_draw(0, yy, contentPane.surface_w, _m, pFOCUS, _hover, contentPane, x + ui(padding), y + ui(title_height));
|
var gvh = globalvar_viewer_draw(_x, yy, contentPane.surface_w - _x - ui(8), _m, pFOCUS, _hover, contentPane, x + _x + ui(padding), y + ui(title_height));
|
||||||
yy += gvh + ui(8);
|
yy += gvh + ui(8);
|
||||||
hh += gvh + ui(8);
|
hh += gvh + ui(8);
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ function Panel_Globalvar() : PanelContent() constructor {
|
||||||
PROJECT.globalNode.createValue();
|
PROJECT.globalNode.createValue();
|
||||||
|
|
||||||
bx -= ui(32 + 4);
|
bx -= ui(32 + 4);
|
||||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Edit"), var_editing? THEME.accept : THEME.gear,,,, 0.9) == 2)
|
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Edit"), var_editing? THEME.accept : THEME.gear) == 2)
|
||||||
var_editing = !var_editing;
|
var_editing = !var_editing;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -403,6 +403,8 @@
|
||||||
res = string_char_at(v1, v2 + 1);
|
res = string_char_at(v1, v2 + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//print($"Array getter {v1}, {v2} = {res}");
|
||||||
} else if(symbol == "=") { // value assignment
|
} else if(symbol == "=") { // value assignment
|
||||||
if(is_array(v1)) {
|
if(is_array(v1)) {
|
||||||
var val = params[$ v1[0]];
|
var val = params[$ v1[0]];
|
||||||
|
|
|
@ -36,6 +36,10 @@ function pxl_autocomplete_server(prompt, params = []) {
|
||||||
ds_priority_add(pr_list, [[THEME.ac_constant, 2], gl, "local", gl], match);
|
ds_priority_add(pr_list, [[THEME.ac_constant, 2], gl, "local", gl], match);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gl = "value";
|
||||||
|
var match = string_partial_match(string_lower(gl), string_lower(prompt));
|
||||||
|
if(match != -9999) ds_priority_add(pr_list, [[THEME.ac_constant, 2], gl, "local", gl], match);
|
||||||
|
|
||||||
repeat(ds_priority_size(pr_list))
|
repeat(ds_priority_size(pr_list))
|
||||||
array_push(res, ds_priority_delete_max(pr_list));
|
array_push(res, ds_priority_delete_max(pr_list));
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
var crop = string_copy(_input_text, 1, cursor);
|
var crop = string_copy(_input_text, 1, cursor);
|
||||||
var slp = string_splice(crop, [" ", "(", ",", "\n"]);
|
var slp = string_splice(crop, [" ", "(", "[", "{", ",", "\n"]);
|
||||||
var pmt = array_safe_get(slp, -1,, ARRAY_OVERFLOW.loop);
|
var pmt = array_safe_get(slp, -1,, ARRAY_OVERFLOW.loop);
|
||||||
|
|
||||||
var params = [];
|
var params = [];
|
||||||
|
|
Loading…
Reference in a new issue