This commit is contained in:
Tanasart 2024-12-16 18:03:02 +07:00
parent 62d96ff44e
commit 0bb2417839
93 changed files with 1830 additions and 1186 deletions

View file

@ -63,6 +63,7 @@
{"name":"variables","order":37,"path":"folders/functions/variables.yy",}, {"name":"variables","order":37,"path":"folders/functions/variables.yy",},
{"name":"vector","order":38,"path":"folders/functions/vector.yy",}, {"name":"vector","order":38,"path":"folders/functions/vector.yy",},
{"name":"window","order":39,"path":"folders/functions/window.yy",}, {"name":"window","order":39,"path":"folders/functions/window.yy",},
{"name":"game engines","order":335,"path":"folders/game engines.yy",},
{"name":"main","order":328,"path":"folders/main.yy",}, {"name":"main","order":328,"path":"folders/main.yy",},
{"name":"components","order":3,"path":"folders/main/components.yy",}, {"name":"components","order":3,"path":"folders/main/components.yy",},
{"name":"misc","order":338,"path":"folders/misc.yy",}, {"name":"misc","order":338,"path":"folders/misc.yy",},
@ -92,7 +93,6 @@
{"name":"effects","order":4,"path":"folders/nodes/data/filter/effects.yy",}, {"name":"effects","order":4,"path":"folders/nodes/data/filter/effects.yy",},
{"name":"fixes","order":5,"path":"folders/nodes/data/filter/fixes.yy",}, {"name":"fixes","order":5,"path":"folders/nodes/data/filter/fixes.yy",},
{"name":"warps","order":6,"path":"folders/nodes/data/filter/warps.yy",}, {"name":"warps","order":6,"path":"folders/nodes/data/filter/warps.yy",},
{"name":"game engines","order":335,"path":"folders/game engines.yy",},
{"name":"generator","order":5,"path":"folders/nodes/data/generator.yy",}, {"name":"generator","order":5,"path":"folders/nodes/data/generator.yy",},
{"name":"noise","order":1,"path":"folders/nodes/data/generator/noise.yy",}, {"name":"noise","order":1,"path":"folders/nodes/data/generator/noise.yy",},
{"name":"pattern","order":2,"path":"folders/nodes/data/generator/pattern.yy",}, {"name":"pattern","order":2,"path":"folders/nodes/data/generator/pattern.yy",},
@ -483,7 +483,8 @@
{"name":"BBMOD_Vec3","order":5,"path":"scripts/BBMOD_Vec3/BBMOD_Vec3.yy",}, {"name":"BBMOD_Vec3","order":5,"path":"scripts/BBMOD_Vec3/BBMOD_Vec3.yy",},
{"name":"BBMOD_Vec4","order":6,"path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",}, {"name":"BBMOD_Vec4","order":6,"path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",},
{"name":"bin_function","order":11,"path":"scripts/bin_function/bin_function.yy",}, {"name":"bin_function","order":11,"path":"scripts/bin_function/bin_function.yy",},
{"name":"binder_gamemaker_room","order":4,"path":"scripts/binder_gamemaker_room/binder_gamemaker_room.yy",}, {"name":"binder_gamemaker_room","order":5,"path":"scripts/binder_gamemaker_room/binder_gamemaker_room.yy",},
{"name":"binder_gamemaker_tile","order":4,"path":"scripts/binder_gamemaker_tile/binder_gamemaker_tile.yy",},
{"name":"binder_gamemaker","order":3,"path":"scripts/binder_gamemaker/binder_gamemaker.yy",}, {"name":"binder_gamemaker","order":3,"path":"scripts/binder_gamemaker/binder_gamemaker.yy",},
{"name":"biterator","order":1,"path":"scripts/biterator/biterator.yy",}, {"name":"biterator","order":1,"path":"scripts/biterator/biterator.yy",},
{"name":"buffer_object","order":1,"path":"scripts/buffer_object/buffer_object.yy",}, {"name":"buffer_object","order":1,"path":"scripts/buffer_object/buffer_object.yy",},
@ -634,7 +635,7 @@
{"name":"function_register","order":2,"path":"scripts/function_register/function_register.yy",}, {"name":"function_register","order":2,"path":"scripts/function_register/function_register.yy",},
{"name":"fx_controller","order":1,"path":"scripts/fx_controller/fx_controller.yy",}, {"name":"fx_controller","order":1,"path":"scripts/fx_controller/fx_controller.yy",},
{"name":"gameframe","order":3,"path":"scripts/gameframe/gameframe.yy",}, {"name":"gameframe","order":3,"path":"scripts/gameframe/gameframe.yy",},
{"name":"gamemakerPathBox","order":5,"path":"scripts/gamemakerPathBox/gamemakerPathBox.yy",}, {"name":"gamemakerPathBox","order":6,"path":"scripts/gamemakerPathBox/gamemakerPathBox.yy",},
{"name":"getGradientData","order":1,"path":"scripts/getGradientData/getGradientData.yy",}, {"name":"getGradientData","order":1,"path":"scripts/getGradientData/getGradientData.yy",},
{"name":"gif_reader","order":4,"path":"scripts/gif_reader/gif_reader.yy",}, {"name":"gif_reader","order":4,"path":"scripts/gif_reader/gif_reader.yy",},
{"name":"globals","order":2,"path":"scripts/globals/globals.yy",}, {"name":"globals","order":2,"path":"scripts/globals/globals.yy",},

View file

@ -101,6 +101,8 @@
{"$GMFolder":"","%Name":"variables","folderPath":"folders/functions/variables.yy","name":"variables","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"variables","folderPath":"folders/functions/variables.yy","name":"variables","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"vector","folderPath":"folders/functions/vector.yy","name":"vector","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"vector","folderPath":"folders/functions/vector.yy","name":"vector","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"window","folderPath":"folders/functions/window.yy","name":"window","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"window","folderPath":"folders/functions/window.yy","name":"window","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"game engines","folderPath":"folders/game engines.yy","name":"game engines","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"gamemaker","folderPath":"folders/game engines/gamemaker.yy","name":"gamemaker","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"main","folderPath":"folders/main.yy","name":"main","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"main","folderPath":"folders/main.yy","name":"main","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"components","folderPath":"folders/main/components.yy","name":"components","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"components","folderPath":"folders/main/components.yy","name":"components","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"misc","folderPath":"folders/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"misc","folderPath":"folders/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",},
@ -140,8 +142,6 @@
{"$GMFolder":"","%Name":"effects","folderPath":"folders/nodes/data/filter/effects.yy","name":"effects","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"effects","folderPath":"folders/nodes/data/filter/effects.yy","name":"effects","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"fixes","folderPath":"folders/nodes/data/filter/fixes.yy","name":"fixes","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"fixes","folderPath":"folders/nodes/data/filter/fixes.yy","name":"fixes","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"warps","folderPath":"folders/nodes/data/filter/warps.yy","name":"warps","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"warps","folderPath":"folders/nodes/data/filter/warps.yy","name":"warps","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"game engines","folderPath":"folders/game engines.yy","name":"game engines","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"gamemaker","folderPath":"folders/game engines/gamemaker.yy","name":"gamemaker","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"generator","folderPath":"folders/nodes/data/generator.yy","name":"generator","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"generator","folderPath":"folders/nodes/data/generator.yy","name":"generator","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"drawer","folderPath":"folders/nodes/data/generator/drawer.yy","name":"drawer","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"drawer","folderPath":"folders/nodes/data/generator/drawer.yy","name":"drawer","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"noise","folderPath":"folders/nodes/data/generator/noise.yy","name":"noise","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"noise","folderPath":"folders/nodes/data/generator/noise.yy","name":"noise","resourceType":"GMFolder","resourceVersion":"2.0",},
@ -944,6 +944,7 @@
{"id":{"name":"BBMOD_Vec4","path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",},}, {"id":{"name":"BBMOD_Vec4","path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",},},
{"id":{"name":"bin_function","path":"scripts/bin_function/bin_function.yy",},}, {"id":{"name":"bin_function","path":"scripts/bin_function/bin_function.yy",},},
{"id":{"name":"binder_gamemaker_room","path":"scripts/binder_gamemaker_room/binder_gamemaker_room.yy",},}, {"id":{"name":"binder_gamemaker_room","path":"scripts/binder_gamemaker_room/binder_gamemaker_room.yy",},},
{"id":{"name":"binder_gamemaker_tile","path":"scripts/binder_gamemaker_tile/binder_gamemaker_tile.yy",},},
{"id":{"name":"binder_gamemaker","path":"scripts/binder_gamemaker/binder_gamemaker.yy",},}, {"id":{"name":"binder_gamemaker","path":"scripts/binder_gamemaker/binder_gamemaker.yy",},},
{"id":{"name":"biterator","path":"scripts/biterator/biterator.yy",},}, {"id":{"name":"biterator","path":"scripts/biterator/biterator.yy",},},
{"id":{"name":"blurSurface","path":"scripts/blurSurface/blurSurface.yy",},}, {"id":{"name":"blurSurface","path":"scripts/blurSurface/blurSurface.yy",},},

View file

@ -39,14 +39,14 @@ if !ready exit;
var bx = dialog_x + dialog_w - ui(44); var bx = dialog_x + dialog_w - ui(44);
var by = dialog_y + ui(16); var by = dialog_y + ui(16);
var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS,
PREFERENCES.dialog_add_node_view? __txtx("view_list", "List view") : __txtx("view_grid", "Grid view"), PREFERENCES.dialog_add_node_view? __txtx("view_list", "List view") : __txtx("view_grid", "Grid view"),
THEME.view_mode, PREFERENCES.dialog_add_node_view, COLORS._main_icon); THEME.view_mode, PREFERENCES.dialog_add_node_view, COLORS._main_icon);
if(b == 2) if(b == 2)
PREFERENCES.dialog_add_node_view = !PREFERENCES.dialog_add_node_view; PREFERENCES.dialog_add_node_view = !PREFERENCES.dialog_add_node_view;
bx -= ui(32); bx -= ui(32);
var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS,
PREFERENCES.dialog_add_node_grouping? __txtx("add_node_group_enabled", "Group enabled") : __txtx("add_node_group_disabled", "Group disabled"), PREFERENCES.dialog_add_node_grouping? __txtx("add_node_group_enabled", "Group enabled") : __txtx("add_node_group_disabled", "Group disabled"),
THEME.view_group, PREFERENCES.dialog_add_node_grouping, COLORS._main_icon); THEME.view_group, PREFERENCES.dialog_add_node_grouping, COLORS._main_icon);
if(b == 2) if(b == 2)
@ -56,14 +56,14 @@ if !ready exit;
var txt = node_show_connectable? __txtx("add_node_show_connect", "Showing connectable") : __txtx("add_node_show_all", "Showing all"); var txt = node_show_connectable? __txtx("add_node_show_connect", "Showing connectable") : __txtx("add_node_show_all", "Showing all");
var cc = node_show_connectable? COLORS._main_accent : COLORS._main_icon; var cc = node_show_connectable? COLORS._main_accent : COLORS._main_icon;
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.filter_type, node_show_connectable, cc) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS, txt, THEME.filter_type, node_show_connectable, cc) == 2)
node_show_connectable = !node_show_connectable; node_show_connectable = !node_show_connectable;
} }
if(search_string != "") { if(search_string != "") {
var txt = __txtx("add_node_highlight", "Hightlight Query"); var txt = __txtx("add_node_highlight", "Hightlight Query");
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.add_node_search_high, PREFERENCES.dialog_add_node_search_high, COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS, txt, THEME.add_node_search_high, PREFERENCES.dialog_add_node_search_high, COLORS._main_icon) == 2)
PREFERENCES.dialog_add_node_search_high = !PREFERENCES.dialog_add_node_search_high; PREFERENCES.dialog_add_node_search_high = !PREFERENCES.dialog_add_node_search_high;
} }
#endregion #endregion

View file

@ -44,16 +44,16 @@ if !ready exit;
var by = dialog_y + ui(12); var by = dialog_y + ui(12);
var bs = ui(28); var bs = ui(28);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_20) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txt("Refresh"), THEME.refresh_20) == 2)
__initPalette(); __initPalette();
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.path_open_20) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txtx("color_selector_open_palette", "Open palette folder"), THEME.path_open_20) == 2)
shellOpenExplorer($"{DIRECTORY}Palettes"); shellOpenExplorer($"{DIRECTORY}Palettes");
draw_sprite_ui_uniform(THEME.path_open_20, 1, bx + bs / 2, by + bs / 2, 1, c_white); draw_sprite_ui_uniform(THEME.path_open_20, 1, bx + bs / 2, by + bs / 2, 1, c_white);
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Show on Selector"), THEME.display_palette, NODE_COLOR_SHOW_PALETTE, c_white) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txt("Show on Selector"), THEME.display_palette, NODE_COLOR_SHOW_PALETTE, c_white) == 2)
NODE_COLOR_SHOW_PALETTE = !NODE_COLOR_SHOW_PALETTE; NODE_COLOR_SHOW_PALETTE = !NODE_COLOR_SHOW_PALETTE;
bx -= ui(32); bx -= ui(32);
#endregion #endregion

View file

@ -27,13 +27,13 @@ draw_set_alpha(1);
var by0 = by1 - bh; var by0 = by1 - bh;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Ignore")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Ignore"));
if(b == 2) if(b == 2)
instance_destroy(); instance_destroy();
bx0 -= bw + ui(12); bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Restore")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Restore"));
if(b == 2) { if(b == 2) {
var path = string(DIRECTORY) + "prev_crash.pxc"; var path = string(DIRECTORY) + "prev_crash.pxc";
@ -42,7 +42,7 @@ draw_set_alpha(1);
} }
bx0 = dialog_x + ui(16); bx0 = dialog_x + ui(16);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("crashed_log", "Log file") + "..."); draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("crashed_log", "Log file") + "...");
if(b == 2) { if(b == 2) {
var path = string(DIRECTORY) + "crash_log.txt"; var path = string(DIRECTORY) + "crash_log.txt";

View file

@ -2,8 +2,8 @@
"$GMObject":"", "$GMObject":"",
"%Name":"o_dialog_crashed", "%Name":"o_dialog_crashed",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_crashed", "name":"o_dialog_crashed",

View file

@ -29,7 +29,7 @@ if !ready exit;
var bx = dialog_x + dialog_w - ui(120); var bx = dialog_x + dialog_w - ui(120);
dir_y += ui(48); dir_y += ui(48);
if(buttonInstant(THEME.button_def, bx, dir_y, ui(100), ui(40), mouse_ui, sFOCUS, sHOVER) == 2) { if(buttonInstant(THEME.button_def, bx, dir_y, ui(100), ui(40), mouse_ui, sHOVER, sFOCUS) == 2) {
if(target) { if(target) {
var paths = paths_to_array_ext(dir_paths, dir_filter); var paths = paths_to_array_ext(dir_paths, dir_filter);
target.updatePaths(paths); target.updatePaths(paths);

View file

@ -42,13 +42,13 @@ if(sFOCUS) DIALOG_DRAW_FOCUS
var by0 = by1 - bh; var by0 = by1 - bh;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel"));
if(b == 2) if(b == 2)
_des = true; _des = true;
bx0 -= bw + ui(12); bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("dont_save", "Don't save")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("dont_save", "Don't save"));
if(b == 2) { if(b == 2) {
if(instance_number(o_dialog_exit) == 1) if(instance_number(o_dialog_exit) == 1)
@ -57,7 +57,7 @@ if(sFOCUS) DIALOG_DRAW_FOCUS
} }
bx0 -= bw + ui(12); bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Save")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Save"));
if(b == 2 && SAVE(project)) { if(b == 2 && SAVE(project)) {
if(instance_number(o_dialog_exit) == 1) if(instance_number(o_dialog_exit) == 1)

View file

@ -2,9 +2,9 @@
"$GMObject":"", "$GMObject":"",
"%Name":"o_dialog_exit", "%Name":"o_dialog_exit",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_exit", "name":"o_dialog_exit",

View file

@ -47,7 +47,7 @@
var icon = THEME.accept; var icon = THEME.accept;
var clr = COLORS._main_value_positive; var clr = COLORS._main_value_positive;
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, txt, icon, 0, clr) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sHOVER, sFOCUS, txt, icon, 0, clr) == 2) {
} }
@ -57,7 +57,7 @@
var icon = THEME.cross; var icon = THEME.cross;
var clr = COLORS._main_value_negative; var clr = COLORS._main_value_negative;
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, txt, icon, 0, clr) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sHOVER, sFOCUS, txt, icon, 0, clr) == 2) {
instance_destroy(); instance_destroy();
} }

View file

@ -2,8 +2,8 @@
"$GMObject":"", "$GMObject":"",
"%Name":"o_dialog_file_name_action", "%Name":"o_dialog_file_name_action",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_file_name_action", "name":"o_dialog_file_name_action",

View file

@ -29,7 +29,7 @@
var bx = dialog_x + dialog_w - ui(8) - bw; var bx = dialog_x + dialog_w - ui(8) - bw;
var by = dialog_y + ui(24) - bh / 2; var by = dialog_y + ui(24) - bh / 2;
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, __txt("Close"), THEME.cross_16, 0, COLORS._main_value_negative) == 2) if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sHOVER, sFOCUS, __txt("Close"), THEME.cross_16, 0, COLORS._main_value_negative) == 2)
instance_destroy(); instance_destroy();
bx -= bw + ui(4); bx -= bw + ui(4);
@ -59,7 +59,7 @@
instance_destroy(); instance_destroy();
} else { } else {
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, txt, icon, 0, clr) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sHOVER, sFOCUS, txt, icon, 0, clr) == 2) {
if(meta.author_steam_id == 0) if(meta.author_steam_id == 0)
meta.author_steam_id = STEAM_USER_ID; meta.author_steam_id = STEAM_USER_ID;
@ -107,7 +107,7 @@
bx -= bw + ui(4); bx -= bw + ui(4);
var txt = __txtx("new_collection_meta_edit", "Edit metadata"); var txt = __txtx("new_collection_meta_edit", "Edit metadata");
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, txt, THEME.arrow, meta_expand? 3 : 0) == 2) if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sHOVER, sFOCUS, txt, THEME.arrow, meta_expand? 3 : 0) == 2)
doExpand(); doExpand();
#endregion #endregion

View file

@ -2,8 +2,8 @@
"$GMObject":"", "$GMObject":"",
"%Name":"o_dialog_file_name_collection", "%Name":"o_dialog_file_name_collection",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_file_name_collection", "name":"o_dialog_file_name_collection",

View file

@ -49,7 +49,7 @@ if !ready exit;
var by = dialog_y + ui(12); var by = dialog_y + ui(12);
var bs = ui(28); var bs = ui(28);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset"), THEME.add_20) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txtx("add_preset", "Add to preset"), THEME.add_20) == 2) {
var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8));
dia.onModify = function (txt) { dia.onModify = function (txt) {
var gradStr = ""; var gradStr = "";
@ -66,11 +66,11 @@ if !ready exit;
} }
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_20) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txt("Refresh"), THEME.refresh_20) == 2)
__initGradient(); __initGradient();
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("graident_editor_open_folder", "Open gradient folder"), THEME.path_open_20) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txtx("graident_editor_open_folder", "Open gradient folder"), THEME.path_open_20) == 2) {
var _realpath = DIRECTORY + "Gradients"; var _realpath = DIRECTORY + "Gradients";
shellOpenExplorer(_realpath) shellOpenExplorer(_realpath)
} }
@ -87,7 +87,7 @@ if !ready exit;
var bx = palette_x + palette_w - ui(44); var bx = palette_x + palette_w - ui(44);
var by = dialog_y + ui(12); var by = dialog_y + ui(12);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txt("Show on Selector"), THEME.display_palette, NODE_COLOR_SHOW_PALETTE, c_white) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS, __txt("Show on Selector"), THEME.display_palette, NODE_COLOR_SHOW_PALETTE, c_white) == 2)
NODE_COLOR_SHOW_PALETTE = !NODE_COLOR_SHOW_PALETTE; NODE_COLOR_SHOW_PALETTE = !NODE_COLOR_SHOW_PALETTE;
bx -= ui(32); bx -= ui(32);
#endregion #endregion
@ -98,7 +98,7 @@ if !ready exit;
var bx = content_x + content_w - ui(50); var bx = content_x + content_w - ui(50);
var by = dialog_y + ui(16); var by = dialog_y + ui(16);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("gradient_editor_key_blend", "Key blending"), THEME.grad_blend) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, interactable && sFOCUS, __txtx("gradient_editor_key_blend", "Key blending"), THEME.grad_blend) == 2) {
menuCall("gradient_window_blend_menu", [ menuCall("gradient_window_blend_menu", [
menuItem(__txtx("gradient_editor_blend_hard", "Solid"), function() { gradient.type = 1; onApply(gradient); }), menuItem(__txtx("gradient_editor_blend_hard", "Solid"), function() { gradient.type = 1; onApply(gradient); }),
menuItem(__txtx("gradient_editor_blend_RGB", "RGB"), function() { gradient.type = 0; onApply(gradient); }), menuItem(__txtx("gradient_editor_blend_RGB", "RGB"), function() { gradient.type = 0; onApply(gradient); }),
@ -108,7 +108,7 @@ if !ready exit;
} }
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("gradient_editor_reverse", "Reverse"), THEME.reverse) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, interactable && sFOCUS, __txtx("gradient_editor_reverse", "Reverse"), THEME.reverse) == 2) {
for( var i = 0, n = array_length(gradient.keys); i < n; i++ ) for( var i = 0, n = array_length(gradient.keys); i < n; i++ )
gradient.keys[i].time = 1 - gradient.keys[i].time; gradient.keys[i].time = 1 - gradient.keys[i].time;
gradient.keys = array_reverse(gradient.keys); gradient.keys = array_reverse(gradient.keys);

View file

@ -25,7 +25,7 @@ if !ready exit;
if(type == CONNECT_TYPE.input) { if(type == CONNECT_TYPE.input) {
var _txt = __txtx("dialog_group_order_add", "Add separator"); var _txt = __txtx("dialog_group_order_add", "Add separator");
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, _txt, THEME.add_16, 1, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sHOVER, sFOCUS, _txt, THEME.add_16, 1, COLORS._main_value_positive) == 2) {
array_push(node.attributes.input_display_list, [ "Separator", false ]); array_push(node.attributes.input_display_list, [ "Separator", false ]);
node.sortIO(); node.sortIO();
} }

View file

@ -28,7 +28,7 @@ if !target exit;
var bx = dialog_x + dialog_w - ui(padding - 8) - bw; var bx = dialog_x + dialog_w - ui(padding - 8) - bw;
var by = dialog_y + ui(18); var by = dialog_y + ui(18);
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, __txt("Add") + "...", THEME.add,, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sHOVER, sFOCUS, __txt("Add") + "...", THEME.add,, COLORS._main_value_positive) == 2) {
var path = get_open_filenames_compat("image|*.png;*.jpg", ""); var path = get_open_filenames_compat("image|*.png;*.jpg", "");
key_release(); key_release();
@ -45,6 +45,6 @@ if !target exit;
bx -= ui(36); bx -= ui(36);
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, __txtx("array_edit_sort_name", "Sort by name"), THEME.text) == 2) if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sHOVER, sFOCUS, __txtx("array_edit_sort_name", "Sort by name"), THEME.text) == 2)
sortByName(); sortByName();
#endregion #endregion

View file

