Change expression direct reference format

This commit is contained in:
Tanasart 2023-05-29 20:36:31 +02:00
parent f29208b0b2
commit e313c74a0e
7 changed files with 32 additions and 14 deletions

View file

@ -853,7 +853,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Tree sway.pxc","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Steamworks_Extension_Documentation.html","CopyToMask":0,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ucrtbased.dll","ConfigValues":{},"CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Uninstall gifski.lnk","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"webpmux.exe","CopyToMask":-1,"filePath":"datafiles/webp",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Welcome files.zip","CopyToMask":-1,"filePath":"datafiles",},
],

Binary file not shown.

View file

@ -1037,7 +1037,7 @@ function gameframe_tools_keyctl_reset() {
// gameframe_tools_keyctl_reset()
var _i = 0;
for (var __g1 = array_length(gameframe_tools_keyctl_keys); _i < __g1; _i++) {
gameframe_tools_keyctl_keys[_i][@1/* down */] = false;
//gameframe_tools_keyctl_keys[_i][@1/* down */] = false;
}
}

View file

@ -657,7 +657,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
}
}
function nodeGetData(str, getStr = false) {
function nodeGetData(str) {
var strs = string_splice(str, ".");
var _val = 0;
@ -674,12 +674,30 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
case "fps" : return ANIMATOR.framerate;
}
return 0;
} else {
} else if(array_length(strs) > 2) {
var key = strs[0];
if(!ds_map_exists(NODE_NAME_MAP, key)) return 0;
var node = NODE_NAME_MAP[? key];
_val = strs[1] == "inputs"? node.inputMap : node.outputMap;
var map = noone;
switch(strs[1]) {
case "inputs" :
case "input" :
map = node.inputMap;
break;
case "outputs" :
case "output" :
map = node.outputMap;
break;
default : return 0;
}
var _junc_key = strs[2];
var _junc = ds_map_try_get(map, _junc_key, noone);
if(_junc == noone) return 0;
return _junc.getValue();
}
return _val;

View file

@ -237,10 +237,8 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
var amp_ind = round(frame * content.sample / ANIMATOR.framerate);
var amp_win = content.sample / ANIMATOR.framerate;
var amp_st = max(0, amp_ind - amp_win);
var amp_ed = min(len, amp_ind + amp_win);
//print($"{amp_ind}: {amp_st} - {amp_ed}")
var amp_st = clamp(amp_ind - amp_win, 0, len);
var amp_ed = clamp(amp_ind + amp_win, 0, len);
if(!struct_has(content, "sound")) return;
if(array_length(content.sound) < 1) return;

View file

@ -18,7 +18,7 @@
var _val = 0;
if(val == "value") _val = inp;
else if(getStr) _val = val;
else _val = nodeGetData(val, getStr);
else _val = nodeGetData(val);
return _val;
}
@ -96,9 +96,7 @@
case "^": return (is_real(v1) && is_real(v2))? power(v1, v2) : 0;
case "/": return (is_real(v1) && is_real(v2))? v1 / v2 : 0;
case "|":
var val = is_real(v2)? array_safe_get(v1, v2) : ds_map_try_get(v1, v2);
if(is_struct(val) && instanceof(val) == "NodeValue")
val = val.getValue();
var val = is_real(v2)? array_safe_get(v1, v2) : 0;
return val;
case "sin" : return is_real(v1)? sin(v1) : 0;

View file

@ -31,6 +31,11 @@ function file_read_wav(path) {
wav_file_reading = true;
wav_file_prg = 0;
if(wav_file_reader == -1) {
noti_warning("File read error.");
return noone;
}
wav_file_load_time = current_time;
//RIFF