- Add widget choices to localization list.

This commit is contained in:
Tanasart 2023-09-28 20:10:41 +07:00
parent 6784c8e674
commit 017554d7a1
38 changed files with 10479 additions and 9019 deletions

View file

@ -574,6 +574,7 @@
{"name":"draw_text_delimiter","order":14,"path":"scripts/draw_text_delimiter/draw_text_delimiter.yy",},
{"name":"s_node_path_anchor","order":13,"path":"sprites/s_node_path_anchor/s_node_path_anchor.yy",},
{"name":"node_array_get","order":10,"path":"scripts/node_array_get/node_array_get.yy",},
{"name":"node_widget_test","order":16,"path":"scripts/node_widget_test/node_widget_test.yy",},
{"name":"node_pb_fx_highlight","order":1,"path":"scripts/node_pb_fx_highlight/node_pb_fx_highlight.yy",},
{"name":"Apollo","order":5,"path":"extensions/Apollo/Apollo.yy",},
{"name":"panel_graph_grid_settings","order":7,"path":"scripts/panel_graph_grid_settings/panel_graph_grid_settings.yy",},

View file

@ -1158,6 +1158,7 @@
{"id":{"name":"draw_text_delimiter","path":"scripts/draw_text_delimiter/draw_text_delimiter.yy",},},
{"id":{"name":"s_node_path_anchor","path":"sprites/s_node_path_anchor/s_node_path_anchor.yy",},},
{"id":{"name":"node_array_get","path":"scripts/node_array_get/node_array_get.yy",},},
{"id":{"name":"node_widget_test","path":"scripts/node_widget_test/node_widget_test.yy",},},
{"id":{"name":"node_pb_fx_highlight","path":"scripts/node_pb_fx_highlight/node_pb_fx_highlight.yy",},},
{"id":{"name":"Apollo","path":"extensions/Apollo/Apollo.yy",},},
{"id":{"name":"node_lua_compute","path":"scripts/node_lua_compute/node_lua_compute.yy",},},

Binary file not shown.

View file

@ -352,7 +352,17 @@
"preview_onion_skin_settings": "Onion skin Settings",
"project_graphGrid_color": "Grid color",
"project_graphGrid_opacity": "Grid opacity",
"project_modified": "Project modified",
"project_settings": "Project Settings",
"save_project_'{1}'_before_exit?": "Save project '{1}' before exit?",
"widget_control_point_move": "Move",
"widget_control_point_wind": "Wind",
"widget_range_constant": "Constant",
"widget_range_random": "Random Range",
"widget_rotator_random_double_range": "Double Range",
"widget_rotator_random_double_span": "Double Span",
"widget_rotator_random_range": "Range",
"widget_rotator_random_span": "Span",
"" : ""
}

File diff suppressed because it is too large Load diff

View file

@ -193,8 +193,10 @@
"action": "Action",
"armature": "Armature",
"buffer": "Buffer",
"curve": "Curve",
"custom": "Custom",
"default_surface": "Default Surface",
"euler": "Euler",
"format_": "Format ",
"independent": "Independent",
"legacy": "Legacy",
@ -202,18 +204,24 @@
"linked": "Linked",
"misc.": "Misc.",
"misc": "Misc",
"number": "Number",
"onion_skin": "Onion skin",
"opacity": "Opacity",
"output": "Output",
"palette": "Palette",
"path": "Path",
"quaternion": "Quaternion",
"radius": "radius",
"region": "Region",
"render": "Render",
"save_all": "Save all",
"scale": "Scale",
"settings": "Settings",
"shader": "Shader",
"shape": "Shape",
"surface": "Surface",
"system": "System",
"text": "Text",
"" : ""
}

View file