@ -28,13 +28,13 @@ draw_set_alpha(1);
var by0 = by1 - bh; var by0 = by1 - bh;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Ignore")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Ignore"));
if(b == 2) if(b == 2)
instance_destroy(); instance_destroy();
bx0 -= bw + ui(12); bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Migrate files")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Migrate files"));
if(b == 2) { if(b == 2) {
var oldDir = env_user(); var oldDir = env_user();
@ -53,7 +53,7 @@ draw_set_alpha(1);
bx0 = dialog_x + ui(16); bx0 = dialog_x + ui(16);
bw = ui(160); bw = ui(160);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("migrate_open_directory", "Open directory") + "..."); draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("migrate_open_directory", "Open directory") + "...");
if(b == 2) { if(b == 2) {
if(directory_exists(DIRECTORY)) if(directory_exists(DIRECTORY))

View file

@ -2,8 +2,8 @@
"$GMObject":"", "$GMObject":"",
"%Name":"o_dialog_migration", "%Name":"o_dialog_migration",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_migration", "name":"o_dialog_migration",

View file

@ -43,7 +43,7 @@ if palette == 0 exit;
var by = dialog_y + ui(12); var by = dialog_y + ui(12);
var bs = ui(28); var bs = ui(28);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset"), THEME.add_20) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txtx("add_preset", "Add to preset"), THEME.add_20) == 2) {
var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8));
dia.onModify = function (txt) { dia.onModify = function (txt) {
var file = file_text_open_write(txt + ".hex"); var file = file_text_open_write(txt + ".hex");
@ -63,11 +63,11 @@ if palette == 0 exit;
} }
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_20) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txt("Refresh"), THEME.refresh_20) == 2)
__initPalette(); __initPalette();
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.path_open_20) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txtx("color_selector_open_palette", "Open palette folder"), THEME.path_open_20) == 2) {
var _realpath = DIRECTORY + "Palettes"; var _realpath = DIRECTORY + "Palettes";
shellOpenExplorer(_realpath) shellOpenExplorer(_realpath)
} }
@ -83,7 +83,7 @@ if palette == 0 exit;
var bc = index_selecting[1] < 2? COLORS._main_icon : merge_color(COLORS._main_icon, COLORS._main_accent, 0.5); var bc = index_selecting[1] < 2? COLORS._main_icon : merge_color(COLORS._main_icon, COLORS._main_accent, 0.5);
var _txt = index_selecting[1] < 2? __txtx("palette_editor_sort", "Sort palette") : __txtx("palette_editor_sort_selected", "Sort selected"); var _txt = index_selecting[1] < 2? __txtx("palette_editor_sort", "Sort palette") : __txtx("palette_editor_sort_selected", "Sort selected");
var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, _txt, THEME.sort, 0, bc); var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, interactable && sFOCUS, _txt, THEME.sort, 0, bc);
if(b) mouse_draggable = false; if(b) mouse_draggable = false;
if(b == 2) { if(b == 2) {
menuCall("palette_window_sort_menu", [ menuCall("palette_window_sort_menu", [
@ -98,7 +98,7 @@ if palette == 0 exit;
bx -= ui(32); bx -= ui(32);
var _txt = index_selecting[1] < 2? __txtx("palette_editor_reverse", "Reverse palette") : __txtx("palette_editor_reverse_selected", "Reverse selected"); var _txt = index_selecting[1] < 2? __txtx("palette_editor_reverse", "Reverse palette") : __txtx("palette_editor_reverse_selected", "Reverse selected");
var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, _txt, THEME.reverse, 0, bc); var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, interactable && sFOCUS, _txt, THEME.reverse, 0, bc);
if(b) mouse_draggable = false; if(b) mouse_draggable = false;
if(b == 2) { if(b == 2) {
@ -358,7 +358,7 @@ if palette == 0 exit;
var by = pl_y - ui(2); var by = pl_y - ui(2);
if(array_length(palette) > 1) { if(array_length(palette) > 1) {
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, "", THEME.minus) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, interactable && sFOCUS, "", THEME.minus) == 2) {
array_delete(palette, index_selecting[0], index_selecting[1]); array_delete(palette, index_selecting[0], index_selecting[1]);
if(array_empty(palette)) if(array_empty(palette))
palette = [ c_black ]; palette = [ c_black ];
@ -371,7 +371,7 @@ if palette == 0 exit;
} }
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, "", THEME.add) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, interactable && sFOCUS, "", THEME.add) == 2) {
palette[array_length(palette)] = c_black; palette[array_length(palette)] = c_black;
index_selecting = [ array_length(palette), 1 ]; index_selecting = [ array_length(palette), 1 ];
@ -379,7 +379,7 @@ if palette == 0 exit;
} }
bx = content_x + ui(18); bx = content_x + ui(18);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_load", "Load palette file") + " (.hex)", THEME.file) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, interactable && sFOCUS, __txtx("palette_editor_load", "Load palette file") + " (.hex)", THEME.file) == 2) {
var path = get_open_filename_pxc("HEX palette|*.hex", ""); var path = get_open_filename_pxc("HEX palette|*.hex", "");
key_release(); key_release();

View file

@ -59,7 +59,7 @@ if(content.showHeader) {
var _bs = ui(20); var _bs = ui(20);
if(instanceof(content) != "Panel_Menu") if(instanceof(content) != "Panel_Menu")
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mouse_mx, mouse_my ], sFOCUS, sHOVER, "", THEME.window_exit) == 2) { if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mouse_mx, mouse_my ], sHOVER, sFOCUS, "", THEME.window_exit) == 2) {
DIALOG_POSTDRAW DIALOG_POSTDRAW
onDestroy(); onDestroy();
instance_destroy(); instance_destroy();
@ -88,7 +88,7 @@ var ss = content.showHeader? ui(20) : ui(28);
var sc = content.showHeader? 0.75 : 1; var sc = content.showHeader? 0.75 : 1;
if(window == noone && instanceof(content) != "Panel_Menu") { if(window == noone && instanceof(content) != "Panel_Menu") {
var b = buttonInstant(THEME.button_hide, bx, by, ss, ss, [ mouse_mx, mouse_my ], sFOCUS, sHOVER, txt, THEME.pin, ind, cc, 1, sc); var b = buttonInstant(THEME.button_hide, bx, by, ss, ss, [ mouse_mx, mouse_my ], sHOVER, sFOCUS, txt, THEME.pin, ind, cc, 1, sc);
if(b == 2) destroy_on_click_out = !destroy_on_click_out; if(b == 2) destroy_on_click_out = !destroy_on_click_out;
} }

View file

@ -12,7 +12,7 @@ if !ready exit;
var _by = dialog_y + ui(8); var _by = dialog_y + ui(8);
var _bs = ui(20); var _bs = ui(20);
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mouse_mx, mouse_my ], sFOCUS, sHOVER, "", THEME.window_exit) == 2) { if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mouse_mx, mouse_my ], sHOVER, sFOCUS, "", THEME.window_exit) == 2) {
DIALOG_POSTDRAW DIALOG_POSTDRAW
onDestroy(); onDestroy();
instance_destroy(); instance_destroy();
@ -38,7 +38,7 @@ if !ready exit;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_value_positive); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_value_positive);
draw_text(cx, _ty, txt); draw_text(cx, _ty, txt);
if(buttonInstant(THEME.button_def, _bx, _by, _bw, _bh, mouse_ui, sFOCUS, sHOVER) == 2) { if(buttonInstant(THEME.button_def, _bx, _by, _bw, _bh, mouse_ui, sHOVER, sFOCUS) == 2) {
var _path = DIRECTORY + "patreon"; var _path = DIRECTORY + "patreon";
file_delete(_path); file_delete(_path);
IS_PATREON = false; IS_PATREON = false;

View file

@ -659,7 +659,7 @@ event_inherited();
draw_set_text(font, fa_left, fa_center, COLORS._main_text); draw_set_text(font, fa_left, fa_center, COLORS._main_text);
draw_text_add(ui(24), yy + th / 2, keyStr); draw_text_add(ui(24), yy + th / 2, keyStr);
var b = buttonInstant(THEME.button_def, cx, yy + cp, cw, ch, _m, sFOCUS, sHOVER && sp_colors.hover); var b = buttonInstant(THEME.button_def, cx, yy + cp, cw, ch, _m, sHOVER, sFOCUS && sp_colors.hover);
draw_sprite_stretched_ext(THEME.palette_mask, 1, cx + ui(2), yy + ui(2), cw - ui(4), ch - ui(4), val, 1); draw_sprite_stretched_ext(THEME.palette_mask, 1, cx + ui(2), yy + ui(2), cw - ui(4), ch - ui(4), val, 1);
if(b) sp_colors.hover_content = true; if(b) sp_colors.hover_content = true;
@ -838,7 +838,7 @@ event_inherited();
modified = true; modified = true;
var bx = _ww - ui(32); var bx = _ww - ui(32);
var by = _yy + th / 2 - ui(12); var by = _yy + th / 2 - ui(12);
var b = buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, _hov, __txt("Reset"), THEME.refresh_16); var b = buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, _hov, sFOCUS, __txt("Reset"), THEME.refresh_16);
if(b) sp_hotkey.hover_content = true; if(b) sp_hotkey.hover_content = true;
if(b == 2) { if(b == 2) {
@ -968,7 +968,7 @@ event_inherited();
if(isEqual(data, _defVal)) if(isEqual(data, _defVal))
draw_sprite_ext(THEME.refresh_16, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark); draw_sprite_ext(THEME.refresh_16, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark);
else { else {
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, sFOCUS, sHOVER && sp_pref.hover, __txt("Reset"), THEME.refresh_16) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, sHOVER, sFOCUS && sp_pref.hover, __txt("Reset"), THEME.refresh_16) == 2)
_pref.onEdit(_defVal); _pref.onEdit(_defVal);
} }
} }

View file

@ -11,7 +11,7 @@ if !ready exit;
var bx = dialog_x + ui(24); var bx = dialog_x + ui(24);
var by = dialog_y + ui(18); var by = dialog_y + ui(18);
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? __txt("Pin") : __txt("Unpin"), if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS, destroy_on_click_out? __txt("Pin") : __txt("Unpin"),
THEME.pin, !destroy_on_click_out, destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light) == 2) THEME.pin, !destroy_on_click_out, destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light) == 2)
destroy_on_click_out = !destroy_on_click_out; destroy_on_click_out = !destroy_on_click_out;
@ -74,7 +74,7 @@ if !ready exit;
var _x = dialog_x + dialog_w - ui(8); var _x = dialog_x + dialog_w - ui(8);
var bx = _x - ui(48); var bx = _x - ui(48);
var _txt = __txtx("pref_reset_color", "Reset colors"); var _txt = __txtx("pref_reset_color", "Reset colors");
var b = buttonInstant(THEME.button_hide, bx, py, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, _txt, THEME.refresh_icon); var b = buttonInstant(THEME.button_hide, bx, py, ui(32), ui(32), mouse_ui, sHOVER, sFOCUS, _txt, THEME.refresh_icon);
if(b == 2) { if(b == 2) {
var path = $"{DIRECTORY}Themes/{PREFERENCES.theme}/override.json"; var path = $"{DIRECTORY}Themes/{PREFERENCES.theme}/override.json";
if(file_exists_empty(path)) file_delete(path); if(file_exists_empty(path)) file_delete(path);

View file

@ -23,7 +23,7 @@ if !ready exit;
var bx = dialog_x + dialog_w - ui(32 + 16); var bx = dialog_x + dialog_w - ui(32 + 16);
var by = dialog_y + ui(16); var by = dialog_y + ui(16);
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, __txtx("preset_new", "New preset"), THEME.add, 1) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sHOVER, sFOCUS, __txtx("preset_new", "New preset"), THEME.add, 1) == 2) {
adding = !adding; adding = !adding;
if(adding) tb_add.activate(); if(adding) tb_add.activate();
} }

View file

@ -22,7 +22,7 @@ if !ready exit;
var r = __txt(pages[i]); var r = __txt(pages[i]);
var rw = string_width(r); var rw = string_width(r);
if(buttonInstant(THEME.button_hide_fill, _x - ui(8), _y - ui(4), rw + ui(16), bh, [ mouse_mx, mouse_my ], sFOCUS, sHOVER) == 2) if(buttonInstant(THEME.button_hide_fill, _x - ui(8), _y - ui(4), rw + ui(16), bh, [ mouse_mx, mouse_my ], sHOVER, sFOCUS) == 2)
page = i; page = i;
draw_set_color(i == page? COLORS._main_text : COLORS._main_text_sub); draw_set_color(i == page? COLORS._main_text : COLORS._main_text_sub);

View file

@ -44,13 +44,13 @@ if !ready exit;
var by0 = by1 - bh; var by0 = by1 - bh;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel"));
if(b == 2) if(b == 2)
instance_destroy(); instance_destroy();
bx0 -= bw + ui(12); bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("run", "Run")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("run", "Run"));
if(b == 2) { if(b == 2) {
shell_execute_async(prog, cmd); shell_execute_async(prog, cmd);

View file

@ -2,8 +2,8 @@
"$GMObject":"", "$GMObject":"",
"%Name":"o_dialog_run_shell", "%Name":"o_dialog_run_shell",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_run_shell", "name":"o_dialog_run_shell",

View file

@ -28,13 +28,13 @@ draw_set_alpha(1);
var by0 = by1 - bh; var by0 = by1 - bh;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel"));
if(b == 2) if(b == 2)
instance_destroy(); instance_destroy();
bx0 -= bw + ui(12); bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("dont_save", "Don't save")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("dont_save", "Don't save"));
if(b == 2) { if(b == 2) {
closeProject(project); closeProject(project);
@ -42,7 +42,7 @@ draw_set_alpha(1);
} }
bx0 -= bw + ui(12); bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sHOVER, sFOCUS);
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Save")); draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Save"));
if(b == 2) { if(b == 2) {
SAVE(project); SAVE(project);

View file

@ -2,8 +2,8 @@
"$GMObject":"", "$GMObject":"",
"%Name":"o_dialog_save", "%Name":"o_dialog_save",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_save", "name":"o_dialog_save",

View file

@ -14,7 +14,7 @@
draw_sprite_stretched(THEME.textbox, 1, dialog_x, dialog_y, dialog_w, dialog_h); draw_sprite_stretched(THEME.textbox, 1, dialog_x, dialog_y, dialog_w, dialog_h);
if(buttonInstant(THEME.button_hide, dialog_x + dialog_w - ui(8) - ui(24), dialog_y + ui(8), ui(24), ui(24), mouse_ui, sFOCUS, sHOVER, "", THEME.scrollbox_direction, horizon) == 2) { if(buttonInstant(THEME.button_hide, dialog_x + dialog_w - ui(8) - ui(24), dialog_y + ui(8), ui(24), ui(24), mouse_ui, sHOVER, sFOCUS, "", THEME.scrollbox_direction, horizon) == 2) {
horizon = !horizon; horizon = !horizon;
setSize(); setSize();
} }

View file

@ -3,8 +3,8 @@
"%Name":"o_dialog_scrollbox_horizontal", "%Name":"o_dialog_scrollbox_horizontal",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_scrollbox_horizontal", "name":"o_dialog_scrollbox_horizontal",

View file

@ -17,7 +17,7 @@ if !ready exit;
var txt = VERSION_STRING; var txt = VERSION_STRING;
var ww = string_width(txt) + ui(8); var ww = string_width(txt) + ui(8);
var hh = line_get_height(, 4); var hh = line_get_height(, 4);
if(buttonInstant(THEME.button_hide_fill, bx - ui(4), by - ui(2), ww, hh, mouse_ui, sFOCUS, sHOVER) == 2) if(buttonInstant(THEME.button_hide_fill, bx - ui(4), by - ui(2), ww, hh, mouse_ui, sHOVER, sFOCUS) == 2)
dialogCall(o_dialog_release_note, WIN_W / 2, WIN_H / 2); dialogCall(o_dialog_release_note, WIN_W / 2, WIN_H / 2);
draw_text(bx, by, txt); draw_text(bx, by, txt);
@ -25,12 +25,12 @@ if !ready exit;
var bs = ui(32); var bs = ui(32);
var bx = dialog_x + dialog_w - ui(16) - bs; var bx = dialog_x + dialog_w - ui(16) - bs;
var by = dialog_y + ui(16); var by = dialog_y + ui(16);
if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Preferences"), THEME.gear) == 2) { if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txt("Preferences"), THEME.gear) == 2) {
dialogCall(o_dialog_preference, WIN_W / 2, WIN_H / 2); dialogCall(o_dialog_preference, WIN_W / 2, WIN_H / 2);
} }
bx -= bs + ui(4); bx -= bs + ui(4);
if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Show on startup"), THEME.icon_splash_show_on_start, PREFERENCES.show_splash) == 2) { if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txt("Show on startup"), THEME.icon_splash_show_on_start, PREFERENCES.show_splash) == 2) {
PREFERENCES.show_splash = !PREFERENCES.show_splash; PREFERENCES.show_splash = !PREFERENCES.show_splash;
PREF_SAVE(); PREF_SAVE();
} }
@ -52,20 +52,20 @@ if !ready exit;
var bx = x1 - ui(28); var bx = x1 - ui(28);
var by = y0 - ui(28 + 4); var by = y0 - ui(28 + 4);
var txt = __txtx("splash_clear_recent", "Clear recent files"); var txt = __txtx("splash_clear_recent", "Clear recent files");
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.icon_delete,, COLORS._main_value_negative) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS, txt, THEME.icon_delete,, COLORS._main_value_negative) == 2) {
ds_list_clear(RECENT_FILES); ds_list_clear(RECENT_FILES);
RECENT_SAVE(); RECENT_SAVE();
} }
// bx -= ui(28 + 4); // bx -= ui(28 + 4);
// txt = recent_thumbnail? __txtx("splash_hide_thumbnail", "Hide thumbnail") : __txtx("splash_show_thumbnail", "Show thumbnail"); // txt = recent_thumbnail? __txtx("splash_hide_thumbnail", "Hide thumbnail") : __txtx("splash_show_thumbnail", "Show thumbnail");
// if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.splash_thumbnail, recent_thumbnail) == 2) { // if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS, txt, THEME.splash_thumbnail, recent_thumbnail) == 2) {
// recent_thumbnail = !recent_thumbnail; // recent_thumbnail = !recent_thumbnail;
// } // }
bx -= ui(28 + 4); bx -= ui(28 + 4);
txt = __txtx("splash_open_autosave", "Open autosave folder"); txt = __txtx("splash_open_autosave", "Open autosave folder");
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.save_auto, 0) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sHOVER, sFOCUS, txt, THEME.save_auto, 0) == 2) {
shellOpenExplorer(DIRECTORY + "autosave"); shellOpenExplorer(DIRECTORY + "autosave");
} }
@ -75,7 +75,7 @@ if !ready exit;
switch(pages[project_page]) { switch(pages[project_page]) {
case "Welcome Files" : case "Welcome Files" :
case "Workshop" : case "Workshop" :
if(buttonInstant(THEME.button_hide_fill, x1, (y0 + y1) / 2 - ui(32), ui(16), ui(32), mouse_ui, sFOCUS, sHOVER,, THEME.arrow, expand? 2 : 0) == 2) { if(buttonInstant(THEME.button_hide_fill, x1, (y0 + y1) / 2 - ui(32), ui(16), ui(32), mouse_ui, sHOVER, sFOCUS,, THEME.arrow, expand? 2 : 0) == 2) {
PREFERENCES.splash_expand_recent = !PREFERENCES.splash_expand_recent; PREFERENCES.splash_expand_recent = !PREFERENCES.splash_expand_recent;
expandAction = true; expandAction = true;
} }
@ -193,11 +193,11 @@ if !ready exit;
var bx = x1 - ui(32); var bx = x1 - ui(32);
var by = y0 - ui(36); var by = y0 - ui(36);
if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("workshop_open", "Open Steam Workshop"), THEME.steam) == 2) if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txtx("workshop_open", "Open Steam Workshop"), THEME.steam) == 2)
steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/"); steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/");
bx -= bs + ui(4); bx -= bs + ui(4);
if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_icon) == 2) if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, mouse_ui, sHOVER, sFOCUS, __txt("Refresh"), THEME.refresh_icon) == 2)
steamUCGload(); steamUCGload();
break; break;

View file

@ -3,9 +3,9 @@
"%Name":"o_dialog_splash", "%Name":"o_dialog_splash",
"eventList":[ "eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":62,"eventType":7,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":62,"eventType":7,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
], ],
"managed":true, "managed":true,
"name":"o_dialog_splash", "name":"o_dialog_splash",

View file

@ -158,7 +158,7 @@ function Panel_Linear_Setting() : PanelContent() constructor {
if(isEqual(_data, _defVal)) if(isEqual(_data, _defVal))
draw_sprite_ext(THEME.refresh_16, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark); draw_sprite_ext(THEME.refresh_16, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark);
else { else {
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, __txt("Reset"), THEME.refresh_16) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pHOVER, pFOCUS, __txt("Reset"), THEME.refresh_16) == 2)
_prop.onEdit(_defVal); _prop.onEdit(_defVal);
} }
} }

View file

@ -167,7 +167,7 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr
var by = _yy; var by = _yy;
var bs = ui(24); var bs = ui(24);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "New rule", THEME.add_16, 0, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "New rule", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
var _new_rl = new tiler_rule(); var _new_rl = new tiler_rule();
_new_rl.name = $"rule {array_length(ruleTiles)}" _new_rl.name = $"rule {array_length(ruleTiles)}"
_new_rl.open = true; _new_rl.open = true;
@ -224,7 +224,7 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr
var bs = ui(24); var bs = ui(24);
var bx = _w - bs - ui(4); var bx = _w - bs - ui(4);
var by = _yy + _hg / 2 - bs / 2; var by = _yy + _hg / 2 - bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
del = i; del = i;
} }

View file

@ -145,7 +145,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
var _bx = _x + _w - _bs; var _bx = _x + _w - _bs;
var _by = _y + _h / 2 - _bs / 2; var _by = _y + _h / 2 - _bs / 2;
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, tooltip, THEME.inspector_area_type, mode) == 2) { if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, hover, active, tooltip, THEME.inspector_area_type, mode) == 2) {
switch(mode) { switch(mode) {
case AREA_MODE.area : //area to padding case AREA_MODE.area : //area to padding
var cx = array_safe_get_fast(_data, 0); var cx = array_safe_get_fast(_data, 0);
@ -193,7 +193,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
var _by = _y + _h + ui(4) + _h / 2 - _bs / 2; var _by = _y + _h + ui(4) + _h / 2 - _bs / 2;
var _btxt = __txtx("widget_area_fill_surface", "Fill surface"); var _btxt = __txtx("widget_area_fill_surface", "Fill surface");
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, _btxt, THEME.fill, 0) == 2) { if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, hover, active, _btxt, THEME.fill, 0) == 2) {
var cnvt = unit != noone && unit.mode == VALUE_UNIT.reference; var cnvt = unit != noone && unit.mode == VALUE_UNIT.reference;
switch(mode) { switch(mode) {
@ -228,7 +228,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
var _bx = _x; var _bx = _x;
var _by = _y + _h / 2 - _bs / 2; var _by = _y + _h / 2 - _bs / 2;
if(useShape && !is_array(_bind) && buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, _bact, _bhov,, THEME.inspector_area, _bind) == 2) { if(useShape && !is_array(_bind) && buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, _bhov, _bact,, THEME.inspector_area, _bind) == 2) {
var val = (array_safe_get_fast(_data, 4) + 1) % 2; var val = (array_safe_get_fast(_data, 4) + 1) % 2;
onModify(val, 4); onModify(val, 4);
} }
@ -238,7 +238,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
var _btxt = __txt("Link values"); var _btxt = __txt("Link values");
var _bby = useShape? _by + _h + ui(4) : _y + h / 2 - _bs / 2; var _bby = useShape? _by + _h + ui(4) : _y + h / 2 - _bs / 2;
if(buttonInstant(THEME.button_hide, _bx, _bby, _bs, _bs, _m, active, hover, _btxt, THEME.value_link, link_value, cc) == 2) if(buttonInstant(THEME.button_hide, _bx, _bby, _bs, _bs, _m, hover, active, _btxt, THEME.value_link, link_value, cc) == 2)
link_value = !link_value; link_value = !link_value;
} }

View file

