diff --git a/scripts/node_struct/node_struct.gml b/scripts/node_struct/node_struct.gml index 84ffb78e3..d3564e628 100644 --- a/scripts/node_struct/node_struct.gml +++ b/scripts/node_struct/node_struct.gml @@ -25,20 +25,19 @@ function Node_Struct(_x, _y, _group = noone) : Node(_x, _y, _group) constructor #region //////////////////////////////// Dynamic IO //////////////////////////////// static createNewInput = function(list = inputs) { - var index = ds_list_size(list); - - var bDel = button(function() { node.deleteInput(index); }) + var index = array_length(list); + var bDel = button(function() { node.deleteInput(index); }) .setIcon(THEME.minus_16, 0, COLORS._main_icon); - list[| index + 0] = nodeValue_Text("Key", self, "" ) + list[index + 0] = nodeValue_Text("Key", self, "" ) .setDisplay(VALUE_DISPLAY.text_box, { side_button : bDel }) .setAnimable(false); - bDel.setContext(list[| index + 0]); + bDel.setContext(list[index + 0]); - list[| index + 1] = nodeValue("value", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0 ) + list[index + 1] = nodeValue("value", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0 ) .setVisible(false, false); - return list[| index + 0]; + return list[index + 0]; } setDynamicInput(2, false); diff --git a/scripts/node_struct_get/node_struct_get.gml b/scripts/node_struct_get/node_struct_get.gml index 51c168d85..d8bf89908 100644 --- a/scripts/node_struct_get/node_struct_get.gml +++ b/scripts/node_struct_get/node_struct_get.gml @@ -8,9 +8,9 @@ function Node_Struct_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construc newInput(1, nodeValue_Text("Key", self, "")); - outputs[0] = nodeValue_Output("Struct", self, VALUE_TYPE.struct, {}); + outputs[0] = nodeValue_Output("Value", self, VALUE_TYPE.struct, {}); - static getStructValue = function(str, keys) { #region + static getStructValue = function(str, keys) { var _pnt = str, val = 0; if(!is_struct(_pnt)) return [ VALUE_TYPE.any, val ]; @@ -40,9 +40,9 @@ function Node_Struct_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construc } return [ VALUE_TYPE.any, val ]; - } #endregion + } - static update = function() { #region + static update = function() { var str = getInputData(0); var key = getInputData(1); @@ -68,14 +68,13 @@ function Node_Struct_Get(_x, _y, _group = noone) : Node(_x, _y, _group) construc outputs[0].setType(val[0]); outputs[0].setValue(val[1]); } - } #endregion + } - static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { var bbox = drawGetBbox(xx, yy, _s); var str = getInputData(1); draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text); - var ss = string_scale(str, bbox.w, bbox.h); - draw_text_transformed(bbox.xc, bbox.yc, str, ss, ss, 0); - } #endregion + draw_text_bbox(bbox, str); + } } \ No newline at end of file diff --git a/scripts/node_struct_json_parse/node_struct_json_parse.gml b/scripts/node_struct_json_parse/node_struct_json_parse.gml index 5935ece23..761759dad 100644 --- a/scripts/node_struct_json_parse/node_struct_json_parse.gml +++ b/scripts/node_struct_json_parse/node_struct_json_parse.gml @@ -2,14 +2,14 @@ function Node_Struct_JSON_Parse(_x, _y, _group = noone) : Node(_x, _y, _group) c name = "JSON Parse"; setDimension(96, 32 + 24); - newInput(0, nodeValue_Text("JSON string", self, 0)) + newInput(0, nodeValue_Text("JSON string", self, "")) .setVisible(true, true); outputs[0] = nodeValue_Output("Struct", self, VALUE_TYPE.struct, {} ); static update = function(frame = CURRENT_FRAME) { var _str = getInputData(0); - var str = json_parse(_str); + var str = json_try_parse(_str); outputs[0].setValue(str); } diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index d5a4e7bcb..ab0f69ce9 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -986,7 +986,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru extract_node = "Node_Path"; break; - case VALUE_TYPE.any : + // case VALUE_TYPE.any : + default : editWidget = new outputBox(); break; }