@ -12,7 +12,7 @@ if(win_w != w || win_h != h) {
}
draw_set_text(_f_p1, fa_left, fa_center, c_white);
draw_text(34, 18, "Pixel Composer crashed");
draw_text(34, 18, __txt("Pixel Composer crashed"));
draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
#region display
@ -75,7 +75,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
}
draw_sprite_ext(s_copy, 0, bx0 + 16, by0 + 16, 0.5, 0.5, 0, #8fde5d, 1);
draw_text(bx0 + 32, by0 + 16, "Copy ");
draw_text(bx0 + 32, by0 + 16, __txt("Copy") + " ");
#endregion
#region close
@ -95,7 +95,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
} else
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
draw_text(bx0 + bw / 2, by0 + bh / 2, "Close");
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Close"));
#endregion
#region open log
@ -115,7 +115,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
} else
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
draw_text(bx0 + bw / 2, by0 + bh / 2, "Open log folder");
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Open log folder"));
#endregion
#region restart
@ -137,7 +137,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
} else
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
draw_text(bx0 + bw / 2, by0 + bh / 2, "Restart application");
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Restart application"));
#endregion
#region discord

View file

@ -24,13 +24,13 @@ if !ready exit;
#region text
var py = dialog_y + ui(16);
var txt = $"Project modified";
var txt = __txt($"Project modified");
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), py, txt);
py += line_get_height(, 4);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
var txt = $"Save project '{filename_name(project.path)}' before exit?";
var txt = __txta("Save project '{1}' before exit?", filename_name(project.path));
draw_text(dialog_x + ui(24), py, txt);
var bw = ui(96), bh = BUTTON_HEIGHT;

View file

@ -120,7 +120,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
case "Bool" :
draw_set_alpha(0.5);
draw_set_text(f_h3, fa_center, fa_center, COLORS._main_text);
draw_text_bbox({ xc: mouse_mx, yc: mouse_my, w: ui(128), h: ui(24) }, DRAGGING.data? "True" : "False");
draw_text_bbox({ xc: mouse_mx, yc: mouse_my, w: ui(128), h: ui(24) }, __txt(DRAGGING.data? "True" : "False"));
draw_set_alpha(1);
break;
default:

View file