@ -12,7 +12,7 @@ function Binder_Gamemaker(path) {
return new __Binder_Gamemaker(path); return new __Binder_Gamemaker(path);
} }
function GMObject(_gm, _rpth, _rawData) constructor { function GMAsset(_gm, _rpth, _rawData) constructor {
static serialize_bool_keys = {}; static serialize_bool_keys = {};
gmBinder = _gm; gmBinder = _gm;
@ -31,42 +31,69 @@ function GMObject(_gm, _rpth, _rawData) constructor {
return string(val); return string(val);
} }
static simple_serialize = function(s, _pad, _depth = 0, _nline = false) { static simple_serialize = function(_k, _v, _depth = 1) {
if(is_array(s)) {
if(array_empty(s)) return "[]";
var _d1 = _depth <= 1;
var _str = _d1? "[\n" : "[";
var _nl = _d1? ",\n" : ",";
var _padd = _d1? _pad + " " : "";
for( var i = 0, n = array_length(s); i < n; i++ ) var _newLine = false;
_str += $"{_padd}{simple_serialize(s[i], _pad, _depth + 1)}{_nl}";
_str += _d1? _pad + "]" : "]"; if(is_array(_v)) {
if(array_empty(_v)) return "[]";
switch(_k) {
case "assets" :
case "instances" :
case "instanceCreationOrder" :
case "layers" :
case "parent" :
case "physicsSettings" :
case "properties" :
case "roomSettings" :
case "viewSettings" :
case "views" :
_newLine = true;
break;
}
var _str = _newLine? "[\n" : "[";
var _nl = _newLine? ",\n" : ",";
var _padd = _newLine? string_multiply(" ", _depth + 1) : "";
for( var i = 0, n = array_length(_v); i < n; i++ )
_str += $"{_padd}{simple_serialize(_k, _v[i], _depth + 1)}{_nl}";
_str += _newLine? string_multiply(" ", _depth) + "]" : "]";
return _str; return _str;
} else if(is_struct(s)) { }
var _keys = struct_get_names(s);
if(is_struct(_v)) {
switch(_k) {
case "parent" :
case "physicsSettings" :
case "roomSettings" :
case "viewSettings" :
_newLine = true;
break;
}
var _keys = struct_get_names(_v);
array_sort(_keys, function(a, b) /*=>*/ {return string_compare(a, b)}); array_sort(_keys, function(a, b) /*=>*/ {return string_compare(a, b)});
var _str = _nline? "{\n" : "{"; var _str = _newLine? "{\n" : "{";
var _nl = _nline? ",\n" : ","; var _nl = _newLine? "\n" : "";
var _padd = _nline? _pad + " " : ""; var _padd = _newLine? string_multiply(" ", _depth + 1) : "";
for( var i = 0, n = array_length(_keys); i < n; i++ ) { for( var i = 0, n = array_length(_keys); i < n; i++ ) {
var _k = _keys[i]; var __k = _keys[i];
var _v = s[$ _k]; var __v = _v[$ __k];
_str += _padd; _str += $"{_padd}\"{__k}\":{simple_serialize(__k, __v, _depth + 1)},{_nl}";
_str += $"\"{_k}\":{is_array(_v) || is_struct(_v)? simple_serialize(_v, _padd, _depth + 1) : formatPrimitive(_k, _v)}";
_str += _nl;
} }
_str += _pad + "}" _str += _newLine? string_multiply(" ", _depth) + "}" : "}";
return _str; return _str;
} }
return formatPrimitive("", s); return formatPrimitive(_k, _v);
} }
static sync = function() { file_text_write_all(path, json_stringify(raw)); } static sync = function() { file_text_write_all(path, json_stringify(raw)); }
@ -74,7 +101,7 @@ function GMObject(_gm, _rpth, _rawData) constructor {
static link = function() {} static link = function() {}
} }
function GMSprite(_gm, _rpth, _rawData) : GMObject(_gm, _rpth, _rawData) constructor { function GMSprite(_gm, _rpth, _rawData) : GMAsset(_gm, _rpth, _rawData) constructor {
var _dirr = filename_dir(path); var _dirr = filename_dir(path);
var _frame = raw.frames; var _frame = raw.frames;
var _layers = raw.layers; var _layers = raw.layers;
@ -87,8 +114,18 @@ function GMSprite(_gm, _rpth, _rawData) : GMObject(_gm, _rpth, _rawData) constru
thumbnail = sprite_add(thumbnailPath, 0, 0, 0, 0, 0); thumbnail = sprite_add(thumbnailPath, 0, 0, 0, 0, 0);
} }
function GMTileset(_gm, _rpth, _rawData) : GMObject(_gm, _rpth, _rawData) constructor { function GMTileset(_gm, _rpth, _rawData) : GMAsset(_gm, _rpth, _rawData) constructor {
sprite = raw.spriteId.path; sprite = struct_try_get(raw.spriteId, "path", "");
spriteObject = noone;
static link = function() {
spriteObject = gmBinder.getResourceFromPath(sprite);
}
}
function GMObject(_gm, _rpth, _rawData) : GMAsset(_gm, _rpth, _rawData) constructor {
sprite = struct_try_get(raw.spriteId, "path", "");
spriteObject = noone;
static link = function() { static link = function() {
spriteObject = gmBinder.getResourceFromPath(sprite); spriteObject = gmBinder.getResourceFromPath(sprite);
@ -104,6 +141,7 @@ function __Binder_Gamemaker(path) constructor {
resourcesRaw = []; resourcesRaw = [];
resourcesMap = {}; resourcesMap = {};
resourceList = []; resourceList = [];
resources = [ resources = [
{ name: "sprites", data : [], closed : false, }, { name: "sprites", data : [], closed : false, },
{ name: "tileset", data : [], closed : false, }, { name: "tileset", data : [], closed : false, },
@ -137,11 +175,15 @@ function __Binder_Gamemaker(path) constructor {
projectName = _resMap.name; projectName = _resMap.name;
resourcesRaw = _resMap.resources; resourcesRaw = _resMap.resources;
resourcesMap = {};
var resMap = {};
resourceList = [];
var sprites = []; var sprites = [];
var objects = [];
var tileset = []; var tileset = [];
var rooms = []; var rooms = [];
var _asst;
for( var i = 0, n = array_length(resourcesRaw); i < n; i++ ) { for( var i = 0, n = array_length(resourcesRaw); i < n; i++ ) {
var _res = resourcesRaw[i].id; var _res = resourcesRaw[i].id;
@ -151,21 +193,28 @@ function __Binder_Gamemaker(path) constructor {
var _rawData = readYY($"{dir}/{_rpth}"); var _rawData = readYY($"{dir}/{_rpth}");
if(_rawData == noone) continue; if(_rawData == noone) continue;
var _asset = noone;
switch(_rawData.resourceType) { switch(_rawData.resourceType) {
case "GMSprite": _asset = new GMSprite( self, _rpth, _rawData); array_push(sprites, _asset); break; case "GMSprite": _asst = new GMSprite( self, _rpth, _rawData); array_push(sprites, _asst); break;
case "GMTileSet": _asset = new GMTileset(self, _rpth, _rawData); array_push(tileset, _asset); break; case "GMObject": _asst = new GMObject( self, _rpth, _rawData); array_push(objects, _asst); break;
case "GMRoom": _asset = new GMRoom( self, _rpth, _rawData); array_push(rooms, _asset); break; case "GMTileSet": _asst = new GMTileset(self, _rpth, _rawData); array_push(tileset, _asst); break;
case "GMRoom": _asst = new GMRoom( self, _rpth, _rawData); array_push(rooms, _asst); break;
default : _asst = noone;
} }
resourcesMap[$ _rpth] = _asset; if(_asst == noone) continue;
array_push(resourceList, _asset);
if(struct_has(resourcesMap, _rpth)) {
struct_override(resourcesMap, _asst);
_asst = resourcesMap;
} }
for( var i = 0, n = array_length(resourceList); i < n; i++ ) { resMap[$ _rpth] = _asst;
array_push(resourceList, _asst);
}
resourcesMap = resMap;
for( var i = 0, n = array_length(resourceList); i < n; i++ )
resourceList[i].link(); resourceList[i].link();
}
resources[0].data = sprites; resources[0].data = sprites;
resources[1].data = tileset; resources[1].data = tileset;

View file

@ -1,14 +1,18 @@
function GMRoom(_gm, _rpth, _rawData) : GMObject(_gm, _rpth, _rawData) constructor { function GMRoom(_gm, _rpth, _rawData) : GMAsset(_gm, _rpth, _rawData) constructor {
static serialize_bool_keys = { static serialize_bool_keys = {
clearDisplayBuffer: 1, clearDisplayBuffer: 1,
clearViewBackground: 1, clearViewBackground: 1,
effectEnabled: 1, effectEnabled: 1,
enableViews: 1, enableViews: 1,
frozen: 1,
hasCreationCode: 1,
hierarchyFrozen: 1, hierarchyFrozen: 1,
htiled: 1, htiled: 1,
ignore: 1,
inherit: 1, inherit: 1,
inheritCode: 1, inheritCode: 1,
inheritCreationOrder: 1, inheritCreationOrder: 1,
inheritItemSettings: 1,
inheritLayerDepth: 1, inheritLayerDepth: 1,
inheritLayers: 1, inheritLayers: 1,
inheritLayerSettings: 1, inheritLayerSettings: 1,
@ -27,6 +31,7 @@ function GMRoom(_gm, _rpth, _rawData) : GMObject(_gm, _rpth, _rawData) construct
vtiled: 1, vtiled: 1,
}; };
roomSettings = raw.roomSettings;
layers = GMRoom_create_layers(self, gmBinder, raw.layers); layers = GMRoom_create_layers(self, gmBinder, raw.layers);
static link = function() { array_foreach(layers, function(l) /*=>*/ {return l.link()}); } static link = function() { array_foreach(layers, function(l) /*=>*/ {return l.link()}); }
@ -45,26 +50,12 @@ function GMRoom(_gm, _rpth, _rawData) : GMObject(_gm, _rpth, _rawData) construct
var _str = "{\n"; var _str = "{\n";
var _nl = ",\n"; var _nl = ",\n";
var _padd = " ";
for( var i = 0, n = array_length(_keys); i < n; i++ ) { for( var i = 0, n = array_length(_keys); i < n; i++ ) {
var _k = _keys[i]; var _k = _keys[i];
var _v = raw[$ _k]; var _v = raw[$ _k];
var _snl = false; _str += $" \"{_k}\":{simple_serialize(_k, _v)}{_nl}";
switch(_k) {
case "parent" :
case "physicsSettings" :
case "roomSettings" :
case "viewSettings" :
_snl = true;
break;
}
_str += _padd;
if(is_array(_v) || is_struct(_v)) _str += $"\"{_k}\":{simple_serialize(_v, _padd, 0, _snl)}";
else _str += $"\"{_k}\":{formatPrimitive(_k, _v)}";
_str += _nl;
} }
_str += "}" _str += "}"
@ -104,6 +95,7 @@ function GMRoom_Layer(_room, _gm, _raw) constructor {
layers = GMRoom_create_layers(roomObject, _gm, _raw.layers); layers = GMRoom_create_layers(roomObject, _gm, _raw.layers);
index = 6; index = 6;
preview = noone;
static link = function() { array_foreach(layers, function(l) /*=>*/ {return l.link()}); } static link = function() { array_foreach(layers, function(l) /*=>*/ {return l.link()}); }
@ -115,28 +107,145 @@ function GMRoom_Layer(_room, _gm, _raw) constructor {
} }
return noone; return noone;
} }
static refreshPreview = function() {
preview = surface_verify(preview, roomObject.roomSettings.Width, roomObject.roomSettings.Height);
surface_set_target(preview);
DRAW_CLEAR
doRefreshPreview();
surface_reset_target();
}
static doRefreshPreview = function() {}
} }
function GMRoom_Background(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor { function GMRoom_Background(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor {
index = 0; index = 0;
spr = noone;
colour = raw.colour;
}
function GMRoom_Tile(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor {
index = 1;
tiles = raw.tiles;
tilesetId = raw.tilesetId;
tileset = noone;
static link = function() { static link = function() {
tileset = gmBinder.getResourceFromPath(struct_try_get(tilesetId, "path", "")); spr = gmBinder.getResourceFromPath(struct_try_get(raw.spriteId, "path"));
array_foreach(layers, function(l) /*=>*/ {return l.link()}); }
static doRefreshPreview = function() {
if(spr != noone && spr.thumbnail != noone) {
if(raw.htiled || raw.vtiled)
draw_sprite_tiled(spr.thumbnail, 0, 0, 0);
else
draw_sprite(spr.thumbnail, 0, 0, 0);
}
}
}
function GMRoom_Instance(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor {
index = 2;
instances = [];
static link = function() {
instances = [];
for( var i = 0, n = array_length(raw.instances); i < n; i++ ) {
var _ins = raw.instances[i];
var _obj = _ins.objectId;
var _o = gmBinder.getResourceFromPath(struct_try_get(_obj, "path"));
instances[i] = {
object: _o,
data: _ins,
};
}
}
static doRefreshPreview = function() {
for( var i = 0, n = array_length(instances); i < n; i++ ) {
var _ins = instances[i];
var _obj = _ins.object;
var _dat = _ins.data;
if(_obj == noone) continue;
var _spr = _obj.spriteObject;
if(_spr == noone) continue;
var _thm = _spr.thumbnail;
var _thm_w = _spr.raw.width;
var _thm_h = _spr.raw.height;
var _thm_ox = _spr.raw.sequence.xorigin;
var _thm_oy = _spr.raw.sequence.yorigin;
var _pos_x = _dat.x;
var _pos_y = _dat.y;
var _sca_x = _dat.scaleX;
var _sca_y = _dat.scaleY;
var _rot = _dat.rotation;
var _col = _dat.colour;
var _rx = _pos_x - _thm_ox * _sca_x;
var _ry = _pos_y - _thm_oy * _sca_y;
draw_sprite_ext(_thm, 0, _rx, _ry, _sca_x, _sca_y, _rot, _col);
}
}
}
function GMRoom_Path(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor {
index = 3;
static doRefreshPreview = function() {
}
}
function GMRoom_Asset(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor {
index = 4;
assets = [];
static link = function() {
assets = [];
for( var i = 0, n = array_length(raw.assets); i < n; i++ ) {
var _ass = raw.assets[i];
var _spr = _ass.spriteId;
var _o = gmBinder.getResourceFromPath(struct_try_get(_spr, "path"));
assets[i] = {
object: _o,
data: _ass,
};
}
}
static doRefreshPreview = function() {
for( var i = 0, n = array_length(assets); i < n; i++ ) {
var _ass = assets[i];
var _spr = _ass.object;
var _dat = _ass.data;
var _thm = _spr.thumbnail;
var _thm_w = _spr.raw.width;
var _thm_h = _spr.raw.height;
var _thm_ox = _spr.raw.sequence.xorigin;
var _thm_oy = _spr.raw.sequence.yorigin;
var _pos_x = _dat.x;
var _pos_y = _dat.y;
var _sca_x = _dat.scaleX;
var _sca_y = _dat.scaleY;
var _rot = _dat.rotation;
var _col = _dat.colour;
var _rx = _pos_x - _thm_ox * _sca_x;
var _ry = _pos_y - _thm_oy * _sca_y;
draw_sprite_ext(_thm, 0, _rx, _ry, _sca_x, _sca_y, _rot, _col);
}
}
}
function GMRoom_Effect(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor {
index = 5;
static doRefreshPreview = function() {
} }
} }
function GMRoom_Instance(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor { index = 2; }
function GMRoom_Path(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor { index = 3; }
function GMRoom_Asset(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor { index = 4; }
function GMRoom_Effect(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor { index = 5; }

View file

@ -0,0 +1,99 @@
function GMRoom_Tile(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) constructor {
index = 1;
tiles = raw.tiles;
tilesetId = raw.tilesetId;
tileset = noone;
static link = function() {
tileset = gmBinder.getResourceFromPath(struct_try_get(tilesetId, "path", ""));
array_foreach(layers, function(l) /*=>*/ {return l.link()});
}
static doRefreshPreview = function() {
}
static setArray = function(arr) {
var _ww = tiles.SerialiseWidth;
var _hh = tiles.SerialiseHeight;
arr = array_verify(arr, _ww * _hh);
var _ctil = [];
var _type = arr[0];
var _runn = 1;
for( var j = 1, m = array_length(arr); j < m; j++ ) {
if(arr[j] == _type) _runn++
else {
array_push(_ctil, -_runn, _type);
_type = arr[j];
_runn = 1;
}
}
array_push(_ctil, -_runn, _type);
if(array_length(_ctil) < array_length(arr)) {
tiles.TileCompressedData = _ctil;
tiles.TileDataFormat = 1;
} else {
tiles.TileSerialiseData = arr;
struct_remove(tiles, "TileDataFormat");
}
}
static resizeBBOX = function(bbox) {
var _form = struct_try_get(tiles, "TileDataFormat", 0);
var _ow = tiles.SerialiseWidth;
var _oh = tiles.SerialiseHeight;
var _nw = bbox[2] - bbox[0];
var _nh = bbox[3] - bbox[1];
var _dx = -bbox[0];
var _dy = -bbox[1];
var _grdo = ds_grid_create(_ow, _oh);
var _grdn = ds_grid_create(_nw, _nh);
var _data;
if(_form == 0) {
_data = tiles.TileSerialiseData;
} else if(_form == 1) {
var _d = tiles.TileCompressedData;
var _amo, _til, _i = 0;
for( var i = 0, n = array_length(_d); i < n; i += 2 ) {
_amo = -_d[i + 0];
_til = _d[i + 1];
_til = max(0, _til + bool(_til));
repeat(_amo) _data[_i++] = _til;
}
}
var _i = 0;
for( var i = 0; i < _oh; i++ )
for( var j = 0; j < _ow; j++ )
ds_grid_set(_grdo, j, i, _data[_i++]);
ds_grid_set_grid_region(_grdn, _grdo, max(-_dx, 0), max(-_dy, 0), _ow - 1, _oh - 1, max(_dx, 0), max(_dy, 0));
var _dn = array_create(_nw * _nh);
var _i = 0;
for( var i = 0; i < _oh; i++ )
for( var j = 0; j < _ow; j++ )
_dn[i++] = ds_grid_get(_grdn, j, i);
ds_grid_destroy(_grdo);
ds_grid_destroy(_grdn);
tiles.SerialiseWidth = _nw;
tiles.SerialiseHeight = _nh;
setArray(_dn);
}
}

View file

@ -0,0 +1,14 @@
{
"$GMScript":"v1",
"%Name":"binder_gamemaker_tile",
"isCompatibility":false,
"isDnD":false,
"name":"binder_gamemaker_tile",
"parent":{
"name":"gamemaker",
"path":"folders/game engines/gamemaker.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",
"tags":[],
}

View file

@ -144,7 +144,7 @@ function buttonClass(_onClick, _icon = noone) : widget() constructor {
} }
} }
function buttonInstant(spr, _x, _y, _w, _h, _m, _act, _hvr, _tip = "", _icon = noone, _icon_index = 0, _icon_blend = COLORS._main_icon, _icon_alpha = 1, _icon_scale = 1, function buttonInstant(spr, _x, _y, _w, _h, _m, _hvr, _act, _tip = "", _icon = noone, _icon_index = 0, _icon_blend = COLORS._main_icon, _icon_alpha = 1, _icon_scale = 1,
_button_blend = c_white) { _button_blend = c_white) {
var res = 0; var res = 0;
@ -179,7 +179,7 @@ function buttonInstant(spr, _x, _y, _w, _h, _m, _act, _hvr, _tip = "", _icon = n
function buttonTextIconInstant(active, spr, _x, _y, _w, _h, _m, _act, _hvr, _tip = "", _icon = noone, _icon_label = "", _icon_blend = COLORS._main_icon_light, _icon_alpha = 1) { function buttonTextIconInstant(active, spr, _x, _y, _w, _h, _m, _act, _hvr, _tip = "", _icon = noone, _icon_label = "", _icon_blend = COLORS._main_icon_light, _icon_alpha = 1) {
var _b = 0; var _b = 0;
if(active) _b = buttonInstant(spr, _x, _y, _w, _h, _m, _act, _hvr, _tip); if(active) _b = buttonInstant(spr, _x, _y, _w, _h, _m, _hvr, _act, _tip);
draw_set_text(f_p1, fa_left, fa_center, active? COLORS._main_icon_light : COLORS._main_icon); draw_set_text(f_p1, fa_left, fa_center, active? COLORS._main_icon_light : COLORS._main_icon);
var bxc = _x + _w / 2 - (string_width(_icon_label) + ui(64)) / 2; var bxc = _x + _w / 2 - (string_width(_icon_label) + ui(64)) / 2;

View file

@ -15,7 +15,7 @@ function gamemakerPathBox(project) : widget() constructor {
h = _h; h = _h;
if(project.bind_gamemaker == noone) { if(project.bind_gamemaker == noone) {
if(buttonInstant(THEME.button_def, _x, _y, _w, _h, _m, active, hover) == 2) { if(buttonInstant(THEME.button_def, _x, _y, _w, _h, _m, hover, active) == 2) {
var path = get_open_filename("GameMaker project|*.yyp", ""); key_release(); var path = get_open_filename("GameMaker project|*.yyp", ""); key_release();
if(path == "") return noone; if(path == "") return noone;
@ -33,13 +33,13 @@ function gamemakerPathBox(project) : widget() constructor {
draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h); draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h);
if(buttonInstant(THEME.button_def, _x, _y, ui(32), _h, _m, active, hover, "Explore project", s_gamemaker, 0, COLORS._main_icon) == 2) if(buttonInstant(THEME.button_def, _x, _y, ui(32), _h, _m, hover, active, "Refresh project", THEME.refresh_20, 0, COLORS._main_icon) == 2)
dialogPanelCall(new Panel_GM_Explore(_gm)); _gm.refreshResources();
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text);
draw_text_add(_x + _w / 2, _y + _h / 2, _gm.projectName); draw_text_add(_x + _w / 2, _y + _h / 2, _gm.projectName);
if(buttonInstant(THEME.button_def, _x + _w - ui(32), _y, ui(32), _h, _m, active, hover, "Disconnect", THEME.cross_12, 0, [ COLORS._main_icon, COLORS._main_value_negative ]) == 2) { if(buttonInstant(THEME.button_def, _x + _w - ui(32), _y, ui(32), _h, _m, hover, active, "Disconnect", THEME.cross_12, 0, [ COLORS._main_icon, COLORS._main_value_negative ]) == 2) {
project.attributes.bind_gamemaker_path = ""; project.attributes.bind_gamemaker_path = "";
project.bind_gamemaker = noone; project.bind_gamemaker = noone;
} }

View file

@ -44,7 +44,7 @@
LATEST_VERSION = 1_18_00_0; LATEST_VERSION = 1_18_00_0;
VERSION = 1_18_05_1; VERSION = 1_18_05_1;
SAVE_VERSION = 1_18_05_0; SAVE_VERSION = 1_18_05_0;
VERSION_STRING = MAC? "1.18.003m" : "1.18.6.003"; VERSION_STRING = MAC? "1.18.003m" : "1.18.6.004";
BUILD_NUMBER = 1_18_05_1; BUILD_NUMBER = 1_18_05_1;
var _vsp = string_split(VERSION_STRING, "."); var _vsp = string_split(VERSION_STRING, ".");

View file

@ -84,7 +84,7 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry
var _wd_ww = wd_w - _wd_h - ui(32 + 4); var _wd_ww = wd_w - _wd_h - ui(32 + 4);
_edit.tb_name.draw(_wd_xx, yy, _wd_ww, _wd_h, _inpu.name, _m, TEXTBOX_INPUT.text); _edit.tb_name.draw(_wd_xx, yy, _wd_ww, _wd_h, _inpu.name, _m, TEXTBOX_INPUT.text);
if(buttonInstant(THEME.button_hide, _wd_x + wd_w - _wd_h, yy, _wd_h, _wd_h, _m, _foc, _hov,, THEME.icon_delete,, COLORS._main_value_negative) == 2) if(buttonInstant(THEME.button_hide, _wd_x + wd_w - _wd_h, yy, _wd_h, _wd_h, _m, _hov, _foc,, THEME.icon_delete,, COLORS._main_value_negative) == 2)
del = j; del = j;
yy += _wd_h + _pd_h * 2; yy += _wd_h + _pd_h * 2;
hh += _wd_h + _pd_h * 2; hh += _wd_h + _pd_h * 2;

View file

@ -15,6 +15,7 @@ function drawWidgetInit() {
} }
function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _focus = false, _scrollPane = noone, rx = 0, ry = 0) { function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _focus = false, _scrollPane = noone, rx = 0, ry = 0) {
#region data
var con_w = ww - ui(4); var con_w = ww - ui(4);
var xc = xx + ww / 2; var xc = xx + ww / 2;
var _font = viewMode == INSP_VIEW_MODE.spacious? f_p1 : f_p2; var _font = viewMode == INSP_VIEW_MODE.spacious? f_p1 : f_p2;
@ -37,9 +38,11 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
breakLine |= wid.size > 5; breakLine |= wid.size > 5;
break; break;
} }
#endregion
#region left buttons
var butx = xx; var butx = xx;
if(jun.connect_type == CONNECT_TYPE.input && jun.isAnimable() && !jun.expUse) { // animation if(jun.connect_type == CONNECT_TYPE.input && jun.isAnimable() && !jun.expUse) { // Animation
var index = jun.hasJunctionFrom()? 2 : jun.is_anim; var index = jun.hasJunctionFrom()? 2 : jun.is_anim;
var cc = c_white; var cc = c_white;
@ -70,7 +73,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(anim_hold != noone && mouse_release(mb_left)) anim_hold = noone; if(anim_hold != noone && mouse_release(mb_left)) anim_hold = noone;
butx += ui(20); butx += ui(20);
if(!global_var) { // visibility if(!global_var) { // Visibility
var _visi = jun.isVisible(); var _visi = jun.isVisible();
draw_sprite_ui_uniform(THEME.junc_visible, _visi, butx, lb_y, 1,, 0.8); draw_sprite_ui_uniform(THEME.junc_visible, _visi, butx, lb_y, 1,, 0.8);
@ -138,11 +141,12 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
return [ 0, true, cHov ]; return [ 0, true, cHov ];
} }
#endregion
#region label
draw_text_add(lb_x, lb_y, _name); draw_text_add(lb_x, lb_y, _name);
#region tooltip if(jun.tooltip != "") { // Tooltip
if(jun.tooltip != "") {
var tx = xx + ui(40) + string_width(_name) + ui(16); var tx = xx + ui(40) + string_width(_name) + ui(16);
var ty = lb_y - ui(1); var ty = lb_y - ui(1);
@ -151,8 +155,10 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(is_string(jun.tooltip)) if(is_string(jun.tooltip))
TOOLTIP = jun.tooltip; TOOLTIP = jun.tooltip;
else if(mouse_click(mb_left, _focus)) else if(mouse_click(mb_left, _focus))
dialogCall(jun.tooltip); dialogCall(jun.tooltip);
draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 1); draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 1);
} else } else
draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 0.75); draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 0.75);
@ -161,13 +167,12 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
} }
#endregion #endregion
#region anim #region right buttons
if(jun.connect_type == CONNECT_TYPE.input && breakLine && jun.is_anim) { if(jun.connect_type == CONNECT_TYPE.input && breakLine && jun.is_anim) { // Animation
var _anim = jun.animator;
var bx = xx + ww - ui(12); var bx = xx + ww - ui(12);
var by = lb_y; var by = lb_y;
var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 2) var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _hover, _focus, "", THEME.prop_keyframe, 2)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) { if(b == 2) {
@ -193,7 +198,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
} }
var _tlp = kfFocus? __txtx("panel_inspector_remove_key", "Remove keyframe") : __txtx("panel_inspector_add_key", "Add keyframe"); var _tlp = kfFocus? __txtx("panel_inspector_remove_key", "Remove keyframe") : __txtx("panel_inspector_add_key", "Add keyframe");
var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, _tlp, THEME.prop_keyframe, 1, cc) var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _hover, _focus, _tlp, THEME.prop_keyframe, 1, cc)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) { if(b == 2) {
@ -212,7 +217,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
} }
bx -= ui(26); bx -= ui(26);
var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 0) var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _hover, _focus, "", THEME.prop_keyframe, 0)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) { if(b == 2) {
@ -236,15 +241,13 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
bx -= ui(26 + 12); bx -= ui(26 + 12);
tooltip_loop_type.index = jun.on_end; tooltip_loop_type.index = jun.on_end;
var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, tooltip_loop_type, THEME.prop_on_end, jun.on_end) var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _hover, _focus, tooltip_loop_type, THEME.prop_on_end, jun.on_end)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(THEME.prop_on_end)); if(b == 2) jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(THEME.prop_on_end));
} }
#endregion
#region right buttons if(jun.connect_type == CONNECT_TYPE.input && breakLine && !jun.is_anim && !global_var) { // Right buttons
if(jun.connect_type == CONNECT_TYPE.input && breakLine && !jun.is_anim && !global_var) {
var bx = xx + ww + ui(16); var bx = xx + ww + ui(16);
var by = lb_y; var by = lb_y;
var bs = ui(24); var bs = ui(24);
@ -252,7 +255,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
bx -= bs + ui(4); bx -= bs + ui(4);
if(jun.is_modified) { if(jun.is_modified) {
var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _focus, _hover, __txtx("panel_inspector_reset", "Reset value"), THEME.refresh_16, 0, COLORS._main_icon) var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _hover, _focus, __txtx("panel_inspector_reset", "Reset value"), THEME.refresh_16, 0, COLORS._main_icon)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) jun.resetValue(); if(b == 2) jun.resetValue();
@ -261,7 +264,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
bx -= bs + ui(4); bx -= bs + ui(4);
var ic_b = jun.expUse? c_white : COLORS._main_icon; var ic_b = jun.expUse? c_white : COLORS._main_icon;
var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _focus, _hover, __txtx("panel_inspector_use_expression", "Use expression"), THEME.node_use_expression, jun.expUse, ic_b) var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _hover, _focus, __txtx("panel_inspector_use_expression", "Use expression"), THEME.node_use_expression, jun.expUse, ic_b)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) { if(b == 2) {
@ -273,7 +276,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(jun.expUse) { if(jun.expUse) {
bx -= bs + ui(4); bx -= bs + ui(4);
var cc = NODE_DROPPER_TARGET == jun? COLORS._main_value_positive : COLORS._main_icon; var cc = NODE_DROPPER_TARGET == jun? COLORS._main_value_positive : COLORS._main_icon;
var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _focus, _hover, __txtx("panel_inspector_dropper", "Node Dropper"), THEME.node_dropper, 0, cc) var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _hover, _focus, __txtx("panel_inspector_dropper", "Node Dropper"), THEME.node_dropper, 0, cc)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) NODE_DROPPER_TARGET = NODE_DROPPER_TARGET == jun? noone : jun; if(b == 2) NODE_DROPPER_TARGET = NODE_DROPPER_TARGET == jun? noone : jun;
@ -282,7 +285,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(jun.expUse || jun.type == VALUE_TYPE.text) { if(jun.expUse || jun.type == VALUE_TYPE.text) {
bx -= bs + ui(4); bx -= bs + ui(4);
var cc = jun.popup_dialog == noone? COLORS._main_icon : COLORS._main_value_positive; var cc = jun.popup_dialog == noone? COLORS._main_icon : COLORS._main_value_positive;
var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _focus, _hover, __txtx("panel_inspector_pop_text", "Pop up Editor"), THEME.text_popup, 0, cc) var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _hover, _focus, __txtx("panel_inspector_pop_text", "Pop up Editor"), THEME.text_popup, 0, cc)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) { if(b == 2) {
@ -295,7 +298,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(jun.bypass_junc) { if(jun.bypass_junc) {
bx -= bs + ui(4); bx -= bs + ui(4);
var ic_b = jun.bypass_junc.visible? COLORS._main_icon_light : COLORS._main_icon; var ic_b = jun.bypass_junc.visible? COLORS._main_icon_light : COLORS._main_icon;
var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _focus, _hover, __txt("Bypass"), THEME.junction_bypass, jun.bypass_junc.visible, ic_b) var b = buttonInstant(THEME.button_hide, bx - bsh, by - bsh, bs, bs, _m, _hover, _focus, __txt("Bypass"), THEME.junction_bypass, jun.bypass_junc.visible, ic_b)
if(b) cHov = true; if(b) cHov = true;
if(b == 2) { if(b == 2) {
@ -306,6 +309,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
} }
#endregion #endregion
#region draw widget
var _hsy = yy + lb_h; var _hsy = yy + lb_h;
var padd = ui(8); var padd = ui(8);
var labelWidth = max(lb_w, min(ww * 0.4, ui(200))); var labelWidth = max(lb_w, min(ww * 0.4, ui(200)));
@ -319,7 +323,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var widH = widExtend? editBoxH : 0; var widH = widExtend? editBoxH : 0;
var mbRight = true; var mbRight = true;
if(jun.expUse) { // expression editor if(jun.expUse) {
var expValid = jun.expTree != noone && jun.expTree.validate(); var expValid = jun.expTree != noone && jun.expTree.validate();
jun.express_edit.boxColor = expValid? COLORS._main_value_positive : COLORS._main_value_negative; jun.express_edit.boxColor = expValid? COLORS._main_value_positive : COLORS._main_value_negative;
jun.express_edit.rx = rx; jun.express_edit.rx = rx;
@ -338,7 +342,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
un.triggerButton.tooltip.index = un.mode; un.triggerButton.tooltip.index = un.mode;
} }
} else if(wid && jun.display_type != VALUE_DISPLAY.none) { // edit widget } else if(wid && jun.display_type != VALUE_DISPLAY.none) {
wid.setFocusHover(_focus, _hover); wid.setFocusHover(_focus, _hover);
if(jun.connect_type == CONNECT_TYPE.input) { if(jun.connect_type == CONNECT_TYPE.input) {
@ -400,8 +404,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
cHov |= wid.inBBOX(_m) cHov |= wid.inBBOX(_m)
mbRight &= wid.right_click_block; mbRight &= wid.right_click_block;
} }
#endregion
return [ widH, mbRight, cHov ]; return [ widH, mbRight, cHov ];
} }

View file

@ -102,7 +102,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var bs = ui(24); var bs = ui(24);
var bx = _x + ui(20); var bx = _x + ui(20);
var by = _y; var by = _y;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
createNewInput(); createNewInput();
triggerRender(); triggerRender();
} }
@ -145,7 +145,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var bs = ui(24); var bs = ui(24);
var bx = _x1 - bs; var bx = _x1 - bs;
var by = _yy - bs / 2; var by = _yy - bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
del_light = i; del_light = i;
} }
} }

View file

@ -162,7 +162,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var _bx = _x1 + _aw / 2 - _bs / 2; var _bx = _x1 + _aw / 2 - _bs / 2;
var _by = _y + _h / 2 - _bs / 2; var _by = _y + _h / 2 - _bs / 2;
if(buttonInstant(noone, _bx, _by, _bs, _bs, _m, _focus, _hover, "", THEME.add_16, 0, [ COLORS._main_icon, COLORS._main_value_positive ]) == 2) { if(buttonInstant(noone, _bx, _by, _bs, _bs, _m, _hover, _focus, "", THEME.add_16, 0, [ COLORS._main_icon, COLORS._main_value_positive ]) == 2) {
attributes.frames++; attributes.frames++;
refreshFrames(); refreshFrames();
update(); update();

View file

@ -40,7 +40,7 @@ function Node_Canvas_Group(_x, _y, _group) : Node_Collection(_x, _y, _group) con
var bx = _x; var bx = _x;
var by = _yy; var by = _yy;
var bs = ui(24); var bs = ui(24);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.add_16, 0, COLORS._main_value_positive) == 2)
layerAdd(); layerAdd();
_h += bs + ui(8); _h += bs + ui(8);

View file

@ -52,22 +52,22 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
var by = _y; var by = _y;
var bs = ui(24); var bs = ui(24);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.refresh_16) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus,, THEME.refresh_16) == 2)
refreshPalette(); refreshPalette();
bx += bs + ui(4); bx += bs + ui(4);
var jun = inputs[2]; var jun = inputs[2];
var index = jun.value_from == noone? jun.is_anim : 2; var index = jun.value_from == noone? jun.is_anim : 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.animate_clock, index, index == 2? COLORS._main_accent : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus,, THEME.animate_clock, index, index == 2? COLORS._main_accent : COLORS._main_icon) == 2)
jun.setAnim(!jun.is_anim); jun.setAnim(!jun.is_anim);
bx += bs + ui(4); bx += bs + ui(4);
var vis = jun.visible; var vis = jun.visible;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.junc_visible, vis) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus,, THEME.junc_visible, vis) == 2)
jun.visible = !vis; jun.visible = !vis;
bx += bs + ui(4); bx += bs + ui(4);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.sort_16) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus,, THEME.sort_16) == 2)
menuCall("", sort_menu); menuCall("", sort_menu);
var _from = getInputData(1); var _from = getInputData(1);
@ -109,7 +109,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
bx = _x2 - ui(32); bx = _x2 - ui(32);
_x2 -= ui(32 + 4); _x2 -= ui(32 + 4);
by = _y0 + ss / 2 - ui(32) / 2; by = _y0 + ss / 2 - ui(32) / 2;
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), _m, _focus, _hover,, THEME.color_picker_dropper,, c_white) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), _m, _hover, _focus,, THEME.color_picker_dropper,, c_white) == 2) {
var dialog = dialogCall(o_dialog_color_selector, WIN_W / 2, WIN_H / 2); var dialog = dialogCall(o_dialog_color_selector, WIN_W / 2, WIN_H / 2);
dialog.selector.dropper_active = true; dialog.selector.dropper_active = true;
dialog.selector.dropper_close = true; dialog.selector.dropper_close = true;
@ -121,7 +121,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
bx = _x2 - ui(32); bx = _x2 - ui(32);
_x2 -= ui(32 + 4); _x2 -= ui(32 + 4);
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), _m, _focus, _hover,, THEME.color_wheel,, c_white) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), _m, _hover, _focus,, THEME.color_wheel,, c_white) == 2) {
var pick = instance_create(mouse_mx, mouse_my, o_dialog_color_quick_pick); var pick = instance_create(mouse_mx, mouse_my, o_dialog_color_quick_pick);
array_insert(pick.palette, 0, to); array_insert(pick.palette, 0, to);
pick.onApply = setColor; pick.onApply = setColor;

View file

@ -1131,19 +1131,15 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
static triggerRender = function(resetSelf = true) { static triggerRender = function(resetSelf = true) {
LOG_BLOCK_START(); LOG_BLOCK_START();
LOG_IF(global.FLAG.render == 1, $"Trigger render for {self}"); LOG_IF(global.FLAG.render == 1, $"Trigger render for {getFullName()}");
if(resetSelf) resetRender(false); if(resetSelf) resetRender(false);
RENDER_PARTIAL RENDER_PARTIAL
if(is_instanceof(group, Node_Collection)) { if(is(group, Node_Collection))
group.triggerRender(); group.triggerRender();
} else { else
array_foreach(getNextNodesRaw(), function(n) /*=>*/ {return n.triggerRender()});
var nodes = getNextNodesRaw();
for(var i = 0; i < array_length(nodes); i++)
nodes[i].triggerRender();
}
LOG_BLOCK_END(); LOG_BLOCK_END();
} }

View file

@ -6,18 +6,92 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
layers = []; layers = [];
layerMap = {}; layerMap = {};
newInput( 0, nodeValue_Vec2("Room size", self, [ 16, 16 ])); maxTileSize = [ 1, 1 ];
newInput( 1, nodeValue_Bool("Persistance", self, false)); newOutput( 0, nodeValue_Surface("Room Preview", self, noone));
layer_selecting = noone; layer_selecting = noone;
tb_depth = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { tb_depth = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { if(layer_selecting == noone) return; layer_selecting.raw.depth = round(v); })
if(layer_selecting == noone) return; .setLabel("Depth").setFont(f_p3);
layer_selecting.raw.depth = round(v);
});
tb_depth.label = "Depth"; #region room resize
tb_depth.font = f_p3; room_resizing = false;
room_resizing_area = [ 0, 0, 0, 0 ];
room_resizing_hov = array_create(4);
room_resizing_t = noone;
room_resizing_mx = 0; room_resizing_my = 0;
room_resizing_ss = 0;
room_resize_apply = button( function() { applyResizeRoom(); } ).setIcon(THEME.toolbar_check, 0);
room_resize_cancel = button( function() { room_resizing = false; } ).setIcon(THEME.toolbar_check, 1);
tb_room_resize_w = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { room_resizing_area[2] = room_resizing_area[0] + round(v); }).setHide(1).setFont(f_p3);
tb_room_resize_h = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { room_resizing_area[3] = room_resizing_area[1] + round(v); }).setHide(1).setFont(f_p3);
#endregion
room_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) {
var hh = ui(40);
var _yy = _y + ui(8);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, hh, COLORS.node_composite_bg_blend, 1);
var _wdx = _x + ui(128);
var _wdy = _yy;
var _wdw = _w - ui(128 + 8);
var _wdh = ui(24);
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub);
draw_text_add(_x + ui(16), _wdy + _wdh / 2, "Room Size");
var _wdw = _w - ui(128 + 8) - (room_resizing? _wdh * 2 : _wdh);
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx + _wdw / 2, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
var _ww = gmRoom.roomSettings.Width;
var _hh = gmRoom.roomSettings.Height;
if(room_resizing) {
_ww = room_resizing_area[2] - room_resizing_area[0];
_hh = room_resizing_area[3] - room_resizing_area[1];
var _wpr = new widgetParam(_wdx, _wdy, _wdw / 2, _wdh, _ww, {}, _m, room_renderer.rx, room_renderer.ry).setFont(f_p2).setFocusHover(_focus, _hover);
tb_room_resize_w.drawParam(_wpr);
var _wpr = new widgetParam(_wdx + _wdw / 2, _wdy, _wdw / 2, _wdh, _hh, {}, _m, room_renderer.rx, room_renderer.ry).setFont(f_p2).setFocusHover(_focus, _hover);
tb_room_resize_h.drawParam(_wpr);
} else {
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text);
draw_text_add(_wdx + _wdw / 4, _wdy + _wdh / 2, _ww);
draw_text_add(_wdx + _wdw / 2 + _wdw / 4, _wdy + _wdh / 2, _hh);
}
if(room_resizing) {
var _bx = _wdx + _wdw;
if(buttonInstant(THEME.button_def, _bx, _wdy, _wdh, _wdh, _m, _hover, _focus, __txt("Cancel"), THEME.toolbar_check, 1,
COLORS._main_value_negative, 1, 1, COLORS._main_icon_light) == 2)
room_resizing = false;
var misalign = (room_resizing_area[0] % maxTileSize[0] != 0) || (room_resizing_area[1] % maxTileSize[1] != 0) ||
(room_resizing_area[2] % maxTileSize[0] != 0) || (room_resizing_area[3] % maxTileSize[1] != 0);
var _tooltip = misalign? __txt("Warning: room size not divisible by tile size. May cause tile shifting.") : __txt("Apply");
_bx += _wdh;
if(buttonInstant(THEME.button_def, _bx, _wdy, _wdh, _wdh, _m, _hover, _focus, _tooltip, THEME.toolbar_check, 0,
COLORS._main_value_positive, 1, 1, COLORS._main_icon_light) == 2)
applyResizeRoom();
} else {
if(buttonInstant(THEME.button_def, _wdx + _wdw, _wdy, _wdh, _wdh, _m, _hover, _focus, __txt("Resize"), THEME.canvas_resize, 0,
COLORS._main_icon_light, 1, 1, COLORS._main_icon_light) == 2) {
room_resizing = true;
room_resizing_area = [ 0, 0, gmRoom.roomSettings.Width, gmRoom.roomSettings.Height ];
}
}
return hh;
});
layers_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { layers_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) {
if(gmRoom == noone) { if(gmRoom == noone) {
@ -28,16 +102,20 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
return ui(28); return ui(28);
} }
var _amo = array_length(gmRoom.layers); var _amo = array_length(layers);
var hh = ui(28); var hh = ui(28);
var _h = hh * _amo + ui(16); var _h = hh * _amo + ui(16);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1); draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1);
for( var i = 0, n = array_length(gmRoom.layers); i < n; i++ ) { for( var i = 0, n = array_length(layers); i < n; i++ ) {
var _yy = _y + ui(8) + i * hh; var _ld = layers[i];
var _l = gmRoom.layers[i]; var _l = _ld.layer;
var _exposed = struct_has(inputMap, _l.name); var _d = _ld.depth;
var _xx = _x + _d * ui(32);
var _yy = _y + ui(8) + i * hh;
var _exposed = struct_has(inputMap, _l.name);
var cc = layer_selecting == _l? COLORS._main_text_accent : COLORS._main_text_sub; var cc = layer_selecting == _l? COLORS._main_text_accent : COLORS._main_text_sub;
if(_hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + hh - 1)) { if(_hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + hh - 1)) {
@ -49,9 +127,9 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(_exposed) draw_sprite_ui_uniform(THEME.animate_clock, 2, _x + ui(20),_yy + hh / 2, 1, COLORS._main_accent); if(_exposed) draw_sprite_ui_uniform(THEME.animate_clock, 2, _x + ui(20),_yy + hh / 2, 1, COLORS._main_accent);
draw_sprite_ui_uniform(s_gmlayer, _l.index, _x + ui(44), _yy + hh / 2, 1, cc); draw_sprite_ui_uniform(s_gmlayer, _l.index, _xx + ui(44), _yy + hh / 2, 1, cc);
draw_set_text(f_p2, fa_left, fa_center, cc); draw_set_text(f_p2, fa_left, fa_center, cc);
draw_text_add(_x + ui(64), _yy + hh / 2, _l.name); draw_text_add(_xx + ui(64), _yy + hh / 2, _l.name);
} }
return _h; return _h;
@ -80,10 +158,9 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var _yy = _y + ui(8); var _yy = _y + ui(8);
var _wdy = _yy; var _wdy = _yy;
var _wdh = ui(32); var _wdh = ui(32);
var _wpr = new widgetParam(_wdx, _wdy, _wdw, _wdh, _l.raw.depth, {}, _m, layer_renderer.rx, layer_renderer.ry); var _wpr = new widgetParam(_wdx, _wdy, _wdw, _wdh, _l.raw.depth, {}, _m, layer_renderer.rx, layer_renderer.ry)
_wpr.color = COLORS._main_icon_light; .setColor(COLORS._main_icon_light)
.setFocusHover(_focus, _hover);
tb_depth.setFocusHover(_focus, _hover);
tb_depth.drawParam(_wpr); tb_depth.drawParam(_wpr);
_yy += _wdh + ui(8); _yy += _wdh + ui(8);
@ -119,12 +196,9 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light); draw_sprite_stretched_ext(THEME.textbox, 3, _wdx, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx + _wdw / 2, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light); draw_sprite_stretched_ext(THEME.textbox, 3, _wdx + _wdw / 2, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
var _tw = _l.tiles.SerialiseWidth;
var _th = _l.tiles.SerialiseHeight;
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text);
draw_text_add(_wdx + _wdw / 4, _wdy + _wdh / 2, _tw); draw_text_add(_wdx + _wdw / 4, _wdy + _wdh / 2, _l.tiles.SerialiseWidth);
draw_text_add(_wdx + _wdw / 2 + _wdw / 4, _wdy + _wdh / 2, _th); draw_text_add(_wdx + _wdw / 2 + _wdw / 4, _wdy + _wdh / 2, _l.tiles.SerialiseHeight);
_yy += _wdh + ui(8); _yy += _wdh + ui(8);
_h += _wdh + ui(8); _h += _wdh + ui(8);
@ -164,13 +238,8 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
}); });
input_display_list = [ input_display_list = [
["Room settings", false], 0, 1, ["Room", false], room_renderer,
["Layers", false], ["Layers", false], layers_renderer, new Inspector_Spacer(ui(4)), layer_renderer,
layers_renderer,
new Inspector_Spacer(ui(4)),
layer_renderer,
["Data", true], ["Data", true],
]; ];
@ -186,25 +255,41 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
////- GM ////- GM
static roomLayerExtract = function(_layer, _depth = 0) {
var _arr = [];
for( var i = 0, n = array_length(_layer.layers); i < n; i++ ) {
var _l = _layer.layers[i];
array_push(_arr, { layer: _l, depth: _depth });
array_append(_arr, roomLayerExtract(_l, _depth + 1));
}
return _arr;
}
static bindRoom = function(_gmRoom) { static bindRoom = function(_gmRoom) {
gmRoom = _gmRoom; gmRoom = _gmRoom;
layers = []; layers = [];
layerMap = {}; layerMap = {};
if(_gmRoom == noone) return; if(_gmRoom == noone) return;
display_name = gmRoom.name;
gmRoom.gmBinder.nodeMap[$ gmRoom.key] = self; gmRoom.gmBinder.nodeMap[$ gmRoom.key] = self;
layers = gmRoom.layers; layers = roomLayerExtract(gmRoom);
for( var i = 0, n = array_length(layers); i < n; i++ ) maxTileSize = [ 1, 1 ];
layerMap[$ layers[i].name] = layers[i];
var _settings = gmRoom.raw.roomSettings; for( var i = 0, n = array_length(layers); i < n; i++ ) {
var _width = _settings.Width; var _l = layers[i].layer;
var _height = _settings.Height; layerMap[$ _l.name] = _l;
var _persistance = _settings.persistent; _l.refreshPreview();
if(is(_l, GMRoom_Tile) && _l.tileset != noone) {
maxTileSize[0] = max(maxTileSize[0], _l.tileset.raw.tileWidth);
maxTileSize[1] = max(maxTileSize[1], _l.tileset.raw.tileHeight);
}
}
inputs[0].setValue([_width, _height]);
inputs[1].setValue(_persistance);
} }
static exposeData = function(_layer) { static exposeData = function(_layer) {
@ -213,7 +298,8 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
_in.attributes.layerName = _layer.name; _in.attributes.layerName = _layer.name;
if(is(_layer, GMRoom_Tile)) { if(is(_layer, GMRoom_Tile)) {
_in.setType(VALUE_TYPE.integer); _in.setType(VALUE_TYPE.struct);
_in.editWidget.shorted = true;
var _tileset = gmRoom.gmBinder.getNodeFromPath(_layer.tileset.key, x - ui(320), y); var _tileset = gmRoom.gmBinder.getNodeFromPath(_layer.tileset.key, x - ui(320), y);
_tileset.bindTile(_layer.tileset); _tileset.bindTile(_layer.tileset);
@ -227,8 +313,197 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} }
static applyResizeRoom = function() {
room_resizing = false;
var _area = room_resizing_area;
var _dx = -_area[0];
var _dy = -_area[1];
var _ww = _area[2] - _area[0];
var _hh = _area[3] - _area[1];
gmRoom.roomSettings.Width = _ww;
gmRoom.roomSettings.Height = _hh;
for( var i = 0, n = array_length(layers); i < n; i++ ) {
var _l = layers[i].layer;
switch(instanceof(_l)) {
case "GMRoom_Tile" :
var _inp = inputMap[$ _l.name];
var _tw = _l.tileset.raw.tileWidth;
var _th = _l.tileset.raw.tileHeight;
var _trea = [ floor(_area[0] / _tw), floor(_area[1] / _tw),
ceil( _area[2] / _tw), ceil( _area[3] / _tw) ];
if(is_undefined(_inp)) {
_l.resizeBBOX(_trea);
} else if(_inp.value_from) {
var _nd = _inp.value_from.node;
if(is(_nd, Node_Tile_Drawer))
_nd.resizeBBOX(_trea);
}
break;
case "GMRoom_Instance" :
for( var j = 0, m = array_length(_l.instances); j < m; j++ ) {
var _ins = _l.instances[j];
_ins.data.x += _dx;
_ins.data.y += _dy;
}
break;
case "GMRoom_Asset" :
for( var j = 0, m = array_length(_l.assets); j < m; j++ ) {
var _ass = _l.assets[j];
_ass.data.x += _dx;
_ass.data.y += _dy;
}
break;
}
_l.refreshPreview();
}
triggerRender();
}
////- Update ////- Update
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
preview_alpha = room_resizing? .5 : 1;
if(!room_resizing) return;
var rw = gmRoom.roomSettings.Width;
var rh = gmRoom.roomSettings.Height;
var _x0 = _x;
var _y0 = _y;
var _x1 = _x + rw * _s;
var _y1 = _y + rh * _s;
var _area = room_resizing_area;
var _cx0 = _x + _area[0] * _s;
var _cy0 = _y + _area[1] * _s;
var _cx1 = _x + _area[2] * _s;
var _cy1 = _y + _area[3] * _s;
var _hov = noone;
if(hover) {
if(point_in_circle(_mx, _my, _cx0, _cy0, 10)) _hov = 0;
else if(point_in_circle(_mx, _my, _cx1, _cy0, 10)) _hov = 1;
else if(point_in_circle(_mx, _my, _cx0, _cy1, 10)) _hov = 2;
else if(point_in_circle(_mx, _my, _cx1, _cy1, 10)) _hov = 3;
else if(point_in_rectangle(_mx, _my, _cx0, _cy0, _cx1, _cy1)) _hov = 4;
}
for( var i = 0; i < 4; i++ ) room_resizing_hov[i] = lerp_float(room_resizing_hov[i], i == _hov, 5);
if(room_resizing_t != noone) _hov = room_resizing_t;
draw_set_color(_hov == 4? COLORS._main_accent : COLORS._main_icon);
draw_rectangle_dashed(_cx0, _cy0, _cx1, _cy1, 1 + (_hov == 4));
draw_anchor(room_resizing_hov[0], _cx0, _cy0, 10);
draw_anchor(room_resizing_hov[1], _cx1, _cy0, 10);
draw_anchor(room_resizing_hov[2], _cx0, _cy1, 10);
draw_anchor(room_resizing_hov[3], _cx1, _cy1, 10);
if(room_resizing_t == noone) {
if(_hov > noone && mouse_press(mb_left, active)) {
room_resizing_t = _hov;
room_resizing_ss = [ _area[0], _area[1], _area[2], _area[3] ];
room_resizing_mx = _mx;
room_resizing_my = _my;
}
} else {
var _dx = (_mx - room_resizing_mx) / _s;
var _dy = (_my - room_resizing_my) / _s;
var _sn = 8 / _s;
var _arss = room_resizing_ss;
var _dgx = undefined;
var _dgy = undefined;
switch(room_resizing_t) {
case 0 :
_area[0] = value_snap(round(_arss[0] + _dx), _snx);
_area[1] = value_snap(round(_arss[1] + _dy), _sny);
if(abs(_area[0]) < _sn) { _area[0] = 0; _dgx = 0; }
if(abs(_area[1]) < _sn) { _area[1] = 0; _dgy = 0; }
break;
case 1 :
_area[2] = value_snap(round(_arss[2] + _dx), _snx);
_area[1] = value_snap(round(_arss[1] + _dy), _sny);
if(abs(_area[2] - rw) < _sn) { _area[2] = rw; _dgx = rw; }
if(abs(_area[1]) < _sn) { _area[1] = 0; _dgy = 0; }
break;
case 2 :
_area[0] = value_snap(round(_arss[0] + _dx), _snx);
_area[3] = value_snap(round(_arss[3] + _dy), _sny);
if(abs(_area[0]) < _sn) { _area[0] = 0; _dgx = 0; }
if(abs(_area[3] - rh) < _sn) { _area[3] = rh; _dgy = rh; }
break;
case 3 :
_area[2] = value_snap(round(_arss[2] + _dx), _snx);
_area[3] = value_snap(round(_arss[3] + _dy), _sny);
if(abs(_area[2] - rw) < _sn) { _area[2] = rw; _dgx = rw; }
if(abs(_area[3] - rh) < _sn) { _area[3] = rh; _dgy = rh; }
break;
case 4 :
var _ww = _area[2] - _area[0];
var _hh = _area[3] - _area[1];
_area[0] = value_snap(round(_arss[0] + _dx), _snx);
_area[1] = value_snap(round(_arss[1] + _dy), _sny);
_area[2] = value_snap(round(_arss[2] + _dx), _snx);
_area[3] = value_snap(round(_arss[3] + _dy), _sny);
if(abs(_area[0]) < _sn) {
_area[0] = 0;
_area[2] = _ww;
_dgx = 0;
} else if(abs(_area[2] - rw) < _sn) {
_area[2] = rw;
_area[0] = rw - _ww;
_dgx = rw;
}
if(abs(_area[1]) < _sn) {
_area[1] = 0;
_area[3] = _hh;
_dgy = 0;
} else if(abs(_area[3] - rh) < _sn) {
_area[3] = rh;
_area[1] = rh - _hh;
_dgy = rh;
}
break;
}
draw_set_color(COLORS._main_accent);
if(_dgx != undefined) draw_line_width(_x + _dgx * _s, 0, _x + _dgx * _s, WIN_H, 2);
if(_dgy != undefined) draw_line_width(0, _y + _dgy * _s, WIN_W, _y + _dgy * _s, 2);
if(mouse_release(mb_left))
room_resizing_t = noone;
}
}
static step = function() { static step = function() {
} }
@ -236,6 +511,12 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
static update = function() { static update = function() {
if(gmRoom == noone) return; if(gmRoom == noone) return;
var _width = gmRoom.roomSettings.Width;
var _height = gmRoom.roomSettings.Height;
var _prev = outputs[0].getValue();
_prev = surface_verify(_prev, _width, _height);
for( var i = input_fix_len, n = array_length(inputs); i < n; i++ ) { for( var i = input_fix_len, n = array_length(inputs); i < n; i++ ) {
var _in = inputs[i]; var _in = inputs[i];
var _val = _in.getValue(); var _val = _in.getValue();
@ -244,38 +525,41 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
inputMap[$ _key] = _in; inputMap[$ _key] = _in;
if(is(_lay, GMRoom_Tile)) { if(is(_lay, GMRoom_Tile)) {
_in.setType(VALUE_TYPE.integer); _in.name = _lay.name;
_in.setType(VALUE_TYPE.struct);
_in.editWidget.shorted = true;
var _tw = _lay.tiles.SerialiseWidth; var _tw = _lay.tiles.SerialiseWidth;
var _th = _lay.tiles.SerialiseHeight; var _th = _lay.tiles.SerialiseHeight;
var _tile = array_verify(_val, _tw * _th);
var _ctil = [];
var _type = _tile[0]; var _tdata = struct_try_get(_val, "data", []);
var _runn = 1; var _tset = struct_try_get(_val, "tileset", noone);
for( var j = 1, m = array_length(_tile); j < m; j++ ) { var _tprev = struct_try_get(_val, "preview", noone);
if(_tile[j] == _type) _runn++
else { _lay.preview = _tprev;
array_push(_ctil, -_runn, _type);
_type = _tile[j]; if(_tset && _tset.gmTile) {
_runn = 1; _lay.tilesetId.name = _tset.gmTile.name;
_lay.tilesetId.path = _tset.gmTile.key;
}
_lay.setArray(_tdata);
} }
} }
array_push(_ctil, -_runn, _type); surface_set_target(_prev);
DRAW_CLEAR
if(array_length(_ctil) < array_length(_tile)) { for( var i = array_length(layers) - 1; i >= 0; i-- ) {
_lay.raw.tiles.TileCompressedData = _ctil; var _l = layers[i].layer;
_lay.raw.tiles.TileDataFormat = 1; var _p = _l.preview;
draw_surface_safe(_p);
} else {
_lay.raw.tiles.TileSerialiseData = _tile;
struct_remove(_lay.raw.tiles, "TileDataFormat");
}
}
} }
// gmRoom.sync(); surface_reset_target();
outputs[0].setValue(_prev);
gmRoom.sync();
} }
////- Serialize ////- Serialize

View file

@ -48,7 +48,6 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
static on_drop_file = function(path) { static on_drop_file = function(path) {
inputs[0].setValue(path); inputs[0].setValue(path);
if(updatePaths(path)) { doUpdate(); return true; } if(updatePaths(path)) { doUpdate(); return true; }
return false; return false;
} }

View file

@ -58,7 +58,7 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
var _bx = x1 - 20 - i * 24; var _bx = x1 - 20 - i * 24;
var _by = y0; var _by = y0;
if(buttonInstant(THEME.button_hide, _bx, _by, 20, 20, _m, _focus, _hover) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, 20, 20, _m, _hover, _focus) == 2)
histShow[i] = !histShow[i]; histShow[i] = !histShow[i];
draw_sprite_ui_uniform(THEME.circle, 0, _bx + 10, _by + 10, 1, COLORS.histogram[i], 0.5 + histShow[i] * 0.5); draw_sprite_ui_uniform(THEME.circle, 0, _bx + 10, _by + 10, 1, COLORS.histogram[i], 0.5 + histShow[i] * 0.5);
} }