@ -23,7 +23,7 @@ function argumentRenderer(_typeArray = []) {
_h += _th + ui(8);
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);
draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), "Value");
draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), __txt("Value"));
var _jValue = inputs[| i + 2];
if(_jValue.editWidget != noone) {

View file

@ -31,7 +31,11 @@ function controlPointBox(_onModify) : widget() constructor {
sW = new slider(0, 32, 0.1, function(val) { onModify(PUPPET_CONTROL.width, toNumber(val)); });
sMode = ["Move", "Wind"];
sMode = [
__txtx("widget_control_point_move", "Move"),
__txtx("widget_control_point_wind", "Wind"),
];
scMode = new scrollBox(
sMode,
function(val) { onModify(PUPPET_CONTROL.mode, toNumber(val)); }
@ -97,18 +101,18 @@ function controlPointBox(_onModify) : widget() constructor {
yy += TEXTBOX_HEIGHT + ui(8);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text(_x, yy + ui(17), "radius");
draw_text(_x, yy + ui(17), __txt("radius"));
sW.draw(_x + lw, yy, _w - lw, TEXTBOX_HEIGHT, _wid, _m);
yy += TEXTBOX_HEIGHT + ui(8);
break;
case PUPPET_FORCE_MODE.wind:
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text(_x, yy + ui(17), "strength");
draw_text(_x, yy + ui(17), __txt("strength"));
tbFx.draw(_x + lw, yy, _w - lw, TEXTBOX_HEIGHT, _fx, _m);
yy += TEXTBOX_HEIGHT + ui(8);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text(_x, yy + ui(17), "width");
draw_text(_x, yy + ui(17), __txt("width"));
tbW.draw(_x + lw, yy, _w - lw, TEXTBOX_HEIGHT, _wid, _m);
yy += TEXTBOX_HEIGHT + ui(8);

View file

@ -48,7 +48,7 @@ function cornerBox(_onModify, _unit = noone) : widget() constructor {
}
static drawParam = function(params) {
return draw(params.x, params.y, params.data, params.m);
return draw(params.x + params.w / 2, params.y + ui(32), params.data, params.m);
}
static draw = function(_x, _y, _data, _m) {

View file

@ -7,7 +7,7 @@ function draw_text_delimiter(ch_x, ch_y, _str) {
var ch = string_char_at(_str, i);
if(ch == " ") {
ch = "<space>";
ch = __txtx("delimiter_space", "<space>");
draw_set_color(COLORS._main_text_sub);
} else
draw_set_color(cc);

View file

@ -156,9 +156,9 @@ function draw_tooltip_atlas(atlas) {
draw_rectangle(sx, _y, sx + ui(48), _y + ui(48), 1);
draw_set_text(f_p3, fa_left, fa_top, COLORS._main_text_sub);
draw_text_add(sx + ui( 56), _y + ui( 0), "Position");
draw_text_add(sx + ui( 56), _y + ui(16), "Rotation");
draw_text_add(sx + ui( 56), _y + ui(32), "Scale");
draw_text_add(sx + ui( 56), _y + ui( 0), __txt("Position"));
draw_text_add(sx + ui( 56), _y + ui(16), __txt("Rotation"));
draw_text_add(sx + ui( 56), _y + ui(32), __txt("Scale"));
draw_set_text(f_p3, fa_right, fa_top, COLORS._main_text);
draw_text_add(sx + ui(160), _y + ui( 0), atl.position);

View file

@ -1,7 +1,7 @@
#region locale
globalvar LOCALE, TEST_LOCALE;
LOCALE = {}
TEST_LOCALE = true;
TEST_LOCALE = false;
function __initLocale() {
var lfile = $"data/locale/en.zip";
@ -37,10 +37,12 @@
gml_pragma("forceinline");
if(TEST_LOCALE) {
if(!struct_has(LOCALE.word, key) && !struct_has(LOCALE.ui, key))
if(!struct_has(LOCALE.word, key) && !struct_has(LOCALE.ui, key)) {
show_debug_message($"LOCALE: \"{key}\": \"{def}\",");
//return def;
}
return def;
return "";
}
if(struct_has(LOCALE.word, key))
@ -60,20 +62,32 @@
return __txtx(prefix + key, txt);
}
function __txta(txt) {
var _txt = __txt(txt);
for(var i = 1; i < argument_count; i++)
_txt = string_replace_all(_txt, "{" + string(i) + "}", string(argument[i]));
return _txt;
}
function __txt_node_name(node, def = "") {
gml_pragma("forceinline");
if(struct_has(LOCALE.node, node))
return LOCALE.node[$ node].name;
if(!struct_has(LOCALE.node, node))
return def;
if(TEST_LOCALE) return "";
return def;
}
function __txt_node_tooltip(node, def = "") {
gml_pragma("forceinline");
if(struct_has(LOCALE.node, node))
return LOCALE.node[$ node].tooltip;
return def;
if(!struct_has(LOCALE.node, node))
return def;
if(TEST_LOCALE) return "";
return LOCALE.node[$ node].tooltip;
}
function __txt_junction_name(node, type, index, def = "") {
@ -86,6 +100,7 @@
var lst = type == JUNCTION_CONNECT.input? nde.inputs : nde.outputs;
if(index >= array_length(lst)) return def;
if(TEST_LOCALE) return "";
return lst[index].name;
}
@ -99,7 +114,24 @@
var lst = type == JUNCTION_CONNECT.input? nde.inputs : nde.outputs;
if(index >= array_length(lst)) return def;
if(TEST_LOCALE) return "";
return lst[index].tooltip;
}
function __txt_junction_data(node, type, index, def = []) {
gml_pragma("forceinline");
if(!struct_has(LOCALE.node, node))
return def;
var nde = LOCALE.node[$ node];
var lst = type == JUNCTION_CONNECT.input? nde.inputs : nde.outputs;
if(index >= array_length(lst)) return def;
if(!struct_has(lst[index], "display_data"))
return def;
if(TEST_LOCALE) return [ "" ];
return lst[index].display_data;
}
#endregion

View file

@ -84,7 +84,9 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct
x = _x;
y = _y;
w = _w;
h = _h;
var hh = TEXTBOX_HEIGHT + ui(8);
h = hh * size - ui(8);
if(extras && instanceof(extras) == "buttonClass") {
extras.setFocusHover(active, hover);
@ -105,7 +107,6 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct
b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon;
b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values");
var hh = TEXTBOX_HEIGHT + ui(8);
var th = hh * size - ui(8);
var bx = _x;
@ -131,6 +132,6 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct
resetFocus();
return th;
return h;
}
}

View file

@ -17,6 +17,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var breakLine = lineBreak || jun.expUse;
if(jun.type == VALUE_TYPE.text) breakLine = true;
var _name = jun.getName();
var butx = xx;
if(jun.connect_type == JUNCTION_CONNECT.input && jun.isAnimable() && !jun.expUse) { #region animation
var index = jun.value_from == noone? jun.is_anim : 2;
@ -32,7 +34,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(jun.value_from != noone)
jun.removeFrom();
else {
recordAction(ACTION_TYPE.var_modify, jun.animator, [ jun.is_anim, "is_anim", jun.name + " animation" ]);
recordAction(ACTION_TYPE.var_modify, jun.animator, [ jun.is_anim, "is_anim", _name + " animation" ]);
jun.setAnim(!jun.is_anim);
anim_hold = jun.is_anim;
}
@ -74,15 +76,15 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
}
if(global_var)
if(string_pos(" ", jun.name)) cc = COLORS._main_value_negative;
if(string_pos(" ", _name)) cc = COLORS._main_value_negative;
draw_set_text(breakLine? f_p0 : f_p1, fa_left, fa_center, cc);
draw_text_add(xx + ui(40), lb_y - ui(2), jun.name);
var lb_w = string_width(jun.name) + ui(48);
draw_text_add(xx + ui(40), lb_y - ui(2), _name);
var lb_w = string_width(_name) + ui(48);
#region tooltip
if(jun.tooltip != "") {
var tx = xx + ui(40) + string_width(jun.name) + ui(16);
var tx = xx + ui(40) + string_width(_name) + ui(16);
var ty = lb_y - ui(1);
if(point_in_circle(_m[0], _m[1], tx, ty, ui(10))) {
@ -187,7 +189,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_pop_text", "Pop up Editor"), THEME.text_popup, 0, cc) == 2) {
if(jun.expUse) jun.popup_dialog = dialogPanelCall(new Panel_Text_Editor(jun.express_edit, function() { return context.expression; }, jun));
else jun.popup_dialog = dialogPanelCall(new Panel_Text_Editor(jun.editWidget, function() { return context.showValue(); }, jun));
jun.popup_dialog.content.title = $"{jun.node.name} - {jun.name}";
jun.popup_dialog.content.title = $"{jun.node.name} - {_name}";
}
}
}

View file

@ -17,8 +17,8 @@
location = noone;
static getName = function() { return name; /*__txt_node_name(node, name); */ }
static getTooltip = function() { return tooltip; /*__txt_node_tooltip(node, tooltip); */ }
static getName = function() { return name; }
static getTooltip = function() { return tooltip; }
static build = function(_x = 0, _y = 0, _group = PANEL_GRAPH.getCurrentContext(), _param = {}) {
var _n = [];

View file

@ -16,7 +16,7 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
var ty = _y;
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text_add(_x + ui(16), ty + ui(4), "Bones");
draw_text_add(_x + ui(16), ty + ui(4), __txt("Bones"));
ty += ui(32);

View file

@ -84,7 +84,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
var ty = _y;
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text_add(_x + ui(16), ty + ui(4), "Bones");
draw_text_add(_x + ui(16), ty + ui(4), __txt("Bones"));
ty += ui(32);
@ -192,7 +192,7 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
//draw_line(_x + 16, ty - ui(4), _x + _w - 16, ty - ui(4));
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text_add(_x + ui(16), ty + ui(4), "Surfaces");
draw_text_add(_x + ui(16), ty + ui(4), __txt("Surfaces"));
ty += ui(32);

View file

@ -253,8 +253,7 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) const
if(ds_map_exists(boneMap, _id)) {
var _inp = boneMap[? _id];
_inp.name = bone.name;
_inp.updateName();
_inp.updateName(bone.name);
var _trn = _inp.getValue();

View file

@ -21,6 +21,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
str = string_replace_all(str, "/", "");
str = string_replace_all(str, "-", "");
ds_map_delete(PROJECT.nodeNameMap, internalName);
internalName = str + string(irandom_range(10000, 99999));
PROJECT.nodeNameMap[? internalName] = self;
} #endregion
@ -35,7 +36,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
run_in(1, function() {
if(display_name != "") return;
resetInternalName();
display_name = name; //__txt_node_name(instanceof(self), name);
display_name = __txt_node_name(instanceof(self), name);
});
} #endregion

View file

@ -160,14 +160,14 @@ function variable_editor(nodeVal) constructor {
tb_step.setFocusHover(_focus, _hover);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub);
draw_text(_x + ui(8), _y + wd_h / 2, "Range");
draw_text(_x + ui(8), _y + wd_h / 2, __txt("Range"));
vb_range.draw(_x + lb_w, _y, _w - lb_w, wd_h, slider_range, noone, _m);
_h += wd_h + ui(4);
_y += wd_h + ui(4);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub);
draw_text(_x + ui(8), _y + wd_h / 2, "Step");
draw_text(_x + ui(8), _y + wd_h / 2, __txt("Step"));
tb_step.draw(_x + lb_w, _y, _w - lb_w, wd_h, slider_step , _m);
_h += wd_h + ui(8);

View file

@ -31,8 +31,8 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
return self;
}
static getName = function() { return name; /*__txt_node_name(node, name); */ }
static getTooltip = function() { return tooltip; /*__txt_node_tooltip(node, tooltip); */ }
static getName = function() { return __txt_node_name(node, name); }
static getTooltip = function() { return __txt_node_tooltip(node, tooltip); }
static build = function(_x = 0, _y = 0, _group = PANEL_GRAPH.getCurrentContext(), _param = {}) {
var _node;
@ -680,6 +680,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
ds_list_add(node, "Debug");
addNodeObject(node, "Print", s_node_print, "Node_Print", [1, Node_Print], ["debug log"], "Display text to notification.").setVersion(1145);
addNodeObject(node, "Widget Test", s_node_print, "Node_Widget_Test", [1, Node_Widget_Test]);
ds_list_add(node, "System");
addNodeObject(node, "Execute Shell", s_node_shell_excecute, "Node_Shell", [1, Node_Shell], ["terminal", "execute", "run"], "Execute shell script.").setVersion(11530);

View file

@ -30,7 +30,7 @@ function Node_String_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
if(string_length(str) == 0) {
draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub);
draw_text_cut(cx, cy, "None", w - ui(6), _s);
draw_text_cut(cx, cy, __txt("None"), w - ui(6), _s);
return;
}

View file

@ -454,10 +454,15 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
index = _connect == JUNCTION_CONNECT.input? ds_list_size(node.inputs) : ds_list_size(node.outputs);
type = _type;
forward = true;
_initName = _name;
name = __txt_junction_name(instanceof(node), type, index, _name);
name = _name;
static updateName = function(_name) {
name = _name;
internalName = string_lower(string_replace_all(name, " ", "_"));
name_custom = true;
} updateName(_name);
name_custom = false;
switch(type) {
case VALUE_TYPE.PCXnode :
@ -465,10 +470,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
}
static updateName = function() {
internalName = string_lower(string_replace_all(name, " ", "_"));
} updateName();
if(struct_has(node, "inputMap")) {
if(_connect == JUNCTION_CONNECT.input) node.inputMap[? internalName] = self;
else if(_connect == JUNCTION_CONNECT.output) node.outputMap[? internalName] = self;
@ -605,6 +606,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return self;
} #endregion
static getName = function() { #region
if(name_custom) return name;
return __txt_junction_name(instanceof(node), connect_type, index, name);
} #endregion
static resetValue = function() { setValue(def_val); }
static setUnitRef = function(ref, mode = VALUE_UNIT.constant) { #region
@ -883,6 +889,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
extract_node = "";
break; #endregion
case VALUE_DISPLAY.enum_scroll : #region
display_data = __txt_junction_data(instanceof(node), connect_type, index, display_data);
editWidget = new scrollBox(display_data, function(val) {
if(val == -1) return;
return setValueDirect(toNumber(val));
@ -896,6 +904,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
extract_node = "";
break; #endregion
case VALUE_DISPLAY.enum_button : #region
display_data = __txt_junction_data(instanceof(node), connect_type, index, display_data);
editWidget = new buttonGroup(display_data, function(val) {
return setValueDirect(val);
} );
@ -2224,6 +2234,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
_map.animators = _anims;
_map.data = extra_data;
_map.name_custom = name_custom;
return _map;
} #endregion
@ -2251,6 +2263,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
draw_line_shift_x = struct_try_get(_map, "shift_x");
draw_line_shift_y = struct_try_get(_map, "shift_y");
name_custom = struct_try_get(_map, "name_custom", false);
animator.deserialize(struct_try_get(_map, "raw_value"), scale);
if(struct_has(_map, "animators")) {

View file

@ -115,7 +115,7 @@ function Node_Websocket_Receiver(_x, _y, _group = noone) : Node(_x, _y, _group)
draw_set_alpha(0.75);
draw_text_add(bbox.xc, bbox.y0, $"Port {port}", _ts);
draw_set_valign(fa_bottom)
draw_text_add(bbox.xc, bbox.y1, $"{connected_device} Connected", _ts);
draw_text_add(bbox.xc, bbox.y1, $"{connected_device} " + __txt("Connected"), _ts);
draw_set_alpha(1);
draw_sprite_fit(THEME.node_websocket_receive, 0, bbox.xc, (_y0 + _y1) / 2, bbox.w, _y1 - _y0, cc, aa);

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "process",
"path": "folders/nodes/data/process.yy",
},
"resourceVersion": "1.0",
"name": "node_outline",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,58 @@
function Node_Widget_Test(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Widget Test";
w = 96;
min_h = 32 + 24 * 1;
draw_padding = 8;
inputs[| 0] = nodeValue("textBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY._default)
inputs[| 1] = nodeValue("rangeBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) .setDisplay(VALUE_DISPLAY.range)
inputs[| 2] = nodeValue("vectorBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) .setDisplay(VALUE_DISPLAY.vector)
inputs[| 3] = nodeValue("vectorRangeBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0, 0, 0]) .setDisplay(VALUE_DISPLAY.vector_range)
inputs[| 4] = nodeValue("rotator", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY.rotation)
inputs[| 5] = nodeValue("rotatorRange", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) .setDisplay(VALUE_DISPLAY.rotation_range)
inputs[| 6] = nodeValue("rotatorRandom", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0, 0, 0, 0]) .setDisplay(VALUE_DISPLAY.rotation_random)
inputs[| 7] = nodeValue("slider", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ])
inputs[| 8] = nodeValue("sliderRange", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) .setDisplay(VALUE_DISPLAY.slider_range, [ 0, 1, 0.01 ])
inputs[| 9] = nodeValue("areaBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.area)
inputs[| 10] = nodeValue("paddingBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.padding)
inputs[| 11] = nodeValue("cornerBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.corner)
inputs[| 12] = nodeValue("controlPointBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.puppet_control)
inputs[| 13] = nodeValue("scrollBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Choice 1", "Choice 2" ])
inputs[| 14] = nodeValue("buttonGroup", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY.enum_button, [ "Choice 1", "Choice 2" ])
inputs[| 15] = nodeValue("matrixGrid", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, array_create(9)) .setDisplay(VALUE_DISPLAY.matrix, 3)
inputs[| 16] = nodeValue("transformBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.transform)
inputs[| 17] = nodeValue("toggleGroup", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY.toggle)
inputs[| 18] = nodeValue("quarternionBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.d3quarternion)
inputs[| 19] = nodeValue("checkBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false) .setDisplay(VALUE_DISPLAY._default)
inputs[| 20] = nodeValue("buttonColor", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, 0) .setDisplay(VALUE_DISPLAY._default)
inputs[| 21] = nodeValue("buttonPalette", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, DEF_PALETTE) .setDisplay(VALUE_DISPLAY.palette)
inputs[| 22] = nodeValue("buttonGradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white)) .setDisplay(VALUE_DISPLAY._default)
inputs[| 23] = nodeValue("pathArrayBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, []) .setDisplay(VALUE_DISPLAY.path_array, [ "*.png" ])
inputs[| 24] = nodeValue("textBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_load)
inputs[| 25] = nodeValue("textBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_save)
inputs[| 26] = nodeValue("fontScrollBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_font)
inputs[| 27] = nodeValue("curveBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11) .setDisplay(VALUE_DISPLAY._default)
inputs[| 28] = nodeValue("textArea", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "") .setDisplay(VALUE_DISPLAY._default)
inputs[| 29] = nodeValue("textBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "") .setDisplay(VALUE_DISPLAY.text_box)
inputs[| 30] = nodeValue("textArea", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "") .setDisplay(VALUE_DISPLAY.codeLUA)
inputs[| 31] = nodeValue("textArea", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "") .setDisplay(VALUE_DISPLAY.codeHLSL)
inputs[| 32] = nodeValue("textArrayBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, []) .setDisplay(VALUE_DISPLAY.text_array, [ "Choice 1", "Choice 2" ])
inputs[| 33] = nodeValue("surfaceBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone) .setDisplay(VALUE_DISPLAY._default)
input_display_list = [
["Number", false], 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
["Boolean", false], 19,
["Color", false], 20, 21, 22,
["Path", false], 23, 24, 25, 26,
["Curve", false], 27,
["Text", false], 28, 29, 30, 31, 32,
["Surface", false], 33,
];
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_widget_test",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "misc",
"path": "folders/nodes/data/misc.yy",
},
}

View file

@ -493,13 +493,13 @@ function Panel_Inspector() : PanelContent() constructor {
if(!jun.show_in_inspector || jun.type == VALUE_TYPE.object) continue;
if(filter_text != "") {
var pos = string_pos(filter_text, string_lower(jun.name));
var pos = string_pos(filter_text, string_lower(jun.getName()));
if(pos == 0) continue;
}
#region ++++ draw widget ++++
var lb_h = line_get_height(f_p0) + ui(8);
var lb_w = line_get_width(jun.name, f_p0) + ui(16);
var lb_w = line_get_width(jun.getName(), f_p0) + ui(16);
var padd = ui(8);
var _selY = yy - ui(0);

View file

@ -90,16 +90,24 @@ function Panel_Node_Data_Gen() : PanelContent() constructor {
for( var i = 0; i < ds_list_size(_b.inputs); i++ ) {
_din[i] = __node_data_clone(_b.inputs[| i]);
var _in = _b.inputs[| i];
_jin[i] = {
type: _b.inputs[| i].type,
visible: _b.inputs[| i].visible? 1 : 0,
type: _in.type,
visible: _in.visible? 1 : 0,
};
_lin[i] = {
name: _b.inputs[| i]._initName,
tooltip: _b.inputs[| i].tooltip,
name: _in._initName,
tooltip: _in.tooltip,
};
switch(_in.display_type) {
case VALUE_DISPLAY.enum_button :
case VALUE_DISPLAY.enum_scroll :
_lin[i].display_data = _in.display_data;
break;
}
}
for( var i = 0; i < ds_list_size(_b.outputs); i++ ) {

View file

@ -17,7 +17,7 @@ function quarternionBox(_onModify) : widget() constructor {
size = 4;
axis = [ "x", "y", "z", "w" ];
tooltip = new tooltipSelector("Angle type", ["Quaternion", "Euler"]);
tooltip = new tooltipSelector("Angle type", [__txt("Quaternion"), __txt("Euler")]);
disp_w = noone;
clickable = true;

View file

@ -3,8 +3,8 @@ function rangeBox(_type, _onModify) : widget() constructor {
extra_data = { linked : false };
tooltip = new tooltipSelector("Value Type", [
__txt("Random Range"),
__txt("Constant"),
__txtx("widget_range_random", "Random Range"),
__txtx("widget_range_constant", "Constant"),
]);
onModifyIndex = function(index, val) {

View file

@ -11,7 +11,12 @@ function rotatorRandom(_onModify) : widget() constructor {
tb_min_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(3, val); } ).setSlidable(true, 1);
tb_max_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(4, val); } ).setSlidable(true, 1);
tooltip = new tooltipSelector("Mode", ["Range", "Span", "Double Range", "Double Span"]);
tooltip = new tooltipSelector("Mode", [
__txtx("widget_rotator_random_range", "Range"),
__txtx("widget_rotator_random_span", "Span"),
__txtx("widget_rotator_random_double_range", "Double Range"),
__txtx("widget_rotator_random_double_span", "Double Span")
]);
static setInteract = function(interactable = noone) {
self.interactable = interactable;

View file

@ -12,7 +12,7 @@ function shell_execute(path, command, ref = noone) {
try {
var res = execute_shell(path, command);
noti_status("Execute shell complete", THEME.noti_icon_console, COLORS._main_accent, ref);
noti_status("Execute shell complete", THEME.noti_icon_console,, ref);
} catch(e) {
noti_warning($"Execute shell failed: {e}", THEME.noti_icon_console_failed, COLORS._main_value_negative, ref);
}

View file

@ -60,7 +60,7 @@ function transformBox(_onModify) : widget() constructor {
var lbw = ui(80);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner);
draw_text_add(_x, _y + tbh / 2, "Position");
draw_text_add(_x, _y + tbh / 2, __txt("Position"));
var tbw = (_w - lbw) / 2 - ui(4);
tb[TRANSFORM.pos_x].draw(_x + lbw, _y, tbw, tbh, _data[TRANSFORM.pos_x], _m);
@ -76,7 +76,7 @@ function transformBox(_onModify) : widget() constructor {
_y += ui(72);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner);
draw_text_add(_x, _y + tbh / 2, "Scale");
draw_text_add(_x, _y + tbh / 2, __txt("Scale"));
var tbw = array_length(_data) > 4? (_w - lbw) / 2 - ui(4) : _w - lbw;

View file

@ -5,8 +5,8 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const
extra_data = { linked : false };
tooltip = new tooltipSelector("Value Type", [
__txt("Random Range"),
__txt("Constant"),
__txtx("widget_range_random", "Random Range"),
__txtx("widget_range_constant", "Constant"),
]);
onModifyIndex = function(index, val) {