View file

@ -62,7 +62,7 @@ function Node_Level_Selector(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
var _bx = x1 - 20 - i * 24; var _bx = x1 - 20 - i * 24;
var _by = y0; var _by = y0;
if(buttonInstant(THEME.button_hide, _bx, _by, 20, 20, _m, _focus, _hover) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, 20, 20, _m, _hover, _focus) == 2)
histShow[i] = !histShow[i]; histShow[i] = !histShow[i];
draw_sprite_ui_uniform(THEME.circle, 0, _bx + 10, _by + 10, 1, COLORS.histogram[i], 0.5 + histShow[i] * 0.5); draw_sprite_ui_uniform(THEME.circle, 0, _bx + 10, _by + 10, 1, COLORS.histogram[i], 0.5 + histShow[i] * 0.5);
} }

View file

@ -75,7 +75,7 @@ function Node_Liquefy(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var bs = ui(24); var bs = ui(24);
var bx = _x + ui(20); var bx = _x + ui(20);
var by = _y; var by = _y;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
createNewInput(); createNewInput();
triggerRender(); triggerRender();
} }
@ -118,7 +118,7 @@ function Node_Liquefy(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
var bs = ui(24); var bs = ui(24);
var bx = _x1 - bs; var bx = _x1 - bs;
var by = _yy - bs / 2; var by = _yy - bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
del_light = i; del_light = i;
} }
} }

View file

@ -62,7 +62,7 @@ function Node_MIDI_In(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var bs = TEXTBOX_HEIGHT; var bs = TEXTBOX_HEIGHT;
var bx = _x; var bx = _x;
var by = _wy; var by = _wy;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus) == 2)
index_watching = index_watching == i? noone : i; index_watching = index_watching == i? noone : i;
var cc = index_watching == i? COLORS._main_value_negative : COLORS._main_icon; var cc = index_watching == i? COLORS._main_value_negative : COLORS._main_icon;
draw_sprite_ext(THEME.circle_16, 0, bx + bs / 2, by + bs / 2, 1, 1, 0, cc, 1); draw_sprite_ext(THEME.circle_16, 0, bx + bs / 2, by + bs / 2, 1, 1, 0, cc, 1);

View file

@ -259,7 +259,7 @@ function Node_MK_Flare(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var by = _fy; var by = _fy;
var bs = ui(24); var bs = ui(24);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
array_push(_flares, new __FlarePart()); array_push(_flares, new __FlarePart());
inputs[5].setValue(_flares); inputs[5].setValue(_flares);
triggerRender(); triggerRender();
@ -267,7 +267,7 @@ function Node_MK_Flare(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
bx += bs + ui(8); bx += bs + ui(8);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, COLORS._main_value_negative) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, COLORS._main_value_negative) == 2) {
array_delete(_flares, array_length(_flares) - 1, 1); array_delete(_flares, array_length(_flares) - 1, 1);
inputs[5].setValue(_flares); inputs[5].setValue(_flares);
triggerRender(); triggerRender();

View file

@ -49,7 +49,7 @@ function Node_Normal_Light(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
var bs = ui(24); var bs = ui(24);
var bx = _x + ui(20); var bx = _x + ui(20);
var by = _y; var by = _y;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
createNewInput(); createNewInput();
triggerRender(); triggerRender();
} }
@ -92,7 +92,7 @@ function Node_Normal_Light(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
var bs = ui(24); var bs = ui(24);
var bx = _x1 - bs; var bx = _x1 - bs;
var by = _yy - bs / 2; var by = _yy - bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
del_light = i; del_light = i;
} }
} }

View file

@ -418,7 +418,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var by = bbox.y0 + 4 * _s; var by = bbox.y0 + 4 * _s;
var cc = colorMultiply(CDEF.main_white, _col); var cc = colorMultiply(CDEF.main_white, _col);
var b = buttonInstant(THEME.button_def, bx, by, bw, bh, [ _mx, _my ], _focus, _hover, "", THEME.minus, 0, COLORS._main_value_negative, 1, .75 * _s, cc); var b = buttonInstant(THEME.button_def, bx, by, bw, bh, [ _mx, _my ], _hover, _focus, "", THEME.minus, 0, COLORS._main_value_negative, 1, .75 * _s, cc);
if(b) draggable = false; if(b) draggable = false;
if(b == 2) { if(b == 2) {
val -= stp; val -= stp;
@ -427,7 +427,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} }
var bx = bbox.x1 - 4 * _s - bw; var bx = bbox.x1 - 4 * _s - bw;
var b = buttonInstant(THEME.button_def, bx, by, bw, bh, [ _mx, _my ], _focus, _hover, "", THEME.add, 0, COLORS._main_value_positive, 1, .75 * _s, cc); var b = buttonInstant(THEME.button_def, bx, by, bw, bh, [ _mx, _my ], _hover, _focus, "", THEME.add, 0, COLORS._main_value_positive, 1, .75 * _s, cc);
if(b) draggable = false; if(b) draggable = false;
if(b == 2) { if(b == 2) {
val += stp; val += stp;

View file

@ -174,7 +174,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
var bs = ui(24); var bs = ui(24);
var bx = _x + ui(20); var bx = _x + ui(20);
var by = _y; var by = _y;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
createNewInput(); createNewInput();
triggerRender(); triggerRender();
} }
@ -219,7 +219,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
var bs = ui(24); var bs = ui(24);
var bx = _x1 - bs; var bx = _x1 - bs;
var by = _yy - bs / 2; var by = _yy - bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
del_animator = i; del_animator = i;
} }

View file

@ -27,7 +27,8 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
newOutput(2, nodeValue_Output("Tileset", self, VALUE_TYPE.tileset, noone)); newOutput(2, nodeValue_Output("Tileset", self, VALUE_TYPE.tileset, noone));
newOutput(3, nodeValue_Output("Tile Data", self, VALUE_TYPE.integer, 0)); newOutput(3, nodeValue_Output("Tile Data", self, VALUE_TYPE.struct, {}));
outputs[3].editWidget.shorted = true;
output_display_list = [ 2, 1, 0, 3 ]; output_display_list = [ 2, 1, 0, 3 ];
@ -349,7 +350,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
var amo = _mapSize[0] * _mapSize[1]; var amo = _mapSize[0] * _mapSize[1];
if(gmTileLayer != noone) { if(gmTileLayer != noone) {
tileData = array_verify(tileData, amo); var tileArr = array_verify(struct_try_get(tileData, "data"), amo);
var i = 0; var i = 0;
var b; var b;
@ -364,13 +365,16 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
b = round(b); b = round(b);
switch(b) { switch(b) {
case 0 : tileData[i] = 0; break; case 0 : tileArr[i] = 0; break;
default : tileData[i] = b - 1; break; default : tileArr[i] = b - 1; break;
} }
i++; i++;
} }
tileData.tileset = tileset;
tileData.data = tileArr;
tileData.preview = _tileOut;
} }
return [ _tileOut, _tileMap, tileset, tileData ]; return [ _tileOut, _tileMap, tileset, tileData ];
@ -392,6 +396,8 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
if(gmTileLayer == noone) return; if(gmTileLayer == noone) return;
display_name = gmTileLayer.name;
var _w = gmTileLayer.tiles.SerialiseWidth; var _w = gmTileLayer.tiles.SerialiseWidth;
var _h = gmTileLayer.tiles.SerialiseHeight; var _h = gmTileLayer.tiles.SerialiseHeight;
inputs[1].setValue([ _w, _h ]); inputs[1].setValue([ _w, _h ]);
@ -433,11 +439,9 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
canvas_buffer = _b; canvas_buffer = _b;
canvas_surface = surface_verify(canvas_surface, _w, _h, surface_rgba16float); canvas_surface = surface_verify(canvas_surface, _w, _h, surface_rgba16float);
buffer_set_surface(canvas_buffer, canvas_surface, 0); buffer_set_surface(canvas_buffer, canvas_surface, 0);
triggerRender();
} }
////- Serialzie ////- Serialize
static attributeSerialize = function() { static attributeSerialize = function() {
var _attr = { var _attr = {
@ -470,4 +474,29 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
} }
} }
////- Actions
static resizeBBOX = function(bbox) {
var _nw = bbox[2] - bbox[0];
var _nh = bbox[3] - bbox[1];
var _dx = -bbox[0];
var _dy = -bbox[1];
inputs[1].setValue([_nw, _nh]);
var _newSurf = surface_create(_nw, _nh, surface_rgba16float);
surface_set_target(_newSurf);
DRAW_CLEAR
BLEND_OVERRIDE
draw_surface_safe(canvas_surface, _dx, _dy);
BLEND_NORMAL
surface_reset_target();
surface_free_safe(canvas_surface);
canvas_surface = _newSurf;
triggerRender();
}
} }

View file

@ -30,7 +30,7 @@ function Node_Tile_Convert(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
var by = _y; var by = _y;
var bs = ui(24); var bs = ui(24);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.refresh_16) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus,, THEME.refresh_16) == 2)
refreshPalette(); refreshPalette();
var _cmap = attributes.colorMap; var _cmap = attributes.colorMap;

View file

@ -14,6 +14,12 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
tb_rename.font = f_p2; tb_rename.font = f_p2;
tb_rename.hide = true; tb_rename.hide = true;
gmTile = noone;
texture = noone;
tileSize = [ 1, 1 ];
tileAmount = [ 1, 1 ];
rules = new Tileset_Rule(self);
newInput( 0, nodeValue_Surface("Texture", self, noone)); newInput( 0, nodeValue_Surface("Texture", self, noone));
newInput( 1, nodeValue_Vec2("Tile size", self, [ 16, 16 ])); newInput( 1, nodeValue_Vec2("Tile size", self, [ 16, 16 ]));
@ -50,7 +56,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_n.tool_pencil.toggle(); _n.tool_pencil.toggle();
} }
#region ++++ tile selector ++++ ////- Tile selector
#region Tile selector
tile_selector_surface = 0; tile_selector_surface = 0;
tile_selector_mask = 0; tile_selector_mask = 0;
tile_selector_h = ui(320); tile_selector_h = ui(320);
@ -93,11 +100,12 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _tsh = tile_selector.fixHeight > 0? tile_selector.fixHeight - ui(24 + 4 + 48 + 8) : tile_selector_h; var _tsh = tile_selector.fixHeight > 0? tile_selector.fixHeight - ui(24 + 4 + 48 + 8) : tile_selector_h;
var _h = _tsh; var _h = _tsh;
#region top bar
var bx = _x; var bx = _x;
var by = _yy; var by = _yy;
var bs = ui(24); var bs = ui(24);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "Clear selection", THEME.canvas_tools_selection_rectangle, 0, COLORS._main_icon_light) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "Clear selection", THEME.canvas_tools_selection_rectangle, 0, COLORS._main_icon_light) == 2) {
brush.brush_indices = [[]]; brush.brush_indices = [[]];
brush.brush_width = 0; brush.brush_width = 0;
brush.brush_height = 0; brush.brush_height = 0;
@ -106,7 +114,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _lx = bx + bs + ui(8); var _lx = bx + bs + ui(8);
bx = _x + _w - bs; bx = _x + _w - bs;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "Zoom to fit", THEME.path_tools_transform, 0, COLORS._main_icon_light) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "Zoom to fit", THEME.path_tools_transform, 0, COLORS._main_icon_light) == 2) {
if(is_surface(_tileSet)) { if(is_surface(_tileSet)) {
var _tdim = surface_get_dimension(_tileSet); var _tdim = surface_get_dimension(_tileSet);
var _sw = _w - _pd * 2; var _sw = _w - _pd * 2;
@ -168,7 +176,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
tile_zoom_drag = false; tile_zoom_drag = false;
} }
} }
#endregion
#region draw tile surface
_h += bs + ui(4); _h += bs + ui(4);
_yy += bs + ui(4); _yy += bs + ui(4);
@ -200,14 +210,22 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _tileHov_y = tile_selector_y + _mty * _tileSiz[1] * tile_selector_s; var _tileHov_y = tile_selector_y + _mty * _tileSiz[1] * tile_selector_s;
var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _tsh); var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _tsh);
var _bg0 = colorMultiply(COLORS.panel_bg_clear, COLORS.node_composite_bg_blend);
var _bg1 = colorMultiply(COLORS.panel_preview_transparent, COLORS.node_composite_bg_blend);
#region surface_set_target(tile_selector_surface);
surface_set_target(tile_selector_surface); surface_set_target(tile_selector_surface);
draw_clear(colorMultiply(COLORS.panel_bg_clear, COLORS.node_composite_bg_blend)); draw_clear(_bg0);
draw_sprite_tiled_ext(s_transparent, 0, tile_selector_x, tile_selector_y, tile_selector_s, tile_selector_s, colorMultiply(COLORS.panel_preview_transparent, COLORS.node_composite_bg_blend), 1); draw_sprite_tiled_ext(s_transparent, 0, tile_selector_x, tile_selector_y, tile_selector_s, tile_selector_s, _bg1, 1);
draw_surface_ext(_tileSet, tile_selector_x, tile_selector_y, tile_selector_s, tile_selector_s, 0, c_white, 1); draw_surface_ext(_tileSet, tile_selector_x, tile_selector_y, tile_selector_s, tile_selector_s, 0, c_white, 1);
if(gmTile != noone) {
var ssw = _tileSel_w / 16;
var ssh = _tileSel_h / 16; // non uniform tile size anyone?
draw_sprite_ext(s_transparent, 0, tile_selector_x + _tileSel_w / 2, tile_selector_y + _tileSel_h / 2, -ssw, ssh, 0, _bg0);
draw_sprite_ext(s_transparent, 0, tile_selector_x + _tileSel_w / 2, tile_selector_y + _tileSel_h / 2, ssw, ssh, 0, _bg1);
}
if(grid_draw) { if(grid_draw) {
var _gw = _tileSiz[0] * tile_selector_s; var _gw = _tileSiz[0] * tile_selector_s;
var _gh = _tileSiz[1] * tile_selector_s; var _gh = _tileSiz[1] * tile_selector_s;
@ -287,7 +305,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
surface_reset_target(); surface_reset_target();
#endregion #endregion
#region surface_set_target(tile_selector_mask); #region draw selector mask
surface_set_target(tile_selector_mask); surface_set_target(tile_selector_mask);
DRAW_CLEAR DRAW_CLEAR
draw_set_color(c_white); draw_set_color(c_white);
@ -307,7 +325,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
surface_reset_target(); surface_reset_target();
#endregion #endregion
if(tile_selecting) { // tile selection #region tile selection
if(tile_selecting) {
var _ts_sx = clamp(min(tile_select_ss[0], _mtx), 0, _tileAmo[0] - 1); var _ts_sx = clamp(min(tile_select_ss[0], _mtx), 0, _tileAmo[0] - 1);
var _ts_sy = clamp(min(tile_select_ss[1], _mty), 0, _tileAmo[1] - 1); var _ts_sy = clamp(min(tile_select_ss[1], _mty), 0, _tileAmo[1] - 1);
var _ts_ex = clamp(max(tile_select_ss[0], _mtx), 0, _tileAmo[0] - 1); var _ts_ex = clamp(max(tile_select_ss[0], _mtx), 0, _tileAmo[0] - 1);
@ -340,6 +359,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
tile_selecting = false; tile_selecting = false;
} }
} }
#endregion
#region pan zoom #region pan zoom
if(tile_dragging) { if(tile_dragging) {
@ -392,6 +412,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_surface(tile_selector_surface, _sx, _sy); draw_surface(tile_selector_surface, _sx, _sy);
#region misc
shader_set(sh_brush_outline); shader_set(sh_brush_outline);
var _brush_tiles = brush.brush_width * brush.brush_height; var _brush_tiles = brush.brush_width * brush.brush_height;
var _cc = c_white; var _cc = c_white;
@ -423,6 +444,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_surface_ext(autoterrain_selector_mask, _sx, _sy, 1, 1, 0, COLORS._main_accent, 1); draw_surface_ext(autoterrain_selector_mask, _sx, _sy, 1, 1, 0, COLORS._main_accent, 1);
shader_reset(); shader_reset();
} }
#endregion
#region varients #region varients
var _bw = 1; var _bw = 1;
@ -523,7 +545,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
tile_selector.setName("Tileset"); tile_selector.setName("Tileset");
#endregion #endregion
#region ++++ auto terrain ++++ ////- Auto terrain
#region Auto terrain
autoterrain = []; autoterrain = [];
autoterrain_selector_h = 0; autoterrain_selector_h = 0;
@ -538,13 +561,15 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _tdim = surface_get_dimension(_tileSet); var _tdim = surface_get_dimension(_tileSet);
var _tileAmo = [ floor(_tdim[0] / _tileSiz[0]), floor(_tdim[1] / _tileSiz[1]) ]; var _tileAmo = [ floor(_tdim[0] / _tileSiz[0]), floor(_tdim[1] / _tileSiz[1]) ];
#region top bar
var bx = _x; var bx = _x;
var by = _yy; var by = _yy;
var bs = ui(24); var bs = ui(24);
var _brush_tiles = brush.brush_width * brush.brush_height; var _brush_tiles = brush.brush_width * brush.brush_height;
var _fromSel = _brush_tiles == 9 || _brush_tiles == 15 || _brush_tiles == 25 ||_brush_tiles == 48 || _brush_tiles == 55; var _fromSel = _brush_tiles == 9 || _brush_tiles == 15 || _brush_tiles == 25 ||_brush_tiles == 48 || _brush_tiles == 55;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, _fromSel? "New autoterrain from selection" : "New autoterrain", THEME.add_16, 0, COLORS._main_value_positive) == 2) { var _txt = _fromSel? "New autoterrain from selection" : "New autoterrain";
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, _txt, THEME.add_16, 0, COLORS._main_value_positive) == 2) {
var _new_at = noone; var _new_at = noone;
var _indx = array_create(brush.brush_width * brush.brush_height); var _indx = array_create(brush.brush_width * brush.brush_height);
@ -569,6 +594,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
brush.brush_height = 1; brush.brush_height = 1;
} }
} }
#endregion
_h += bs + ui(4); _h += bs + ui(4);
_yy += bs + ui(4); _yy += bs + ui(4);
@ -590,6 +616,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _px = _x + ui(8); var _px = _x + ui(8);
var _py = _yy + ui(4); var _py = _yy + ui(4);
#region header
var _prin = array_safe_get(_at.index, _at.prevInd, undefined); var _prin = array_safe_get(_at.index, _at.prevInd, undefined);
if(_prin == undefined) draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon); if(_prin == undefined) draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon);
@ -610,7 +637,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var bs = ui(24); var bs = ui(24);
var bx = _w - bs - ui(4); var bx = _w - bs - ui(4);
var by = _yy + _hg / 2 - bs / 2; var by = _yy + _hg / 2 - bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2) var bc = _hov? COLORS._main_value_negative : COLORS._main_icon;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, bc) == 2)
del = i; del = i;
} }
@ -663,8 +692,11 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_yy += _hg; _yy += _hg;
_ah += _hg; _ah += _hg;
#endregion
if(_at.open) { if(!_at.open) continue;
#region content
_yy += ui(4); _yy += ui(4);
_ah += ui(4); _ah += ui(4);
@ -811,8 +843,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_yy += _pre_sh * _ss + ui(4); _yy += _pre_sh * _ss + ui(4);
_ah += _pre_sh * _ss + ui(4); _ah += _pre_sh * _ss + ui(4);
#endregion
}
} }
if(del != -1) { if(del != -1) {
@ -828,7 +859,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
autoterrain_selector.setName("Autoterrain"); autoterrain_selector.setName("Autoterrain");
#endregion #endregion
#region ++++ brush palette ++++ ////- Brush palette
#region Brush palette
brush_palette_h = ui(320); brush_palette_h = ui(320);
brush_palette = surface_create(64, 64, surface_rgba16float); brush_palette = surface_create(64, 64, surface_rgba16float);
@ -867,23 +899,24 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _tileSet = texture; var _tileSet = texture;
var _tileSiz = tileSize; var _tileSiz = tileSize;
#region top bar
var bx = _x; var bx = _x;
var by = _yy; var by = _yy;
var bs = ui(24); var bs = ui(24);
var _tsh = palette_viewer.fixHeight > 0? palette_viewer.fixHeight - ui(24 + 4) : brush_palette_h; var _tsh = palette_viewer.fixHeight > 0? palette_viewer.fixHeight - ui(24 + 4) : brush_palette_h;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "Pencil", THEME.canvas_tools_pencil, 0, palette_tool == 1? COLORS._main_accent : c_white) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "Pencil", THEME.canvas_tools_pencil, 0, palette_tool == 1? COLORS._main_accent : c_white) == 2)
palette_tool = palette_tool == 1? 0 : 1; palette_tool = palette_tool == 1? 0 : 1;
draw_sprite_ui_uniform(THEME.canvas_tools_pencil, 1, bx + bs / 2, by + bs / 2, 1, palette_tool == 1? COLORS._main_accent : c_white); draw_sprite_ui_uniform(THEME.canvas_tools_pencil, 1, bx + bs / 2, by + bs / 2, 1, palette_tool == 1? COLORS._main_accent : c_white);
bx += bs + ui(4); bx += bs + ui(4);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "Eraser", THEME.canvas_tools_eraser, 0, palette_tool == 2? COLORS._main_accent : c_white) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "Eraser", THEME.canvas_tools_eraser, 0, palette_tool == 2? COLORS._main_accent : c_white) == 2)
palette_tool = palette_tool == 2? 0 : 2; palette_tool = palette_tool == 2? 0 : 2;
bx = _x + _w - bs; bx = _x + _w - bs;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "Zoom to fit", THEME.path_tools_transform, 0, COLORS._main_icon_light) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "Zoom to fit", THEME.path_tools_transform, 0, COLORS._main_icon_light) == 2) {
if(is_surface(brush_palette_tile)) { if(is_surface(brush_palette_tile)) {
var _tdim = surface_get_dimension(brush_palette_tile); var _tdim = surface_get_dimension(brush_palette_tile);
var _sw = _w - _pd * 2; var _sw = _w - _pd * 2;
@ -900,6 +933,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_h += bs + ui(4); _h += bs + ui(4);
_yy += bs + ui(4); _yy += bs + ui(4);
#endregion
var _sx = _x + _pd; var _sx = _x + _pd;
var _sy = _yy + _pd; var _sy = _yy + _pd;
@ -912,6 +946,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
palette_selector_surface = surface_verify(palette_selector_surface, _sw, _sh); palette_selector_surface = surface_verify(palette_selector_surface, _sw, _sh);
palette_selector_mask = surface_verify(palette_selector_mask, _sw, _sh); palette_selector_mask = surface_verify(palette_selector_mask, _sw, _sh);
#region draw palette
if(!is_surface(_tileSet)) return _h; if(!is_surface(_tileSet)) return _h;
if(!is_surface(brush_palette)) { if(!is_surface(brush_palette)) {
if(brush_palette_buffer && buffer_exists(brush_palette_buffer)) if(brush_palette_buffer && buffer_exists(brush_palette_buffer))
@ -959,7 +994,6 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _tsh); var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _tsh);
#region surface_set_target(palette_selector_surface);
surface_set_target(palette_selector_surface); surface_set_target(palette_selector_surface);
draw_clear(colorMultiply(COLORS.panel_bg_clear, COLORS.node_composite_bg_blend)); draw_clear(colorMultiply(COLORS.panel_bg_clear, COLORS.node_composite_bg_blend));
draw_sprite_tiled_ext(s_transparent, 0, palette_selector_x, palette_selector_y, palette_selector_s, palette_selector_s, draw_sprite_tiled_ext(s_transparent, 0, palette_selector_x, palette_selector_y, palette_selector_s, palette_selector_s,
@ -1019,7 +1053,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
surface_reset_target(); surface_reset_target();
#endregion #endregion
if(palette_selecting) { //tile selection #region selection
if(palette_selecting) {
var _ts_sx = clamp(min(palette_select_ss[0], _mtx), 0, _tileAmo[0] - 1); var _ts_sx = clamp(min(palette_select_ss[0], _mtx), 0, _tileAmo[0] - 1);
var _ts_sy = clamp(min(palette_select_ss[1], _mty), 0, _tileAmo[1] - 1); var _ts_sy = clamp(min(palette_select_ss[1], _mty), 0, _tileAmo[1] - 1);
var _ts_ex = clamp(max(palette_select_ss[0], _mtx), 0, _tileAmo[0] - 1); var _ts_ex = clamp(max(palette_select_ss[0], _mtx), 0, _tileAmo[0] - 1);
@ -1041,6 +1076,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(mouse_release(mb_left)) if(mouse_release(mb_left))
palette_selecting = false; palette_selecting = false;
} }
#endregion
#region pan zoom #region pan zoom
if(palette_dragging) { if(palette_dragging) {
@ -1092,6 +1128,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
#endregion #endregion
if(palette_tool == 1) { if(palette_tool == 1) {
#region // pencil tool
surface_set_target(palette_selector_mask); surface_set_target(palette_selector_mask);
DRAW_CLEAR DRAW_CLEAR
draw_set_color(c_white); draw_set_color(c_white);
@ -1150,8 +1187,10 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
buffer_delete_safe(brush_palette_buffer); buffer_delete_safe(brush_palette_buffer);
brush_palette_buffer = buffer_from_surface(brush_palette); brush_palette_buffer = buffer_from_surface(brush_palette);
} }
#endregion
} else if(palette_tool == 2) { } else if(palette_tool == 2) {
#region eraser tool
surface_set_target(brush_palette_prev); surface_set_target(brush_palette_prev);
DRAW_CLEAR DRAW_CLEAR
@ -1191,8 +1230,10 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
buffer_delete_safe(brush_palette_buffer); buffer_delete_safe(brush_palette_buffer);
brush_palette_buffer = buffer_from_surface(brush_palette); brush_palette_buffer = buffer_from_surface(brush_palette);
} }
#endregion
} else if(palette_using) { } else if(palette_using) {
#region no tool
surface_set_target(palette_selector_mask); surface_set_target(palette_selector_mask);
DRAW_CLEAR DRAW_CLEAR
draw_set_color(c_white); draw_set_color(c_white);
@ -1204,6 +1245,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_rectangle(_tileSel_x, _tileSel_y, _tileSel_x + _tileSel_w, _tileSel_y + _tileSel_h, false); draw_rectangle(_tileSel_x, _tileSel_y, _tileSel_x + _tileSel_w, _tileSel_y + _tileSel_h, false);
} }
surface_reset_target(); surface_reset_target();
#endregion
} }
if(palette_tool) { if(palette_tool) {
@ -1232,7 +1274,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
palette_viewer.setName("Tile Palette"); palette_viewer.setName("Tile Palette");
#endregion #endregion
#region ++++ animated tiles ++++ ////- Animated tiles
#region Animated tiles
animatedTiles = []; animatedTiles = [];
animated_selector_h = 0; animated_selector_h = 0;
@ -1265,6 +1308,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _tdim = surface_get_dimension(_tileSet); var _tdim = surface_get_dimension(_tileSet);
var _tileAmo = [ floor(_tdim[0] / _tileSiz[0]), floor(_tdim[1] / _tileSiz[1]) ]; var _tileAmo = [ floor(_tdim[0] / _tileSiz[0]), floor(_tdim[1] / _tileSiz[1]) ];
#region top bar
var bx = _x; var bx = _x;
var by = _yy; var by = _yy;
var bs = ui(24); var bs = ui(24);
@ -1272,7 +1317,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(_brush_tiles < 1) if(_brush_tiles < 1)
draw_sprite_uniform(THEME.add_16, 0, bx + bs / 2, by + bs / 2, 1, COLORS._main_icon); draw_sprite_uniform(THEME.add_16, 0, bx + bs / 2, by + bs / 2, 1, COLORS._main_icon);
else if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "New animated tiles", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
else if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "New animated tiles", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
var _new_at = noone; var _new_at = noone;
var _indx = array_create(brush.brush_width * brush.brush_height); var _indx = array_create(brush.brush_width * brush.brush_height);
@ -1297,6 +1343,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_h += bs + ui(4); _h += bs + ui(4);
_yy += bs + ui(4); _yy += bs + ui(4);
#endregion
var _pd = ui(4); var _pd = ui(4);
var _ah = _pd * 2; var _ah = _pd * 2;
@ -1310,6 +1357,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _hg = ui(32); var _hg = ui(32);
var _at = animatedTiles[i]; var _at = animatedTiles[i];
#region header
var _pw = ui(24); var _pw = ui(24);
var _ph = ui(24); var _ph = ui(24);
var _px = _x + ui(8); var _px = _x + ui(8);
@ -1337,7 +1385,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var bs = ui(24); var bs = ui(24);
var bx = _w - bs - ui(4); var bx = _w - bs - ui(4);
var by = _yy + _hg / 2 - bs / 2; var by = _yy + _hg / 2 - bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _hover, _focus, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
del = i; del = i;
} }
@ -1397,8 +1445,11 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_yy += _hg; _yy += _hg;
_ah += _hg; _ah += _hg;
#endregion
if(_at.open) { if(!_at.open) continue;
#region content
_yy += ui(4); _yy += ui(4);
_ah += ui(4); _ah += ui(4);
@ -1484,8 +1535,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_yy += _pre_sh * _ss + ui(4); _yy += _pre_sh * _ss + ui(4);
_ah += _pre_sh * _ss + ui(4); _ah += _pre_sh * _ss + ui(4);
#endregion
}
} }
if(del != -1) { if(del != -1) {
@ -1502,12 +1552,6 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
animated_viewer.setName("Animated Tile"); animated_viewer.setName("Animated Tile");
#endregion #endregion
gmTile = noone;
texture = noone;
tileSize = [ 1, 1 ];
tileAmount = [ 1, 1 ];
rules = new Tileset_Rule(self);
input_display_list = [ 1, 0, input_display_list = [ 1, 0,
["Tileset", false, noone, tile_selector.b_toggle ], tile_selector, ["Tileset", false, noone, tile_selector.b_toggle ], tile_selector,
["Autoterrains", true, noone, autoterrain_selector.b_toggle ], autoterrain_selector, ["Autoterrains", true, noone, autoterrain_selector.b_toggle ], autoterrain_selector,
@ -1516,6 +1560,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
["Rules", true, noone, rules.b_toggle ], rules, ["Rules", true, noone, rules.b_toggle ], rules,
]; ];
////- Update
static shader_submit = function() { static shader_submit = function() {
shader_set_2("tileSize", tileSize); shader_set_2("tileSize", tileSize);
@ -1527,8 +1573,6 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
shader_set_f("animatedTilesLength", aTilesLength); shader_set_f("animatedTilesLength", aTilesLength);
} }
////- Update
static update = function(frame = CURRENT_FRAME) { static update = function(frame = CURRENT_FRAME) {
texture = inputs[0].getValue(); texture = inputs[0].getValue();
tileSize = inputs[1].getValue(); tileSize = inputs[1].getValue();
@ -1568,12 +1612,22 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
////- GM ////- GM
static bindTile = function(_gmTile) { static droppable = function(obj) { return struct_try_get(obj, "type", "") == "GMTileSet"; }
gmTile = _gmTile; static onDrop = function(obj) {
if(gmTile == noone) { if(!droppable(obj)) return;
return; bindTile(obj.data);
} }
static bindTile = function(_gmTile) {
gmTile = _gmTile;
if(gmTile == noone) return;
display_name = gmTile.name;
var _tw = _gmTile.raw.tileWidth;
var _th = _gmTile.raw.tileHeight;
inputs[1].setValue([ _tw, _th ]);
} }
////- Serialize ////- Serialize

View file

@ -59,7 +59,7 @@ function outputBox() : widget() constructor {
var _bx = _x + _w - ui(8) - _bs; var _bx = _x + _w - ui(8) - _bs;
var _by = _y + ui(8); var _by = _y + ui(8);
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, iactive, ihover, "", THEME.arrow, expand? 3 : 0) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, ihover, iactive, "", THEME.arrow, expand? 3 : 0) == 2)
expand = !expand; expand = !expand;
} }
@ -111,7 +111,7 @@ function outputStructBox() : widget() constructor {
var _bx = _x + _w - ui(8) - _bs; var _bx = _x + _w - ui(8) - _bs;
var _by = _y + ui(8); var _by = _y + ui(8);
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, iactive, ihover, "", THEME.arrow, expand? 3 : 0) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, ihover, iactive, "", THEME.arrow, expand? 3 : 0) == 2)
expand = !expand; expand = !expand;
} }

View file

@ -116,12 +116,12 @@ function Panel_Addon() : PanelContent() constructor {
var _bx = bx - ui(4); var _bx = bx - ui(4);
var _by = by + ui(4); var _by = by + ui(4);
var b = buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, __txt("Open in explorer"), THEME.folder_content); var b = buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pHOVER, pFOCUS, __txt("Open in explorer"), THEME.folder_content);
if(b) hover = false; if(b) hover = false;
if(b == 2) shellOpenExplorer(DIRECTORY + "Addons/" + _addon.name); if(b == 2) shellOpenExplorer(DIRECTORY + "Addons/" + _addon.name);
_bx -= ui(36) _bx -= ui(36)
if(_act && buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, __txt("Addon settings"), THEME.addon_setting) == 2) { if(_act && buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pHOVER, pFOCUS, __txt("Addon settings"), THEME.addon_setting) == 2) {
var _addObj = noone; var _addObj = noone;
with(_addon_custom) if(name == _addon.name) _addObj = self; with(_addon_custom) if(name == _addon.name) _addObj = self;

View file

@ -1544,7 +1544,7 @@ function Panel_Animation() : PanelContent() constructor {
var _gx = ui(20); var _gx = ui(20);
var _gy = ty; var _gy = ty;
if(hov) if(hov)
if(buttonInstant(noone, _gx - ui(10), _gy - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.animate_prop_go, 0, [COLORS._main_icon, COLORS._main_icon_on_inner], 0.75) == 2) { if(buttonInstant(noone, _gx - ui(10), _gy - ui(9), ui(20), ui(17), [msx, msy], pHOVER, pFOCUS, "", THEME.animate_prop_go, 0, [COLORS._main_icon, COLORS._main_icon_on_inner], 0.75) == 2) {
graphFocusNode(_node); graphFocusNode(_node);
PANEL_INSPECTOR.highlightProp(prop); PANEL_INSPECTOR.highlightProp(prop);
} }
@ -1576,7 +1576,7 @@ function Panel_Animation() : PanelContent() constructor {
#region keyframe control #region keyframe control
tx = tool_width - ui(20 + 16 * 3); tx = tool_width - ui(20 + 16 * 3);
if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 0, [COLORS._main_icon, COLORS._main_icon_on_inner], _tool_a) == 2) { if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pHOVER, pFOCUS, "", THEME.prop_keyframe, 0, [COLORS._main_icon, COLORS._main_icon_on_inner], _tool_a) == 2) {
var _t = -1; var _t = -1;
for(var k = 0; k < array_length(animator.values); k++) { for(var k = 0; k < array_length(animator.values); k++) {
var _key = animator.values[k]; var _key = animator.values[k];
@ -1587,7 +1587,7 @@ function Panel_Animation() : PanelContent() constructor {
} }
tx = tool_width - ui(20 + 16 * 1); tx = tool_width - ui(20 + 16 * 1);
if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 2, [COLORS._main_icon, COLORS._main_icon_on_inner], _tool_a) == 2) { if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pHOVER, pFOCUS, "", THEME.prop_keyframe, 2, [COLORS._main_icon, COLORS._main_icon_on_inner], _tool_a) == 2) {
for(var k = 0; k < array_length(animator.values); k++) { for(var k = 0; k < array_length(animator.values); k++) {
var _key = animator.values[k]; var _key = animator.values[k];
if(_key.time > CURRENT_FRAME) { if(_key.time > CURRENT_FRAME) {
@ -1600,7 +1600,7 @@ function Panel_Animation() : PanelContent() constructor {
#region add keyframe #region add keyframe
tx = tool_width - ui(20 + 16 * 2); tx = tool_width - ui(20 + 16 * 2);
if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 1, [COLORS._main_accent, COLORS._main_icon_on_inner], _tool_a) == 2) { if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pHOVER, pFOCUS, "", THEME.prop_keyframe, 1, [COLORS._main_accent, COLORS._main_icon_on_inner], _tool_a) == 2) {
var _add = false; var _add = false;
for(var k = 0; k < array_length(animator.values); k++) { for(var k = 0; k < array_length(animator.values); k++) {
var _key = animator.values[k]; var _key = animator.values[k];
@ -2519,7 +2519,7 @@ function Panel_Animation() : PanelContent() constructor {
var cc = IS_RENDERING? COLORS._main_icon_dark : but[2](); var cc = IS_RENDERING? COLORS._main_icon_dark : but[2]();
var fnc = but[3]; var fnc = but[3];
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS && !IS_RENDERING, pHOVER && !IS_RENDERING, txt, THEME.sequence_control, ind, cc) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER && !IS_RENDERING, pFOCUS && !IS_RENDERING, txt, THEME.sequence_control, ind, cc) == 2)
fnc(); fnc();
bx += ui(36); bx += ui(36);
@ -2569,11 +2569,11 @@ function Panel_Animation() : PanelContent() constructor {
by += ui(36); by += ui(36);
bx = w - ui(44); bx = w - ui(44);
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_animation_animation_settings", "Animation settings"), THEME.gear, 2) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txtx("panel_animation_animation_settings", "Animation settings"), THEME.gear, 2) == 2)
dialogPanelCall(new Panel_Animation_Setting(), x + bx + ui(32), y + by - ui(8), { anchor: ANCHOR.right | ANCHOR.bottom }); dialogPanelCall(new Panel_Animation_Setting(), x + bx + ui(32), y + by - ui(8), { anchor: ANCHOR.right | ANCHOR.bottom });
by -= ui(40); if(by < 8) return; by -= ui(40); if(by < 8) return;
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_animation_scale_animation", "Scale animation"), THEME.animation_timing, 2) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txtx("panel_animation_scale_animation", "Scale animation"), THEME.animation_timing, 2) == 2)
dialogPanelCall(new Panel_Animation_Scaler(), x + bx + ui(32), y + by - ui(8), { anchor: ANCHOR.right | ANCHOR.bottom }); dialogPanelCall(new Panel_Animation_Scaler(), x + bx + ui(32), y + by - ui(8), { anchor: ANCHOR.right | ANCHOR.bottom });
var max_y = by - ui(28); var max_y = by - ui(28);
@ -2581,7 +2581,7 @@ function Panel_Animation() : PanelContent() constructor {
by = ui(8); by = ui(8);
var txt = __txt("New folder"); var txt = __txt("New folder");
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pFOCUS, pHOVER, txt, THEME.folder_content) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pHOVER, pFOCUS, txt, THEME.folder_content) == 2) {
var _dir = new timelineItemGroup(); var _dir = new timelineItemGroup();
PROJECT.timelines.addItem(_dir); PROJECT.timelines.addItem(_dir);
} }
@ -2589,21 +2589,21 @@ function Panel_Animation() : PanelContent() constructor {
by += ui(32); if(by > max_y) return; by += ui(32); if(by > max_y) return;
node_name_tooltip.index = node_name_type; node_name_tooltip.index = node_name_type;
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pFOCUS, pHOVER, node_name_tooltip, THEME.node_name_type, node_name_type) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pHOVER, pFOCUS, node_name_tooltip, THEME.node_name_type, node_name_type) == 2)
node_name_type = (node_name_type + 1) % 3; node_name_type = (node_name_type + 1) % 3;
by += ui(32); if(by > max_y) return; by += ui(32); if(by > max_y) return;
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pFOCUS, pHOVER, tooltip_toggle_nodes, THEME.junc_visible, show_nodes) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pHOVER, pFOCUS, tooltip_toggle_nodes, THEME.junc_visible, show_nodes) == 2)
show_nodes = !show_nodes; show_nodes = !show_nodes;
by += ui(32); if(by > max_y) return; by += ui(32); if(by > max_y) return;
txt = __txtx("panel_animation_keyframe_override", "Override Keyframe"); txt = __txtx("panel_animation_keyframe_override", "Override Keyframe");
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pFOCUS, pHOVER, txt, THEME.keyframe_override, global.FLAG.keyframe_override) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pHOVER, pFOCUS, txt, THEME.keyframe_override, global.FLAG.keyframe_override) == 2)
global.FLAG.keyframe_override = !global.FLAG.keyframe_override; global.FLAG.keyframe_override = !global.FLAG.keyframe_override;
by += ui(32); if(by > max_y) return; by += ui(32); if(by > max_y) return;
txt = __txt("Onion skin"); txt = __txt("Onion skin");
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pFOCUS, pHOVER, txt, THEME.onion_skin,, PROJECT.onion_skin.enabled? c_white : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(28), [mx, my], pHOVER, pFOCUS, txt, THEME.onion_skin,, PROJECT.onion_skin.enabled? c_white : COLORS._main_icon) == 2)
PROJECT.onion_skin.enabled = !PROJECT.onion_skin.enabled; PROJECT.onion_skin.enabled = !PROJECT.onion_skin.enabled;
} }

View file

@ -818,7 +818,7 @@ function Panel_Collection() : PanelContent() constructor {
var by = ui(9); var by = ui(9);
var bs = ui(32); var bs = ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, __txt("Search"), THEME.search_24, 0, searching? COLORS._main_accent : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pHOVER, pFOCUS, __txt("Search"), THEME.search_24, 0, searching? COLORS._main_accent : COLORS._main_icon) == 2)
search_toggle(); search_toggle();
bx -= ui(36); bx -= ui(36);
@ -837,7 +837,7 @@ function Panel_Collection() : PanelContent() constructor {
if(bx < rootx) return; if(bx < rootx) return;
if(context != root) { if(context != root) {
var txt = __txtx("panel_collection_add_node", "Add selecting node as collection"); var txt = __txtx("panel_collection_add_node", "Add selecting node as collection");
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.add_20, 0, COLORS._main_value_positive) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pHOVER, pFOCUS, txt, THEME.add_20, 0, COLORS._main_value_positive) == 2) {
if(PANEL_INSPECTOR.getInspecting() != noone) { if(PANEL_INSPECTOR.getInspecting() != noone) {
data_path = context.path; data_path = context.path;
var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(8)); var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(8));
@ -854,7 +854,7 @@ function Panel_Collection() : PanelContent() constructor {
if(bx < rootx) return; if(bx < rootx) return;
var txt = __txtx("panel_collection_add_folder", "Add folder"); var txt = __txtx("panel_collection_add_folder", "Add folder");
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pHOVER, pFOCUS, txt) == 2) {
fileNameCall(context.path, function (txt) { fileNameCall(context.path, function (txt) {
directory_create(txt); directory_create(txt);
refreshContext(); refreshContext();
@ -868,20 +868,20 @@ function Panel_Collection() : PanelContent() constructor {
if(pageStr[page] != "Nodes") { if(pageStr[page] != "Nodes") {
if(bx < rootx) return; if(bx < rootx) return;
var txt = __txtx("panel_collection_open_file", "Open in file explorer"); var txt = __txtx("panel_collection_open_file", "Open in file explorer");
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.path_open) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pHOVER, pFOCUS, txt, THEME.path_open) == 2)
shellOpenExplorer(context.path); shellOpenExplorer(context.path);
draw_sprite_ui_uniform(THEME.path_open, 1, bx + bs / 2, by + bs / 2, 1, c_white); draw_sprite_ui_uniform(THEME.path_open, 1, bx + bs / 2, by + bs / 2, 1, c_white);
bx -= ui(36); bx -= ui(36);
if(bx < rootx) return; if(bx < rootx) return;
var txt = __txt("Refresh"); var txt = __txt("Refresh");
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.refresh_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pHOVER, pFOCUS, txt, THEME.refresh_icon) == 2)
refreshContext(); refreshContext();
bx -= ui(36); bx -= ui(36);
if(bx < rootx) return; if(bx < rootx) return;
var txt = __txt("Settings"); var txt = __txt("Settings");
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.gear) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pHOVER, pFOCUS, txt, THEME.gear) == 2)
dialogPanelCall(new Panel_Collections_Setting(), x + bx, y + by - 8, { anchor: ANCHOR.bottom | ANCHOR.left }); dialogPanelCall(new Panel_Collections_Setting(), x + bx, y + by - 8, { anchor: ANCHOR.bottom | ANCHOR.left });
bx -= ui(36); bx -= ui(36);

View file

@ -427,11 +427,11 @@ function Panel_File_Explorer() : PanelContent() constructor {
var _ppw = _pw; var _ppw = _pw;
if(point_in_rectangle(_m[0], _m[1], _px, _py, _px + _pw, _py + _ph)) { if(point_in_rectangle(_m[0], _m[1], _px, _py, _px + _pw, _py + _ph)) {
if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pFOCUS, pHOVER, "Set as root", THEME.path_open_20) == 2) if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pHOVER, pFOCUS, "Set as root", THEME.path_open_20) == 2)
setRoot(_dir.path); setRoot(_dir.path);
_ppw -= _ph + ui(2); _ppw -= _ph + ui(2);
if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pFOCUS, pHOVER, "Copy path", THEME.copy_20) == 2) if(buttonInstant(THEME.button_hide, _px + _ppw - _ph, _py, _ph, _ph, _m, pHOVER, pFOCUS, "Copy path", THEME.copy_20) == 2)
clipboard_set_text(_dir.path); clipboard_set_text(_dir.path);
_ppw -= _ph + ui(2); _ppw -= _ph + ui(2);
@ -507,12 +507,12 @@ function Panel_File_Explorer() : PanelContent() constructor {
var _bx = _px + _tw + ui(4); var _bx = _px + _tw + ui(4);
if(path_is_image(_fil.path)) { if(path_is_image(_fil.path)) {
if(buttonInstant(noone, _bx, _py, _ph, _ph, _m, pFOCUS, pHOVER, "", THEME.image_20, 0, [ COLORS._main_icon, c_white ]) == 2) { if(buttonInstant(noone, _bx, _py, _ph, _ph, _m, pHOVER, pFOCUS, "", THEME.image_20, 0, [ COLORS._main_icon, c_white ]) == 2) {
Node_create_Image_path(_graph_x, _graph_y, _fil.path); Node_create_Image_path(_graph_x, _graph_y, _fil.path);
draggable = false; draggable = false;
} _bx += _ph + ui(2); } _bx += _ph + ui(2);
if(buttonInstant(noone, _bx, _py, _ph, _ph, _m, pFOCUS, pHOVER, "", THEME.canvas_20, 0, [ COLORS._main_icon, c_white ]) == 2) { if(buttonInstant(noone, _bx, _py, _ph, _ph, _m, pHOVER, pFOCUS, "", THEME.canvas_20, 0, [ COLORS._main_icon, c_white ]) == 2) {
var node = nodeBuild("Node_Canvas", _graph_x, _graph_y).loadImagePath(_fil.path); var node = nodeBuild("Node_Canvas", _graph_x, _graph_y).loadImagePath(_fil.path);
PANEL_PREVIEW.setNodePreview(node); PANEL_PREVIEW.setNodePreview(node);
PANEL_INSPECTOR.inspecting = node; PANEL_INSPECTOR.inspecting = node;
@ -521,7 +521,7 @@ function Panel_File_Explorer() : PanelContent() constructor {
} _bx += _ph + ui(2); } _bx += _ph + ui(2);
} else if(path_is_project(_fil.path)) { } else if(path_is_project(_fil.path)) {
if(buttonInstant(noone, _bx, _py, _ph, _ph, _m, pFOCUS, pHOVER, "", THEME.path_open_20, 0, [ COLORS._main_icon, c_white ]) == 2) { if(buttonInstant(noone, _bx, _py, _ph, _ph, _m, pHOVER, pFOCUS, "", THEME.path_open_20, 0, [ COLORS._main_icon, c_white ]) == 2) {
LOAD_AT(_fil.path); LOAD_AT(_fil.path);
draggable = false; draggable = false;
} _bx += _ph + ui(2); } _bx += _ph + ui(2);
@ -665,7 +665,7 @@ function Panel_File_Explorer() : PanelContent() constructor {
draw_sprite_stretched(THEME.ui_panel_bg, 1, cnt_x, cnt_y, cnt_w, cnt_h); draw_sprite_stretched(THEME.ui_panel_bg, 1, cnt_x, cnt_y, cnt_w, cnt_h);
var bs = top_bar - pad - ui(8); var bs = top_bar - pad - ui(8);
if(buttonInstant(THEME.button_hide, pad, pad, bs, bs, [mx, my], pFOCUS, pHOVER, "Go up", THEME.arrow, 1, root != ""? COLORS._main_icon : COLORS._main_icon_dark) == 2) if(buttonInstant(THEME.button_hide, pad, pad, bs, bs, [mx, my], pHOVER, pFOCUS, "Go up", THEME.arrow, 1, root != ""? COLORS._main_icon : COLORS._main_icon_dark) == 2)
if(root != "") setRoot(filename_dir(root)); if(root != "") setRoot(filename_dir(root));
var tb_x = cnt_x + ui(32); var tb_x = cnt_x + ui(32);
@ -673,7 +673,7 @@ function Panel_File_Explorer() : PanelContent() constructor {
var tb_w = w - pad - tb_x - bs - ui(4); var tb_w = w - pad - tb_x - bs - ui(4);
var tb_h = top_bar - pad - ui(8); var tb_h = top_bar - pad - ui(8);
if(buttonInstant(THEME.button_hide, w - pad - bs, pad, bs, bs, [mx, my], pFOCUS, pHOVER, view_mode_tooltip, THEME.view_mode, !view_mode) == 2) { if(buttonInstant(THEME.button_hide, w - pad - bs, pad, bs, bs, [mx, my], pHOVER, pFOCUS, view_mode_tooltip, THEME.view_mode, !view_mode) == 2) {
view_mode = !view_mode; view_mode = !view_mode;
PREFERENCES.file_explorer_view = view_mode; PREFERENCES.file_explorer_view = view_mode;
} }

View file

@ -52,7 +52,7 @@ function Panel_GM_Explore(gmBinder) : PanelContent() constructor {
var _bx = px + pw - _bs; var _bx = px + pw - _bs;
var _by = py; var _by = py;
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, "", THEME.refresh_16) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pHOVER, pFOCUS, "", THEME.refresh_16) == 2)
gmBinder.refreshResources(); gmBinder.refreshResources();
sc_content.setFocusHover(pFOCUS, pHOVER); sc_content.setFocusHover(pFOCUS, pHOVER);

View file

@ -74,7 +74,7 @@ function Panel_Gradient() : PanelContent() constructor {
// var bx = w - ui(32 + 16); // var bx = w - ui(32 + 16);
// var by = padding / 2 - ui(16 + !in_dialog * 2); // var by = padding / 2 - ui(16 + !in_dialog * 2);
// if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Refresh"), THEME.refresh_icon, 1, COLORS._main_icon) == 2) // if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txt("Refresh"), THEME.refresh_icon, 1, COLORS._main_icon) == 2)
// __initGradient(); // __initGradient();
} }
} }

View file

@ -2160,7 +2160,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
th = string_height(tt); th = string_height(tt);
if(i < array_length(node_context) - 1) { if(i < array_length(node_context) - 1) {
if(buttonInstant(THEME.button_hide_fill, xx - ui(6), tbh - bh / 2, tw + ui(12), bh, [mx, my], pFOCUS, pHOVER) == 2) { if(buttonInstant(THEME.button_hide_fill, xx - ui(6), tbh - bh / 2, tw + ui(12), bh, [mx, my], pHOVER, pFOCUS) == 2) {
node_hover = noone; node_hover = noone;
nodes_selecting = []; nodes_selecting = [];
PANEL_PREVIEW.resetNodePreview(); PANEL_PREVIEW.resetNodePreview();
@ -2238,7 +2238,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
var bs = ui(28); var bs = ui(28);
if(tbx - (bs + ui(4)) < cont_x) break; if(tbx - (bs + ui(4)) < cont_x) break;
var b = buttonInstant(THEME.button_hide, tbx - bs, tby - bs / 2, bs, bs, _m, pFOCUS, pHOVER, tbTooltip, tbObj, tbInd); var b = buttonInstant(THEME.button_hide, tbx - bs, tby - bs / 2, bs, bs, _m, pHOVER, pFOCUS, tbTooltip, tbObj, tbInd);
if(b == 2) tb[3]( { x: x + tbx - bs, y: y + tby - bs / 2 } ); if(b == 2) tb[3]( { x: x + tbx - bs, y: y + tby - bs / 2 } );
tbx -= bs + ui(4); tbx -= bs + ui(4);
} }
@ -2400,13 +2400,13 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
var bs = ui(24); var bs = ui(24);
var bx = x1 - bs - pd; var bx = x1 - bs - pd;
var by = y0 + pd; var by = y0 + pd;
if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, "", THEME.cross_16) == 2 if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, "", THEME.cross_16) == 2
|| keyboard_check_pressed(vk_escape) || keyboard_check_pressed(vk_escape)
|| keyboard_check_pressed(vk_enter)) || keyboard_check_pressed(vk_enter))
is_searching = false; is_searching = false;
bx -= bs + ui(4); bx -= bs + ui(4);
if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, "", THEME.arrow_wire_16, 0) == 2) { if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, "", THEME.arrow_wire_16, 0) == 2) {
if(!array_empty(search_result)) { if(!array_empty(search_result)) {
search_index = safe_mod(search_index + 1, array_length(search_result)); search_index = safe_mod(search_index + 1, array_length(search_result));
nodes_selecting = [ search_result[search_index] ]; nodes_selecting = [ search_result[search_index] ];
@ -2415,7 +2415,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
} }
bx -= bs + ui(4); bx -= bs + ui(4);
if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, "", THEME.arrow_wire_16, 2) == 2) { if(buttonInstant(THEME.button_hide_fill, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, "", THEME.arrow_wire_16, 2) == 2) {
if(!array_empty(search_result)) { if(!array_empty(search_result)) {
search_index = safe_mod(search_index - 1 + array_length(search_result), array_length(search_result)); search_index = safe_mod(search_index - 1 + array_length(search_result), array_length(search_result));
nodes_selecting = [ search_result[search_index] ]; nodes_selecting = [ search_result[search_index] ];

View file

@ -161,7 +161,7 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor {
var bx = _sx1 - ui(24) - ui(4); var bx = _sx1 - ui(24) - ui(4);
var by = _sy + ui(1) + ui(4); var by = _sy + ui(1) + ui(4);
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, pFOCUS, pHOVER) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, pHOVER, pFOCUS) == 2)
refresh(); refresh();
draw_sprite_ui(THEME.refresh_16, 0, bx + ui(12), by + ui(12),,,, COLORS._main_icon, 1); draw_sprite_ui(THEME.refresh_16, 0, bx + ui(12), by + ui(12),,,, COLORS._main_icon, 1);

View file

@ -1220,10 +1220,10 @@ function Panel_Inspector() : PanelContent() constructor {
draw_set_font(f_p1); draw_set_font(f_p1);
var lx = w / 2 - string_width(inspecting.name) / 2 - ui(10); var lx = w / 2 - string_width(inspecting.name) / 2 - ui(10);
var ly = ui(56 - 8); var ly = ui(56 - 8);
if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Lock"), THEME.lock_12, !locked, locked? COLORS._main_icon_light : COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pHOVER, pFOCUS, __txt("Lock"), THEME.lock_12, !locked, locked? COLORS._main_icon_light : COLORS._main_icon) == 2)
locked = !locked; locked = !locked;
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Presets"), THEME.preset, 1) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txt("Presets"), THEME.preset, 1) == 2)
dialogPanelCall(new Panel_Presets(inspecting), x + bx, y + by + ui(36)); dialogPanelCall(new Panel_Presets(inspecting), x + bx, y + by + ui(36));
} else { } else {
draw_sprite_ui_uniform(THEME.preset, 1, bx + ui(32) / 2, by + ui(32) / 2, 1, COLORS._main_icon_dark); draw_sprite_ui_uniform(THEME.preset, 1, bx + ui(32) / 2, by + ui(32) / 2, 1, COLORS._main_icon_dark);
@ -1241,7 +1241,7 @@ function Panel_Inspector() : PanelContent() constructor {
var tt = inspecting.insp1UpdateTooltip; var tt = inspecting.insp1UpdateTooltip;
if(inspectGroup) tt += " [All]"; if(inspectGroup) tt += " [All]";
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS && ac, pHOVER && ac, tt, icon[0], icon[1], cc) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER && ac, pFOCUS && ac, tt, icon[0], icon[1], cc) == 2) {
if(inspectGroup == 1) { if(inspectGroup == 1) {
for( var i = 0, n = array_length(inspectings); i < n; i++ ) inspectings[i].inspector1Update(); for( var i = 0, n = array_length(inspectings); i < n; i++ ) inspectings[i].inspector1Update();
} else } else
@ -1258,7 +1258,7 @@ function Panel_Inspector() : PanelContent() constructor {
var tt = inspecting.insp2UpdateTooltip; var tt = inspecting.insp2UpdateTooltip;
if(inspectGroup) tt += " [All]"; if(inspectGroup) tt += " [All]";
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS && ac, pHOVER && ac, tt, icon[0], icon[1], cc) = 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER && ac, pFOCUS && ac, tt, icon[0], icon[1], cc) = 2) {
if(inspectGroup) { if(inspectGroup) {
for( var i = 0, n = array_length(inspectings); i < n; i++ ) inspectings[i].inspector2Update(); for( var i = 0, n = array_length(inspectings); i < n; i++ ) inspectings[i].inspector2Update();
} else } else
@ -1274,7 +1274,7 @@ function Panel_Inspector() : PanelContent() constructor {
if(inspecting && !inspecting.active) inspecting = noone; if(inspecting && !inspecting.active) inspecting = noone;
view_mode_tooltip.index = viewMode; view_mode_tooltip.index = viewMode;
if(buttonInstant(THEME.button_hide, ui(8), ui(48), ui(32), ui(32), [mx, my], pFOCUS, pHOVER, view_mode_tooltip, THEME.inspector_view, viewMode) == 2) { if(buttonInstant(THEME.button_hide, ui(8), ui(48), ui(32), ui(32), [mx, my], pHOVER, pFOCUS, view_mode_tooltip, THEME.inspector_view, viewMode) == 2) {
viewMode = !viewMode; viewMode = !viewMode;
PREFERENCES.inspector_view_default = viewMode; PREFERENCES.inspector_view_default = viewMode;
} }
@ -1323,16 +1323,16 @@ function Panel_Inspector() : PanelContent() constructor {
var bx = w - ui(44); var bx = w - ui(44);
var by = ui(12); var by = ui(12);
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_set_default", "Set Metadata as default"), THEME.save, 0, COLORS._main_icon) == 2) if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txtx("panel_inspector_set_default", "Set Metadata as default"), THEME.save, 0, COLORS._main_icon) == 2)
json_save_struct(DIRECTORY + "meta.json", PROJECT.meta.serialize()); json_save_struct(DIRECTORY + "meta.json", PROJECT.meta.serialize());
by += ui(36); by += ui(36);
if(STEAM_ENABLED && !workshop_uploading) { if(STEAM_ENABLED && !workshop_uploading) {
if(PROJECT.path == "") { if(PROJECT.path == "") {
buttonInstant(noone, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_workshop_save", "Save file before upload"), THEME.workshop_upload, 0, COLORS._main_icon, 0.5); buttonInstant(noone, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txtx("panel_inspector_workshop_save", "Save file before upload"), THEME.workshop_upload, 0, COLORS._main_icon, 0.5);
} else { } else {
if(PROJECT.meta.steam == FILE_STEAM_TYPE.local) { //project made locally if(PROJECT.meta.steam == FILE_STEAM_TYPE.local) { //project made locally
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_workshop_upload", "Upload to Steam Workshop"), THEME.workshop_upload, 0, COLORS._main_icon) == 2) { if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txtx("panel_inspector_workshop_upload", "Upload to Steam Workshop"), THEME.workshop_upload, 0, COLORS._main_icon) == 2) {
var s = PANEL_PREVIEW.getNodePreviewSurface(); var s = PANEL_PREVIEW.getNodePreviewSurface();
if(is_surface(s)) { if(is_surface(s)) {
PROJECT.meta.author_steam_id = STEAM_USER_ID; PROJECT.meta.author_steam_id = STEAM_USER_ID;
@ -1349,7 +1349,7 @@ function Panel_Inspector() : PanelContent() constructor {
if(PROJECT.meta.steam && PROJECT.meta.author_steam_id == STEAM_USER_ID) { if(PROJECT.meta.steam && PROJECT.meta.author_steam_id == STEAM_USER_ID) {
if(PROJECT.meta.steam == FILE_STEAM_TYPE.steamUpload) { if(PROJECT.meta.steam == FILE_STEAM_TYPE.steamUpload) {
buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], false, pHOVER, __txtx("panel_inspector_workshop_restart", "Open project from the workshop tab to update."), THEME.workshop_update, 0, COLORS._main_icon); buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], false, pHOVER, __txtx("panel_inspector_workshop_restart", "Open project from the workshop tab to update."), THEME.workshop_update, 0, COLORS._main_icon);
} else if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_workshop_update", "Update Steam Workshop content"), THEME.workshop_update, 0, COLORS._main_icon) == 2) { } else if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pHOVER, pFOCUS, __txtx("panel_inspector_workshop_update", "Update Steam Workshop content"), THEME.workshop_update, 0, COLORS._main_icon) == 2) {
SAVE_AT(PROJECT, PROJECT.path); SAVE_AT(PROJECT, PROJECT.path);
steam_ugc_update_project(); steam_ugc_update_project();
workshop_uploading = true; workshop_uploading = true;

View file

@ -546,7 +546,7 @@ function Panel_Menu() : PanelContent() constructor {
switch(action) { switch(action) {
case "exit": case "exit":
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], true, pHOVER,, THEME.window_exit, 0, COLORS._main_accent); var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pHOVER, true,, THEME.window_exit, 0, COLORS._main_accent);
if(b) _draggable = false; if(b) _draggable = false;
if(b == 2) window_close(); if(b == 2) window_close();
break; break;
@ -556,7 +556,7 @@ function Panel_Menu() : PanelContent() constructor {
if(OS == os_macosx) if(OS == os_macosx)
win_max = __win_is_maximized; win_max = __win_is_maximized;
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], true, pHOVER,, THEME.window_maximize, win_max, [ COLORS._main_icon, CDEF.lime ]); var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pHOVER, true,, THEME.window_maximize, win_max, [ COLORS._main_icon, CDEF.lime ]);
if(b) _draggable = false; if(b) _draggable = false;
if(b == 2) { if(b == 2) {
if(OS == os_windows) { if(OS == os_windows) {
@ -581,7 +581,7 @@ function Panel_Menu() : PanelContent() constructor {
break; break;
case "minimize": case "minimize":
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], true, pHOVER,, THEME.window_minimize, 0, [ COLORS._main_icon, CDEF.yellow ]); var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pHOVER, true,, THEME.window_minimize, 0, [ COLORS._main_icon, CDEF.yellow ]);
if(b) _draggable = false; if(b) _draggable = false;
if(b == -2) { if(b == -2) {
if(OS == os_windows) winMan_Minimize(); if(OS == os_windows) winMan_Minimize();
@ -591,7 +591,7 @@ function Panel_Menu() : PanelContent() constructor {
case "fullscreen": case "fullscreen":
var win_full = window_is_fullscreen; var win_full = window_is_fullscreen;
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], true, pHOVER,, THEME.window_fullscreen, win_full, [ COLORS._main_icon, CDEF.cyan ]); var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pHOVER, true,, THEME.window_fullscreen, win_full, [ COLORS._main_icon, CDEF.cyan ]);
if(b) _draggable = false; if(b) _draggable = false;
if(b == 2) { if(b == 2) {
if(OS == os_windows) if(OS == os_windows)
@ -724,7 +724,7 @@ function Panel_Menu() : PanelContent() constructor {
} }
if(full_name) tw += string_width(".pxc"); if(full_name) tw += string_width(".pxc");
var _b = buttonInstant(THEME.button_hide_fill, tbx0, tby0, tw, th, [mx, my], pFOCUS, pHOVER); var _b = buttonInstant(THEME.button_hide_fill, tbx0, tby0, tw, th, [mx, my], pHOVER, pFOCUS);
var _hov = _b > 0; var _hov = _b > 0;
if(_b) _draggable = false; if(_b) _draggable = false;

View file

@ -11,15 +11,15 @@ function Panel_Node_Align() : PanelContent() constructor {
///////////////////////////// /////////////////////////////
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_halign, 0, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_halign, 0, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_selecting, fa_left); node_halign(PANEL_GRAPH.nodes_selecting, fa_left);
xx += 34 xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_halign, 1, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_halign, 1, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_selecting, fa_center); node_halign(PANEL_GRAPH.nodes_selecting, fa_center);
xx += 34 xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_halign, 2, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_halign, 2, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_selecting, fa_right); node_halign(PANEL_GRAPH.nodes_selecting, fa_right);
xx += 34 xx += 34
@ -30,15 +30,15 @@ function Panel_Node_Align() : PanelContent() constructor {
///////////////////////////// /////////////////////////////
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_valign, 0, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_valign, 0, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_selecting, fa_top); node_valign(PANEL_GRAPH.nodes_selecting, fa_top);
xx += 34 xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_valign, 1, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_valign, 1, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_selecting, fa_middle); node_valign(PANEL_GRAPH.nodes_selecting, fa_middle);
xx += 34 xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_valign, 2, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.object_valign, 2, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_selecting, fa_bottom); node_valign(PANEL_GRAPH.nodes_selecting, fa_bottom);
xx += 34 xx += 34
@ -49,11 +49,11 @@ function Panel_Node_Align() : PanelContent() constructor {
///////////////////////////// /////////////////////////////
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_h, 0, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.obj_distribute_h, 0, c_white) == 2)
node_hdistribute(PANEL_GRAPH.nodes_selecting); node_hdistribute(PANEL_GRAPH.nodes_selecting);
xx += 34 xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_v, 0, c_white) == 2) if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pHOVER, pFOCUS,, THEME.obj_distribute_v, 0, c_white) == 2)
node_vdistribute(PANEL_GRAPH.nodes_selecting); node_vdistribute(PANEL_GRAPH.nodes_selecting);
xx += 34 xx += 34
} }

View file

@ -71,7 +71,7 @@ function Panel_Nodes() : PanelContent() constructor {
var bx = _x1 - ui(4) - bw; var bx = _x1 - ui(4) - bw;
var by = _y + (hg - bh) / 2; var by = _y + (hg - bh) / 2;
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_nodes.active, sc_nodes.hover, __txtx("panel_node_goto", "Go to node"), THEME.node_goto,, COLORS._main_icon, 0.75, 0.75) == 2) if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_nodes.hover, sc_nodes.active, __txtx("panel_node_goto", "Go to node"), THEME.node_goto,, COLORS._main_icon, 0.75, 0.75) == 2)
graphFocusNode(node); graphFocusNode(node);
bx -= ui(32); bx -= ui(32);

View file

@ -185,7 +185,7 @@ function Panel_Palette_Mixer() : PanelContent() constructor {
var _by = pal_y; var _by = pal_y;
var _bs = ui(24); var _bs = ui(24);
var _b = buttonInstant(THEME.button_hide, _bx, _by, _bs, pal_h, [ mx, my ], pFOCUS, pHOVER, "", THEME.hamburger_s); var _b = buttonInstant(THEME.button_hide, _bx, _by, _bs, pal_h, [ mx, my ], pHOVER, pFOCUS, "", THEME.hamburger_s);
if(_b == 2) { if(_b == 2) {
menuCall("", [ menuCall("", [
menuItem("Save palette as...", function() { menuItem("Save palette as...", function() {

View file

@ -90,7 +90,7 @@ function Panel_Patreon() : PanelContent() constructor {
var _bh = TEXTBOX_HEIGHT + ui(8); var _bh = TEXTBOX_HEIGHT + ui(8);
var _bx = w / 2 - _bw / 2; var _bx = w / 2 - _bw / 2;
if(buttonInstant(THEME.button_def, _bx, _y, _bw, _bh, [ mx, my ], pFOCUS, pHOVER) == 2) { if(buttonInstant(THEME.button_def, _bx, _y, _bw, _bh, [ mx, my ], pHOVER, pFOCUS) == 2) {
var path = DIRECTORY + "patreon"; var path = DIRECTORY + "patreon";
file_delete(path); file_delete(path);
IS_PATREON = false; IS_PATREON = false;
@ -119,7 +119,7 @@ function Panel_Patreon() : PanelContent() constructor {
_yy += TEXTBOX_HEIGHT + 12; _yy += TEXTBOX_HEIGHT + 12;
if(!mail_checking) { if(!mail_checking) {
if(buttonInstant(THEME.button_def, _bx, _yy, _bw, _bh, [ mx, my ], pFOCUS, pHOVER) == 2) { if(buttonInstant(THEME.button_def, _bx, _yy, _bw, _bh, [ mx, my ], pHOVER, pFOCUS) == 2) {
patreon_email_check(mail, mailCallback); patreon_email_check(mail, mailCallback);
mail_checking = true; mail_checking = true;
result = ""; result = "";
@ -143,7 +143,7 @@ function Panel_Patreon() : PanelContent() constructor {
tb_code.drawParam(_tb_param); tb_code.drawParam(_tb_param);
_yy += TEXTBOX_HEIGHT + 12; _yy += TEXTBOX_HEIGHT + 12;
if(buttonInstant(THEME.button_def, _bx, _yy, _bw, _bh, [ mx, my ], pFOCUS, pHOVER) == 2) { if(buttonInstant(THEME.button_def, _bx, _yy, _bw, _bh, [ mx, my ], pHOVER, pFOCUS) == 2) {
if(code == global.PATREON_VERIFY_CODE) { if(code == global.PATREON_VERIFY_CODE) {
result = "Patreon verified, thank you for suporting Pixel Composer!"; result = "Patreon verified, thank you for suporting Pixel Composer!";
result_color = COLORS._main_value_positive; result_color = COLORS._main_value_positive;

View file

@ -2121,10 +2121,11 @@ function Panel_Preview() : PanelContent() constructor {
for( var i = 0, n = array_length(settings); i < n; i++ ) { for( var i = 0, n = array_length(settings); i < n; i++ ) {
var sett = settings[i]; var sett = settings[i];
var nme = sett[0]; var nme = sett[0];
var wdg = sett[1]; var wdg = sett[1];
var key = sett[2]; var key = array_safe_get_fast(sett, 2);
var atr = sett[3]; var atr = array_safe_get_fast(sett, 3);
if(nme != "") { if(nme != "") {
tolx += ui(8) + bool(i == 0) * ui(8); tolx += ui(8) + bool(i == 0) * ui(8);
@ -2210,7 +2211,7 @@ function Panel_Preview() : PanelContent() constructor {
if(is_instanceof(tbTooltip, tooltipSelector)) if(is_instanceof(tbTooltip, tooltipSelector))
tbTooltip.index = tbInd; tbTooltip.index = tbInd;
var b = buttonInstant(THEME.button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], pFOCUS, pHOVER, tooltip, tbSpr, tbInd); var b = buttonInstant(THEME.button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], pHOVER, pFOCUS, tooltip, tbSpr, tbInd);
if(b == 2) tbActive(tbData); if(b == 2) tbActive(tbData);
if(tbRight != 0 && b == 3) tbRight(tbData); if(tbRight != 0 && b == 3) tbRight(tbData);
@ -2224,7 +2225,7 @@ function Panel_Preview() : PanelContent() constructor {
var tbTooltip = tb[1]; var tbTooltip = tb[1];
var tbIndex = tb[3](); var tbIndex = tb[3]();
var b = buttonInstant(THEME.button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], pFOCUS, pHOVER, tbTooltip, tbSpr, tbIndex); var b = buttonInstant(THEME.button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], pHOVER, pFOCUS, tbTooltip, tbSpr, tbIndex);
if(b == 2) tb[2]( { x: x + tbx - ui(14), y: y + tby - ui(14) } ); if(b == 2) tb[2]( { x: x + tbx - ui(14), y: y + tby - ui(14) } );
tbx -= ui(32); tbx -= ui(32);

View file

@ -596,7 +596,7 @@ function Panel_Profile_Render() : PanelContent() constructor {
var _bx = _pd; var _bx = _pd;
var _by = _pd; var _by = _pd;
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, "Render all", s_run, 1, COLORS._main_value_positive, 1, 1) == 2) { if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pHOVER, pFOCUS, "Render all", s_run, 1, COLORS._main_value_positive, 1, 1) == 2) {
PROFILER_STAT = 1; PROFILER_STAT = 1;
PROFILER_DATA = []; PROFILER_DATA = [];
setReport(noone); setReport(noone);
@ -611,7 +611,7 @@ function Panel_Profile_Render() : PanelContent() constructor {
} }
_bx += _bs + ui(2); _bx += _bs + ui(2);
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, "Render partial", s_run_partial, 1, COLORS._main_value_positive, 1, 1) == 2) { if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pHOVER, pFOCUS, "Render partial", s_run_partial, 1, COLORS._main_value_positive, 1, 1) == 2) {
PROFILER_STAT = 1; PROFILER_STAT = 1;
PROFILER_DATA = []; PROFILER_DATA = [];
setReport(noone); setReport(noone);
@ -637,19 +637,19 @@ function Panel_Profile_Render() : PanelContent() constructor {
var _bx = _pd + list_w - _bs; var _bx = _pd + list_w - _bs;
var _by = _pd; var _by = _pd;
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, $"Log level {show_log_level}", s_filter_log_level, show_log_level, COLORS._main_icon, 1, 1) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pHOVER, pFOCUS, $"Log level {show_log_level}", s_filter_log_level, show_log_level, COLORS._main_icon, 1, 1) == 2)
show_log_level = (show_log_level + 1) % 5; show_log_level = (show_log_level + 1) % 5;
_bx -= _bs + ui(4); _bx -= _bs + ui(4);
if(report_selecting == noone) if(report_selecting == noone)
draw_sprite_ext(s_filter_node, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon, 0.25); draw_sprite_ext(s_filter_node, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon, 0.25);
else if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, "Filter node", s_filter_node, 0, filter_node == noone? COLORS._main_icon : COLORS._main_accent, 1, 1) == 2) { else if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pHOVER, pFOCUS, "Filter node", s_filter_node, 0, filter_node == noone? COLORS._main_icon : COLORS._main_accent, 1, 1) == 2) {
filter_node = filter_node == report_selecting.node? noone : report_selecting.node; filter_node = filter_node == report_selecting.node? noone : report_selecting.node;
searchData(); searchData();
} }
_bx -= _bs + ui(4); _bx -= _bs + ui(4);
if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, "Match selecting", s_filter_node_inspector, 0, set_selecting_node? COLORS._main_accent : COLORS._main_icon, 1, 1) == 2) if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pHOVER, pFOCUS, "Match selecting", s_filter_node_inspector, 0, set_selecting_node? COLORS._main_accent : COLORS._main_icon, 1, 1) == 2)
set_selecting_node = !set_selecting_node; set_selecting_node = !set_selecting_node;
_bx -= ui(4); _bx -= ui(4);

View file

@ -389,7 +389,7 @@ function Panel_Test() : PanelContent() constructor {
doTesting(); doTesting();
} else { } else {
if(buttonInstant(THEME.button_def, bx, by, bw, bh, [ mx, my ], pFOCUS, pHOVER) == 2) if(buttonInstant(THEME.button_def, bx, by, bw, bh, [ mx, my ], pHOVER, pFOCUS) == 2)
startTesting(); startTesting();
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text); draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text);

View file

@ -27,27 +27,27 @@ function Panel_Text_Editor(_textArea, _inputFunc, _context) : PanelContent() con
var bs = ui(32); var bs = ui(32);
var txt = shift_new_line? "New line with Shift + Enter" : "New line with Enter"; var txt = shift_new_line? "New line with Shift + Enter" : "New line with Enter";
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, txt, THEME.new_line_shift, shift_new_line) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, txt, THEME.new_line_shift, shift_new_line) == 2)
shift_new_line = !shift_new_line; shift_new_line = !shift_new_line;
bx += bs + ui(4); bx += bs + ui(4);
var txt = _textArea.show_line_number? "Hide line number" : "Show line number"; var txt = _textArea.show_line_number? "Hide line number" : "Show line number";
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, txt, THEME.code_show_line, _textArea.show_line_number) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, txt, THEME.code_show_line, _textArea.show_line_number) == 2)
_textArea.show_line_number = !_textArea.show_line_number; _textArea.show_line_number = !_textArea.show_line_number;
bx += bs + ui(4); bx += bs + ui(4);
var txt = _textArea.use_autocomplete? "Disable Autocomplete" : "Enable Autocomplete"; var txt = _textArea.use_autocomplete? "Disable Autocomplete" : "Enable Autocomplete";
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, txt, THEME.code_show_auto, _textArea.use_autocomplete) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, txt, THEME.code_show_auto, _textArea.use_autocomplete) == 2)
_textArea.use_autocomplete = !_textArea.use_autocomplete; _textArea.use_autocomplete = !_textArea.use_autocomplete;
bx += bs + ui(4); bx += bs + ui(4);
var txt = "Syntax Highlight"; var txt = "Syntax Highlight";
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, txt, THEME.code_syntax_highlight, _textArea.syntax_highlight) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, txt, THEME.code_syntax_highlight, _textArea.syntax_highlight) == 2)
_textArea.syntax_highlight = !_textArea.syntax_highlight; _textArea.syntax_highlight = !_textArea.syntax_highlight;
bx += bs + ui(4); bx += bs + ui(4);
var bx = w - ui(8) - bs; var bx = w - ui(8) - bs;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pFOCUS, pHOVER, "Apply", THEME.accept,, COLORS._main_value_positive) == 2) if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [ mx, my ], pHOVER, pFOCUS, "Apply", THEME.accept,, COLORS._main_value_positive) == 2)
_textArea.apply(); _textArea.apply();
bx -= bs + ui(4); bx -= bs + ui(4);

View file

@ -84,11 +84,11 @@ function Panel_Tunnels() : PanelContent() constructor {
var bx = ww - ui(4) - bw; var bx = ww - ui(4) - bw;
var by = _y + (hg - bh) / 2; var by = _y + (hg - bh) / 2;
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, __txtx("panel_node_goto", "Go to node"), THEME.node_goto) == 2) if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.hover, sc_tunnel.active, __txtx("panel_node_goto", "Go to node"), THEME.node_goto) == 2)
graphFocusNode(node); graphFocusNode(node);
bx -= ui(32); bx -= ui(32);
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, __txtx("panel_tunnel_create_tunnel", "Create tunnel out"), THEME.tunnel) == 2) { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.hover, sc_tunnel.active, __txtx("panel_tunnel_create_tunnel", "Create tunnel out"), THEME.tunnel) == 2) {
var _node = nodeBuild("Node_Tunnel_Out", build_x, build_y - 8); var _node = nodeBuild("Node_Tunnel_Out", build_x, build_y - 8);
_node.inputs[0].setValue(key); _node.inputs[0].setValue(key);

View file

@ -76,7 +76,7 @@ function pathAnchorBox(_onModify) : widget() constructor {
var bx = _x + _w / 2 - _bw / 2 - 2; var bx = _x + _w / 2 - _bw / 2 - 2;
var by = _ty + _th / 2 - _bw / 2; var by = _ty + _th / 2 - _bw / 2;
if(buttonInstant(THEME.button_hide, bx, by, _bw, _bw, _m, active, hover, "Linked", THEME.value_link, !_linked, _blend) == 2) if(buttonInstant(THEME.button_hide, bx, by, _bw, _bw, _m, hover, active, "Linked", THEME.value_link, !_linked, _blend) == 2)
onModify(!_linked, 6); onModify(!_linked, 6);
resetFocus(); resetFocus();

View file

@ -101,7 +101,7 @@ function quarternionBox(_onModify) : widget() constructor {
var by = _y + _h / 2 - _bs / 2; var by = _y + _h / 2 - _bs / 2;
tooltip.index = _disp; tooltip.index = _disp;
if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, iactive, ihover, tooltip, THEME.unit_angle, _disp, c_white) == 2) { if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, ihover, iactive, tooltip, THEME.unit_angle, _disp, c_white) == 2) {
clickable = false; clickable = false;
attributes.angle_display = (_disp + 1) % 2; attributes.angle_display = (_disp + 1) % 2;
onModify([ 0, 0, 0, 1 ]); onModify([ 0, 0, 0, 1 ]);

View file

@ -82,7 +82,7 @@ function rangeBox(_type, _onModify) : widget() constructor {
var bx = _x; var bx = _x;
var by = _y + _h / 2 - _bs / 2; var by = _y + _h / 2 - _bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, hover, active, tooltip, THEME.value_link, linked, _icon_blend) == 2) {
linked = !linked; linked = !linked;
_display_data.linked = linked; _display_data.linked = linked;

View file

@ -85,7 +85,7 @@ function rotatorRandom(_onModify) : widget() constructor {
if(_drawRot) { if(_drawRot) {
if((_w - _r) / 2 > ui(48)) { if((_w - _r) / 2 > ui(48)) {
tooltip.index = mode; tooltip.index = mode;
if(buttonInstant(noone, _x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, active, hover, tooltip, THEME.rotator_random_mode, mode, [ COLORS._main_icon, c_white ]) == 2) { #region if(buttonInstant(noone, _x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, hover, active, tooltip, THEME.rotator_random_mode, mode, [ COLORS._main_icon, c_white ]) == 2) { #region
mode = (mode + 1) % 4; mode = (mode + 1) % 4;
onModify(mode, 0); onModify(mode, 0);

View file

@ -64,6 +64,8 @@ function string_to_var(str) { INLINE return string_replace_all(string
function string_to_var2(context, name) { INLINE return string_to_var(context == ""? name : $"{context} {name}"); } function string_to_var2(context, name) { INLINE return string_to_var(context == ""? name : $"{context} {name}"); }
function string_quote(str) { INLINE return $"\"{str}\""; } function string_quote(str) { INLINE return $"\"{str}\""; }
function string_multiply(str, amo) { var s = ""; repeat(amo) s += str; return s; }
function string_compare(s1, s2) { function string_compare(s1, s2) {
s1 = string_lower(s1); s1 = string_lower(s1);
s2 = string_lower(s2); s2 = string_lower(s2);

View file

@ -101,6 +101,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
return self; return self;
} }
static setHide = function(hide) { self.hide = hide; return self; }
static setFont = function(font) { self.font = font; return self; } static setFont = function(font) { self.font = font; return self; }
static setLabel = function(label) { self.label = label; return self; } static setLabel = function(label) { self.label = label; return self; }
static setPrecision = function(precision) { self.precision = precision; return self; } static setPrecision = function(precision) { self.precision = precision; return self; }

View file

@ -86,7 +86,7 @@ function timelineItemNode(node) : timelineItem() constructor {
var tt = __txtx("panel_animation_goto", "Go to node"); var tt = __txtx("panel_animation_goto", "Go to node");
var _m = [ _msx, _msy ]; var _m = [ _msx, _msy ];
if(buttonInstant(noone, tx - ui(9), _y + ui(1), ui(18), ui(18), _m, focus, hover, tt, THEME.animate_node_go, 0, col == -1? COLORS._main_icon_light : col, 0.4) == 2) if(buttonInstant(noone, tx - ui(9), _y + ui(1), ui(18), ui(18), _m, hover, focus, tt, THEME.animate_node_go, 0, col == -1? COLORS._main_icon_light : col, 0.4) == 2)
graphFocusNode(node); graphFocusNode(node);
if(_sel) draw_sprite_stretched_ext(THEME.s_box_r2, 1, _x, _y, _w, lh, COLORS._main_accent, 1); if(_sel) draw_sprite_stretched_ext(THEME.s_box_r2, 1, _x, _y, _w, lh, COLORS._main_accent, 1);

View file

@ -132,7 +132,7 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor {
var bx = _x; var bx = _x;
var by = _y + _h / 2 - _bs / 2; var by = _y + _h / 2 - _bs / 2;
if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, hover, active, tooltip, THEME.value_link, linked, _icon_blend) == 2) {
linked = !linked; linked = !linked;
_display_data.linked = linked; _display_data.linked = linked;

View file

@ -94,7 +94,7 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const
var by = _y + _h / 2 - _bs / 2; var by = _y + _h / 2 - _bs / 2;
var bc = linked? COLORS._main_accent : COLORS._main_icon; var bc = linked? COLORS._main_accent : COLORS._main_icon;
if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, active, hover, __txt("Link axis"), THEME.value_link, linked, bc) == 2) { if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, hover, active, __txt("Link axis"), THEME.value_link, linked, bc) == 2) {
linked = !linked; linked = !linked;
_display_data.linked = linked; _display_data.linked = linked;
@ -107,7 +107,7 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const
by += _h + ui(4); by += _h + ui(4);
tooltip_ranged.index = ranged; tooltip_ranged.index = ranged;
if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, active, hover, tooltip_ranged, THEME.value_range, ranged, COLORS._main_icon) == 2) { if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, hover, active, tooltip_ranged, THEME.value_range, ranged, COLORS._main_icon) == 2) {
ranged = !ranged; ranged = !ranged;
_display_data.ranged = ranged; _display_data.ranged = ranged;

View file

@ -150,6 +150,7 @@ function widgetParam(x, y, w, h, data, display_data = {}, m = mouse_ui, rx = 0,
interact = undefined; interact = undefined;
scrollpane = undefined; scrollpane = undefined;
static setColor = function(c) { color = c; return self; }
static setFont = function(f) { font = f; return self; } static setFont = function(f) { font = f; return self; }
static setScrollpane = function(s) { scrollpane = s; return self; } static setScrollpane = function(s) { scrollpane = s; return self; }