switch menucall order

This commit is contained in:
Tanasart 2024-08-10 16:04:14 +07:00
parent 3293c09343
commit f15b0d9e65
31 changed files with 129 additions and 117 deletions

View file

@ -81,7 +81,7 @@ event_inherited();
menuItem(fav? __txtx("add_node_remove_favourite", "Remove from favourite") : __txtx("add_node_add_favourite", "Add to favourite"), trigger_favourite, THEME.star) menuItem(fav? __txtx("add_node_remove_favourite", "Remove from favourite") : __txtx("add_node_add_favourite", "Add to favourite"), trigger_favourite, THEME.star)
]; ];
menuCall("add_node_window_manu",,, menu,, node_menu_selecting); menuCall("add_node_window_manu", menu, 0, 0, fa_left, node_menu_selecting);
} }
function filtered(node) { function filtered(node) {

View file

@ -100,14 +100,9 @@ event_inherited();
if(isHover && i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) { if(isHover && i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
hovering = pal; hovering = pal;
menuCall("palette_window_preset_menu",,, [ menuCall("palette_window_preset_menu", [
menuItem(__txtx("palette_editor_set_default", "Set as default"), function() { menuItem(__txtx("palette_editor_set_default", "Set as default"), function() { PROJECT.setPalette(array_clone(hovering.palette)); }),
PROJECT.setPalette(array_clone(hovering.palette)); menuItem(__txtx("palette_editor_delete", "Delete palette"), function() { file_delete(hovering.path); __initPalette(); }),
}),
menuItem(__txtx("palette_editor_delete", "Delete palette"), function() {
file_delete(hovering.path);
__initPalette();
}),
]); ]);
} }

View file

@ -74,14 +74,32 @@ event_inherited();
for(var i = 0; i < array_length(data); i++) { for(var i = 0; i < array_length(data); i++) {
var _menu = data[i]; var _menu = data[i];
var _menuItem = _menu.menu;
var _menuItem = _menu.menu;
var _key = _menu.hotkey;
if(selecting == i) { if(selecting == i) {
draw_sprite_stretched_ext(THEME.textbox, 3, 0, _ly, dialog_w, hght, COLORS.dialog_menubox_highlight, 1); draw_sprite_stretched_ext(THEME.textbox, 3, 0, _ly, dialog_w, hght, COLORS.dialog_menubox_highlight, 1);
if(sc_content.active && (mouse_press(mb_left) || keyboard_check_pressed(vk_enter))) { if(sc_content.active) {
_menu.action(); if(mouse_press(mb_left) || keyboard_check_pressed(vk_enter)) {
instance_destroy(); _menu.action();
instance_destroy();
}
if(mouse_press(mb_right)) {
selecting_menu = _menuItem;
var _loadKey = string_to_var($"{_key.context}.{_key.name}");
var context_menu_settings = [
_loadKey,
menuItem("Edit hotkey", function() /*=>*/ {
hk_editing = _key;
keyboard_lastchar = _key.key;
}),
];
item_selecting = menuCall("", context_menu_settings);
}
} }
} }
@ -100,12 +118,12 @@ event_inherited();
draw_text_add(_tx, _ty, _cnxt); draw_text_add(_tx, _ty, _cnxt);
_tx += string_width(_cnxt); _tx += string_width(_cnxt);
draw_sprite_ext(THEME.arrow, 0, _tx + ui(10), _ty, 1, 1, 0, COLORS._main_text_sub); draw_sprite_ext(THEME.arrow, 0, _tx + ui(8), _ty, 1, 1, 0, COLORS._main_text_sub);
_tx += ui(20); _tx += ui(16);
} }
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_icon_light); draw_set_text(f_p2, fa_left, fa_center, COLORS._main_icon_light);
draw_text_add(_tx, _ty, _name); draw_text_match_ext(_tx, _ty, _name, _dw, search_string);
if(_menuItem != noone && _menuItem.spr != noone) { if(_menuItem != noone && _menuItem.spr != noone) {
var spr = is_array(_menuItem.spr)? _menuItem.spr[0] : _menuItem.spr; var spr = is_array(_menuItem.spr)? _menuItem.spr[0] : _menuItem.spr;
@ -113,8 +131,7 @@ event_inherited();
draw_sprite_ui(spr, ind, ui(16), _ty, .75, .75, 0, COLORS._main_icon, 0.75); draw_sprite_ui(spr, ind, ui(16), _ty, .75, .75, 0, COLORS._main_icon, 0.75);
} }
if(_menu.hotkey != noone) { if(_key != noone) {
var _key = _menu.hotkey;
var _hx = _dw - ui(6); var _hx = _dw - ui(6);
var _hy = _ty + ui(1); var _hy = _ty + ui(1);
@ -138,7 +155,7 @@ event_inherited();
draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, CDEF.main_dkgrey); draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, CDEF.main_dkgrey);
} }
draw_text(_hx, _hy, _ktxt); draw_text_add(_hx, _hy, _ktxt);
} }
_ly += hght; _ly += hght;
@ -146,16 +163,27 @@ event_inherited();
} }
if(sc_content.active) { if(sc_content.active) {
if(keyboard_check_pressed(vk_up)) { if(hk_editing != noone) {
selecting--; if(keyboard_check_pressed(vk_enter))
if(selecting < 0) selecting = array_length(data) - 1; hk_editing = noone;
} else
hotkey_editing(hk_editing);
if(keyboard_check_pressed(vk_down))
selecting = safe_mod(selecting + 1, array_length(data)); if(keyboard_check_pressed(vk_escape))
hk_editing = noone;
} else {
if(keyboard_check_pressed(vk_up)) {
selecting--;
if(selecting < 0) selecting = array_length(data) - 1;
}
if(keyboard_check_pressed(vk_escape)) if(keyboard_check_pressed(vk_down))
instance_destroy(); selecting = safe_mod(selecting + 1, array_length(data));
if(keyboard_check_pressed(vk_escape))
instance_destroy();
}
} }
_prex = mouse_mx; _prex = mouse_mx;

View file

@ -2,7 +2,8 @@
draw_sprite_stretched(THEME.textbox, 3, dialog_x, dialog_y, dialog_w, dialog_h); draw_sprite_stretched(THEME.textbox, 3, dialog_x, dialog_y, dialog_w, dialog_h);
WIDGET_CURRENT = tb_search; if(hk_editing == noone)
WIDGET_CURRENT = tb_search;
tb_search.setFocusHover(true, true); tb_search.setFocusHover(true, true);
tb_search.draw(dialog_x, dialog_y, dialog_w, ui(32), search_string); tb_search.draw(dialog_x, dialog_y, dialog_w, ui(32), search_string);
tb_search.sprite_index = 0; tb_search.sprite_index = 0;

View file

@ -137,11 +137,8 @@ event_inherited();
if(mouse_press(mb_right, interactable && sFOCUS)) { if(mouse_press(mb_right, interactable && sFOCUS)) {
hovering_name = _gradient.path; hovering_name = _gradient.path;
menuCall("gradient_window_preset_menu",,, [ menuCall("gradient_window_preset_menu", [
menuItem(__txtx("gradient_editor_delete", "Delete gradient"), function() { menuItem(__txtx("gradient_editor_delete", "Delete gradient"), function() { file_delete(hovering_name); __initGradient(); })
file_delete(hovering_name);
__initGradient();
})
]); ]);
} }
} }
@ -226,7 +223,7 @@ event_inherited();
if(isHover && mouse_press(mb_right, interactable && sFOCUS)) { if(isHover && mouse_press(mb_right, interactable && sFOCUS)) {
hovering = pal; hovering = pal;
menuCall("palette_window_preset_menu",,, [ menuCall("palette_window_preset_menu", [
menuItem(__txtx("gradient_set_palette", "Convert to Gradient"), function() { menuItem(__txtx("gradient_set_palette", "Convert to Gradient"), function() {
var _p = hovering.palette; var _p = hovering.palette;
if(array_length(_p) < 2) return; if(array_length(_p) < 2) return;

View file

@ -99,13 +99,13 @@ if !ready exit;
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, interactable && sFOCUS, sHOVER, __txtx("gradient_editor_key_blend", "Key blending"), THEME.grad_blend) == 2) {
menuCall("gradient_window_blend_menu", bx + ui(32), by, [ 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); }),
menuItem(__txtx("gradient_editor_blend_sRGB", "sRGB"), function() { gradient.type = 4; onApply(gradient); }), menuItem(__txtx("gradient_editor_blend_sRGB", "sRGB"), function() { gradient.type = 4; onApply(gradient); }),
menuItem(__txtx("gradient_editor_blend_HSV", "HSV"), function() { gradient.type = 2; onApply(gradient); }), menuItem(__txtx("gradient_editor_blend_HSV", "HSV"), function() { gradient.type = 2; onApply(gradient); }),
menuItem(__txtx("gradient_editor_blend_OKLAB", "OKLAB"), function() { gradient.type = 3; onApply(gradient); }), menuItem(__txtx("gradient_editor_blend_OKLAB", "OKLAB"), function() { gradient.type = 3; onApply(gradient); }),
],, gradient); ], bx + ui(32), by, fa_left, gradient);
} }
bx -= ui(32); bx -= ui(32);

View file

@ -111,7 +111,7 @@ event_inherited();
} }
if(menu > -1) { if(menu > -1) {
menuCall("image_array_edit_menu",,, [ menuCall("image_array_edit_menu", [
menuItem(__txt("Remove"), function() { menuItem(__txt("Remove"), function() {
var arr = target.getValue(); var arr = target.getValue();
array_delete(arr, menuOn, 1); array_delete(arr, menuOn, 1);
@ -119,7 +119,7 @@ event_inherited();
target.setValue(arr); target.setValue(arr);
target.node.triggerRender(); target.node.triggerRender();
}) })
],, target ); ]);
} }
return _h; return _h;

View file

@ -88,7 +88,6 @@ if(!ready) exit;
selecting_menu = _menuItem; selecting_menu = _menuItem;
var _loadKey = string_to_var($"{_key.context}.{_key.name}"); var _loadKey = string_to_var($"{_key.context}.{_key.name}");
var context_menu_settings = [ var context_menu_settings = [
_loadKey, _loadKey,
menuItem("Edit hotkey", function() /*=>*/ { menuItem("Edit hotkey", function() /*=>*/ {

View file

@ -121,14 +121,9 @@ event_inherited();
if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) { if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
hovering = pal; hovering = pal;
menuCall("palette_window_preset_menu",,, [ menuCall("palette_window_preset_menu", [
menuItem(__txtx("palette_editor_set_default", "Set as default"), function() { menuItem(__txtx("palette_editor_set_default", "Set as default"), function() { PROJECT.setPalette(array_clone(hovering.palette)); }),
PROJECT.setPalette(array_clone(hovering.palette)); menuItem(__txtx("palette_editor_delete", "Delete palette"), function() { file_delete(hovering.path); __initPalette(); }),
}),
menuItem(__txtx("palette_editor_delete", "Delete palette"), function() {
file_delete(hovering.path);
__initPalette();
}),
]); ]);
} }
} }

View file

@ -86,14 +86,14 @@ if palette == 0 exit;
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, interactable && sFOCUS, sHOVER, _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", bx + ui(32), by, [ menuCall("palette_window_sort_menu", [
menuItem(__txtx("palette_editor_sort_brighter", "Brighter"), function() { sortPalette(__sortBright); }), menuItem(__txtx("palette_editor_sort_brighter", "Brighter"), function() { sortPalette(__sortBright); }),
menuItem(__txtx("palette_editor_sort_darker", "Darker"), function() { sortPalette(__sortDark); }), menuItem(__txtx("palette_editor_sort_darker", "Darker"), function() { sortPalette(__sortDark); }),
-1, -1,
menuItem(__txtx("palette_editor_sort_hue", "Hue"), function() { sortPalette(__sortHue); }), menuItem(__txtx("palette_editor_sort_hue", "Hue"), function() { sortPalette(__sortHue); }),
menuItem(__txtx("palette_editor_sort_sat", "Saturation"), function() { sortPalette(__sortSat); }), menuItem(__txtx("palette_editor_sort_sat", "Saturation"), function() { sortPalette(__sortSat); }),
menuItem(__txtx("palette_editor_sort_val", "Value"), function() { sortPalette(__sortVal); }), menuItem(__txtx("palette_editor_sort_val", "Value"), function() { sortPalette(__sortVal); }),
],, palette); ], bx + ui(32), by, fa_left, palette);
} }
bx -= ui(32); bx -= ui(32);

View file

@ -99,8 +99,8 @@ if !ready exit;
instance_destroy(); instance_destroy();
} else if(mouse_press(mb_right)) { } else if(mouse_press(mb_right)) {
menuCall("panel_window_menu",,, [ menuCall("panel_window_menu", [
menuItemAction(__txt("Move"), function() { menuItemAction(__txt("Move"), function() {
content.dragSurface = surface_clone(panel); content.dragSurface = surface_clone(panel);
o_main.panel_dragging = content; o_main.panel_dragging = content;
content.in_dialog = false; content.in_dialog = false;
@ -108,7 +108,7 @@ if !ready exit;
instance_destroy(); instance_destroy();
}), }),
],, content); ]);
} }
} }

View file

@ -55,7 +55,7 @@ event_inherited();
if(mouse_click(mb_right, sFOCUS)) { if(mouse_click(mb_right, sFOCUS)) {
selecting_path = preset.path; selecting_path = preset.path;
var dia = menuCall("preset_window_menu",,, [ menuItem(__txt("Delete"), function() { file_delete(selecting_path); __initPresets(); }), ]); var dia = menuCall("preset_window_menu", [ menuItem(__txt("Delete"), function() { file_delete(selecting_path); __initPresets(); }), ]);
} }
} }

View file

@ -3,7 +3,10 @@
CONTEXT_MENU_CALLBACK = ds_map_create(); CONTEXT_MENU_CALLBACK = ds_map_create();
#endregion #endregion
function menuCall(menu_id = "", _x = mouse_mx + ui(4), _y = mouse_my + ui(4), menu = [], align = fa_left, context = noone) { function menuCall(menu_id = "", menu = [], _x = 0, _y = 0, align = fa_left, context = noone) {
_x = _x == 0? mouse_mx + ui(4) : _x;
_y = _y == 0? mouse_my + ui(4) : _y;
var dia = dialogCall(o_dialog_menubox, _x, _y); var dia = dialogCall(o_dialog_menubox, _x, _y);
if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) { if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) {
var callbacks = CONTEXT_MENU_CALLBACK[? menu_id]; var callbacks = CONTEXT_MENU_CALLBACK[? menu_id];
@ -34,7 +37,7 @@ function pieMenuCall(menu_id = "", _x = mouse_mx, _y = mouse_my, menu = [], cont
} }
function submenuCall(_data = undefined, menu = []) { function submenuCall(_data = undefined, menu = []) {
if(is_undefined(_data)) return menuCall("",,, menu); if(is_undefined(_data)) return menuCall("", menu);
var dia = instance_create_depth(_data.x - ui(4), _data.y, _data.depth - 1, o_dialog_menubox); var dia = instance_create_depth(_data.x - ui(4), _data.y, _data.depth - 1, o_dialog_menubox);
dia.context = _data.context; dia.context = _data.context;

View file

@ -474,7 +474,7 @@ function curveBox(_onModify) : widget() constructor {
} }
if(node_hovering == -1 && mouse_press(mb_right, active)) { if(node_hovering == -1 && mouse_press(mb_right, active)) {
menuCall("widget_curve", rx + _m[0], ry + _m[1], [ menuCall("widget_curve", [
menuItemGroup(__txt("Presets"), [ menuItemGroup(__txt("Presets"), [
[ [THEME.curve_presets, 0], function() { onModify(CURVE_DEF_00); } ], [ [THEME.curve_presets, 0], function() { onModify(CURVE_DEF_00); } ],
[ [THEME.curve_presets, 1], function() { onModify(CURVE_DEF_11); } ], [ [THEME.curve_presets, 1], function() { onModify(CURVE_DEF_11); } ],
@ -482,19 +482,19 @@ function curveBox(_onModify) : widget() constructor {
[ [THEME.curve_presets, 3], function() { onModify(CURVE_DEF_10); } ], [ [THEME.curve_presets, 3], function() { onModify(CURVE_DEF_10); } ],
]), ]),
-1, -1,
menuItemAction(__txt("Reset View"), function() { menuItem(__txt("Reset View"), function() {
minx = 0; maxx = 1; minx = 0; maxx = 1;
miny = 0; maxy = 1; miny = 0; maxy = 1;
}), }),
menuItemAction(grid_show? __txt("Hide grid") : __txt("Show grid"), function() { grid_show = !grid_show; }), menuItem(grid_show? __txt("Hide grid") : __txt("Show grid"), function() { grid_show = !grid_show; }),
menuItemAction(__txt("Snap to grid"), function() { grid_snap = !grid_snap; },,, function() { return grid_snap } ), menuItem(__txt("Snap to grid"), function() { grid_snap = !grid_snap; },,, function() { return grid_snap } ),
menuItemGroup(__txt("Grid size"), [ menuItemGroup(__txt("Grid size"), [
[ "1%", function() { grid_step = 0.01; } ], [ "1%", function() { grid_step = 0.01; } ],
[ "5%", function() { grid_step = 0.05; } ], [ "5%", function() { grid_step = 0.05; } ],
[ "10%", function() { grid_step = 0.10; } ], [ "10%", function() { grid_step = 0.10; } ],
[ "25%", function() { grid_step = 0.25; } ], [ "25%", function() { grid_step = 0.25; } ],
]), ]),
]); ], rx + _m[0], ry + _m[1]);
} }
} #endregion } #endregion

View file

@ -68,7 +68,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
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, _focus, _hover,, THEME.sort_16) == 2)
menuCall("", mouse_mx + ui(4), mouse_my + ui(4), sort_menu); menuCall("", sort_menu);
var _from = getInputData(1); var _from = getInputData(1);
var _to = getInputData(2); var _to = getInputData(2);

View file

@ -260,9 +260,9 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
wd_maxy = wd_cy + ry; wd_maxy = wd_cy + ry;
} }
if(mouse_press(mb_right, _focus)) { if(mouse_press(mb_right, _focus))
menuCall("node_vec2_coordinate",,, coordinate_menu); menuCall("node_vec2_coordinate", coordinate_menu);
}
} #endregion } #endregion
draw_set_text(f_sdf, fa_center, fa_bottom, COLORS._main_text); draw_set_text(f_sdf, fa_center, fa_bottom, COLORS._main_text);

View file

@ -829,7 +829,7 @@ function Panel_Animation() : PanelContent() constructor {
if(mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_right, pFOCUS)) {
__selecting_frame = clamp(round((mx - bar_x - timeline_shift) / timeline_scale), 0, TOTAL_FRAMES - 1); __selecting_frame = clamp(round((mx - bar_x - timeline_shift) / timeline_scale), 0, TOTAL_FRAMES - 1);
menuCall("animation_summary_menu",,, [ menuCall("animation_summary_menu", [
MENU_ITEMS.animation_set_range_start, MENU_ITEMS.animation_set_range_start,
MENU_ITEMS.animation_set_range_end, MENU_ITEMS.animation_set_range_end,
MENU_ITEMS.animation_reset_range, MENU_ITEMS.animation_reset_range,
@ -2416,26 +2416,26 @@ function Panel_Animation() : PanelContent() constructor {
if(keyframe_boxable && mouse_press(mb_right, pFOCUS)) { #region context menu if(keyframe_boxable && mouse_press(mb_right, pFOCUS)) { #region context menu
if(point_in_rectangle(mx, my, bar_x, ui(8), bar_x + dope_sheet_w, ui(8) + dope_sheet_h)) { if(point_in_rectangle(mx, my, bar_x, ui(8), bar_x + dope_sheet_w, ui(8) + dope_sheet_h)) {
if(array_empty(keyframe_selecting)) menuCall("animation_keyframe_empty_menu",,, keyframe_menu_empty); if(array_empty(keyframe_selecting)) menuCall("animation_keyframe_empty_menu", keyframe_menu_empty);
else menuCall("animation_keyframe_menu",,, keyframe_menu,, keyframe_selecting); else menuCall("animation_keyframe_menu", keyframe_menu);
} else if(point_in_rectangle(mx, my, ui(8), ui(8), ui(8) + tool_width, ui(8) + dope_sheet_h)) { } else if(point_in_rectangle(mx, my, ui(8), ui(8), ui(8) + tool_width, ui(8) + dope_sheet_h)) {
if(context_selecting_prop != noone) { if(context_selecting_prop != noone) {
if(context_selecting_prop.sepable) if(context_selecting_prop.sepable)
menuCall("animation_name_empty_menu",,, context_selecting_prop.sep_axis? name_menu_prop_join : name_menu_prop_sep); menuCall("animation_name_empty_menu", context_selecting_prop.sep_axis? name_menu_prop_join : name_menu_prop_sep);
else else
menuCall("animation_name_empty_menu",,, name_menu_empty); menuCall("animation_name_empty_menu", name_menu_empty);
} }
else if(context_selecting_item == noone) else if(context_selecting_item == noone)
menuCall("animation_name_empty_menu",,, name_menu_empty); menuCall("animation_name_empty_menu", name_menu_empty);
else if(is_instanceof(context_selecting_item.item, timelineItemNode)) else if(is_instanceof(context_selecting_item.item, timelineItemNode))
menuCall("animation_name_empty_menu",,, name_menu_item); menuCall("animation_name_empty_menu", name_menu_item);
else if(is_instanceof(context_selecting_item.item, timelineItemGroup)) else if(is_instanceof(context_selecting_item.item, timelineItemGroup))
menuCall("animation_name_empty_menu",,, name_menu_group); menuCall("animation_name_empty_menu", name_menu_group);
} }
} #endregion } #endregion

View file

@ -291,7 +291,7 @@ function Panel_Collection() : PanelContent() constructor {
if(!DEMO && mouse_press(mb_right, pFOCUS)) { if(!DEMO && mouse_press(mb_right, pFOCUS)) {
_menu_node = _node; _menu_node = _node;
initMenu(); initMenu();
menuCall("collection_menu",,, contentMenu,, _menu_node); menuCall("collection_menu", contentMenu);
} }
if(!instance_exists(o_dialog_menubox) && meta != noone && meta != undefined) if(!instance_exists(o_dialog_menubox) && meta != noone && meta != undefined)
@ -376,7 +376,7 @@ function Panel_Collection() : PanelContent() constructor {
if(!DEMO && mouse_press(mb_right, pFOCUS)) { if(!DEMO && mouse_press(mb_right, pFOCUS)) {
_menu_node = _node; _menu_node = _node;
initMenu(); initMenu();
menuCall("collection_menu",,, contentMenu,, _menu_node); menuCall("collection_menu", contentMenu);
} }
} }

View file

@ -326,7 +326,7 @@ function Panel_Color() : PanelContent() constructor {
} }
if(mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_right, pFOCUS)) {
menuCall("color_window_menu",,, [ menuCall("color_window_menu", [
menuItem(__txt("Hue"), function() { mode = 0; } ), menuItem(__txt("Hue"), function() { mode = 0; } ),
menuItem(__txt("Value"), function() { mode = 1; } ), menuItem(__txt("Value"), function() { mode = 1; } ),
menuItem(__txt("Saturation"), function() { mode = 2; } ), menuItem(__txt("Saturation"), function() { mode = 2; } ),

View file

@ -554,7 +554,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(instanceof(content[i]) == "Panel_Menu") if(instanceof(content[i]) == "Panel_Menu")
array_remove(menu, 2); array_remove(menu, 2);
menuCall("panel_border_menu",,, menu); menuCall("panel_border_menu", menu);
} }
if(mouse_press(mb_middle, FOCUS == self)) if(mouse_press(mb_middle, FOCUS == self))
@ -722,7 +722,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(instanceof(getContent()) == "Panel_Menu") if(instanceof(getContent()) == "Panel_Menu")
array_remove(menu, border_rb_close); array_remove(menu, border_rb_close);
menuCall("panel_border_menu",,, menu); menuCall("panel_border_menu", menu);
} }
} }
} }

View file

@ -323,7 +323,7 @@ function Panel_File_Explorer() : PanelContent() constructor {
__menu_cnxt_selecting = context_hovering; __menu_cnxt_selecting = context_hovering;
if(file_hovering == noone || is_instanceof(file_hovering, ExpDir)) if(file_hovering == noone || is_instanceof(file_hovering, ExpDir))
menuCall("",,, menu_general); menuCall("", menu_general);
} }
if(file_dragging) { if(file_dragging) {
@ -546,11 +546,8 @@ function Panel_File_Explorer() : PanelContent() constructor {
if(pFOCUS && mouse_press(mb_right)) { if(pFOCUS && mouse_press(mb_right)) {
__menu_file_selecting = _fil; __menu_file_selecting = _fil;
if(path_is_image(_fil.path)) if(path_is_image(_fil.path)) menuCall("", menu_file_image);
menuCall("",,, menu_file_image); else if(path_is_project(_fil.path)) menuCall("", menu_file_project);
else if(path_is_project(_fil.path))
menuCall("",,, menu_file_project);
} }
if(pFOCUS && DOUBLE_CLICK) if(pFOCUS && DOUBLE_CLICK)
@ -629,11 +626,8 @@ function Panel_File_Explorer() : PanelContent() constructor {
if(pFOCUS && mouse_press(mb_right)) { if(pFOCUS && mouse_press(mb_right)) {
__menu_file_selecting = _fil; __menu_file_selecting = _fil;
if(path_is_image(_fil.path)) if(path_is_image(_fil.path)) menuCall("", menu_file_image);
menuCall("",,, menu_file_image); else if(path_is_project(_fil.path)) menuCall("", menu_file_project);
else if(path_is_project(_fil.path))
menuCall("",,, menu_file_project);
} }
if(pFOCUS && DOUBLE_CLICK) if(pFOCUS && DOUBLE_CLICK)

View file

@ -1353,7 +1353,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
} }
} }
menuCall("graph_node_selected_menu",,, menu); menuCall("graph_node_selected_menu", menu);
} else if(node_hover && node_hover.draggable) { } else if(node_hover && node_hover.draggable) {
// print($"Right click node hover {node_hover}"); // print($"Right click node hover {node_hover}");
@ -1380,7 +1380,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
if(array_length(nodes_selecting) >= 2) if(array_length(nodes_selecting) >= 2)
array_push(menu, -1, menu_nodes_align, menu_nodes_blend, menu_nodes_compose, menu_nodes_array); array_push(menu, -1, menu_nodes_align, menu_nodes_blend, menu_nodes_compose, menu_nodes_array);
menuCall("graph_node_selected_multiple_menu",,, menu ); menuCall("graph_node_selected_multiple_menu", menu );
} else if(node_hover == noone) { } else if(node_hover == noone) {
// print($"Right click not node hover"); // print($"Right click not node hover");
@ -1410,7 +1410,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
var ctx = is_instanceof(frame_hovering, Node_Collection_Inline)? frame_hovering : getCurrentContext(); var ctx = is_instanceof(frame_hovering, Node_Collection_Inline)? frame_hovering : getCurrentContext();
var _diaAdd = callAddDialog(ctx); var _diaAdd = callAddDialog(ctx);
var _dia = menuCall("graph_node_selected_menu", o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), menu, fa_right ); var _dia = menuCall("graph_node_selected_menu", menu, o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), fa_right );
_dia.passthrough = true; _dia.passthrough = true;
setFocus(_diaAdd, "Dialog"); setFocus(_diaAdd, "Dialog");
} }
@ -1816,7 +1816,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
}, THEME.loop_24,,, { junc_in : _connect[1], junc_out : _connect[2] }), }, THEME.loop_24,,, { junc_in : _connect[1], junc_out : _connect[2] }),
]; ];
menuCall(,,, menu); menuCall("", menu);
} }
value_dragging = noone; value_dragging = noone;

View file

@ -751,7 +751,7 @@ function Panel_Inspector() : PanelContent() constructor {
if(mouse_press(mb_left, pFOCUS)) if(mouse_press(mb_left, pFOCUS))
jun[@ 1] = !coll; jun[@ 1] = !coll;
if(mouse_press(mb_right, pFOCUS)) if(mouse_press(mb_right, pFOCUS))
menuCall("inspector_group_menu",,, group_menu,, _inspecting); menuCall("inspector_group_menu", group_menu, 0, 0, fa_left, _inspecting);
} else } else
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, lbw, lbh, COLORS.panel_inspector_group_bg, 1); draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, lbw, lbh, COLORS.panel_inspector_group_bg, 1);
@ -914,7 +914,7 @@ function Panel_Inspector() : PanelContent() constructor {
array_push(_menuItem, menu_junc_extract); array_push(_menuItem, menu_junc_extract);
} }
var dia = menuCall("inspector_value_menu",,, _menuItem,, jun); var dia = menuCall("inspector_value_menu", _menuItem,, jun);
__dialog_junction = jun; __dialog_junction = jun;
} #endregion } #endregion
} }

View file

@ -428,8 +428,8 @@ function Panel_Menu() : PanelContent() constructor {
draw_sprite_stretched(THEME.s_box_r2_clr, 0, x0, y0, x1 - x0, y1 - y0); draw_sprite_stretched(THEME.s_box_r2_clr, 0, x0, y0, x1 - x0, y1 - y0);
if((mouse_press(mb_left, pFOCUS)) || instance_exists(o_dialog_menubox)) { if((mouse_press(mb_left, pFOCUS)) || instance_exists(o_dialog_menubox)) {
if(hori) menuCall($"main_{_name}_menu", x + x0, y + y1, _menu[1]); if(hori) menuCall($"main_{_name}_menu", _menu[1], x + x0, y + y1);
else menuCall($"main_{_name}_menu", x + x1, y + y0, _menu[1]); else menuCall($"main_{_name}_menu", _menu[1], x + x1, y + y0);
} }
} }
@ -726,7 +726,7 @@ function Panel_Menu() : PanelContent() constructor {
array_push(tip, [ method(_dat, _dat.getThumbnail), VALUE_TYPE.surface ]); array_push(tip, [ method(_dat, _dat.getThumbnail), VALUE_TYPE.surface ]);
} }
var dia = hori? menuCall("title_recent_menu", x + tcx, y + h, arr, fa_center) : menuCall("title_recent_menu", x + w, y + tby0, arr); var dia = hori? menuCall("title_recent_menu", arr, x + tcx, y + h, fa_center) : menuCall("title_recent_menu", arr, x + w, y + tby0);
dia.tooltips = tip; dia.tooltips = tip;
} }

View file

@ -82,7 +82,7 @@ function Panel_Notification() : PanelContent() constructor {
if(mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_right, pFOCUS)) {
noti_selecting = noti; noti_selecting = noti;
var dia = menuCall("notification_menu",,, [ var dia = menuCall("notification_menu", [
menuItem(__txtx("noti_copy_message", "Copy notification message"), function() { clipboard_set_text(noti_selecting.txt); }), menuItem(__txtx("noti_copy_message", "Copy notification message"), function() { clipboard_set_text(noti_selecting.txt); }),
menuItem(__txtx("noti_delete_message", "Delete notification"), function() { ds_list_remove(STATUSES, noti_selecting); }), menuItem(__txtx("noti_delete_message", "Delete notification"), function() { ds_list_remove(STATUSES, noti_selecting); }),
]); ]);
@ -157,21 +157,21 @@ function Panel_Notification() : PanelContent() constructor {
var toolt = error? __txtx("noti_hide_error", "Hide error") : __txtx("noti_show_error", "Show error"); var toolt = error? __txtx("noti_hide_error", "Hide error") : __txtx("noti_show_error", "Show error");
var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_error, error, c_white, 0.75 + error * 0.25); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_error, error, c_white, 0.75 + error * 0.25);
if(b == 2) filter = filter ^ NOTI_TYPE.error; if(b == 2) filter = filter ^ NOTI_TYPE.error;
if(b == 3) menuCall("notification_error_menu",,, rightClickMenu); if(b == 3) menuCall("notification_error_menu", rightClickMenu);
bx -= ui(36); bx -= ui(36);
var warn = !!(filter & NOTI_TYPE.warning); var warn = !!(filter & NOTI_TYPE.warning);
var toolt = warn? __txtx("noti_hide_warning", "Hide warning") : __txtx("noti_show_warning", "Show warning"); var toolt = warn? __txtx("noti_hide_warning", "Hide warning") : __txtx("noti_show_warning", "Show warning");
var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_warning, warn, c_white, 0.75 + warn * 0.25); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_warning, warn, c_white, 0.75 + warn * 0.25);
if(b == 2) filter = filter ^ NOTI_TYPE.warning; if(b == 2) filter = filter ^ NOTI_TYPE.warning;
if(b == 3) menuCall("notification_warning_menu",,, rightClickMenu); if(b == 3) menuCall("notification_warning_menu", rightClickMenu);
bx -= ui(36); bx -= ui(36);
var log = !!(filter & NOTI_TYPE.log); var log = !!(filter & NOTI_TYPE.log);
var toolt = log? __txtx("noti_hide_log", "Hide log") : __txtx("noti_show_log", "Show log"); var toolt = log? __txtx("noti_hide_log", "Hide log") : __txtx("noti_show_log", "Show log");
var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_log, log, c_white, 0.75 + log * 0.25); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_log, log, c_white, 0.75 + log * 0.25);
if(b == 2) filter = filter ^ NOTI_TYPE.log; if(b == 2) filter = filter ^ NOTI_TYPE.log;
if(b == 3) menuCall("notification_log_menu",,, rightClickMenu); if(b == 3) menuCall("notification_log_menu", rightClickMenu);
var px = ui(padding); var px = ui(padding);
var py = ui(title_height); var py = ui(title_height);

View file

@ -160,7 +160,7 @@ function Panel_Palette() : PanelContent() constructor {
hovering = preset; hovering = preset;
right_clicked = true; right_clicked = true;
menuCall("palette_window_preset_menu",,, [ menuCall("palette_window_preset_menu", [
menu_add, menu_add,
menu_refresh, menu_refresh,
-1, -1,
@ -183,7 +183,7 @@ function Panel_Palette() : PanelContent() constructor {
} }
if(!right_clicked && mouse_press(mb_right, pFOCUS)) { if(!right_clicked && mouse_press(mb_right, pFOCUS)) {
menuCall("palette_window_preset_menu_empty",,, [ menuCall("palette_window_preset_menu_empty", [
menu_add, menu_add,
menu_refresh, menu_refresh,
-1, -1,

View file

@ -187,7 +187,7 @@ function Panel_Palette_Mixer() : PanelContent() constructor {
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 ], pFOCUS, pHOVER, "", THEME.hamburger_s);
if(_b == 2) { if(_b == 2) {
menuCall("",,, [ menuCall("", [
menuItem("Save palette as...", function() { menuItem("Save palette as...", function() {
var _path = get_save_filename_pxc("Hex paleete|*.hex", "Palette"); var _path = get_save_filename_pxc("Hex paleete|*.hex", "Palette");
if(_path != "") { if(_path != "") {
@ -391,7 +391,7 @@ function Panel_Palette_Mixer() : PanelContent() constructor {
if(mouse_press(mb_right)) { if(mouse_press(mb_right)) {
conn_menu_ctx = [ blnd_hovering ]; conn_menu_ctx = [ blnd_hovering ];
menuCall(,,, [ menuCall("", [
menuItem("Delete Blend point", function() { array_delete(palette_data.blends, conn_menu_ctx[0], 1); } ), menuItem("Delete Blend point", function() { array_delete(palette_data.blends, conn_menu_ctx[0], 1); } ),
]); ]);
} }
@ -442,7 +442,7 @@ function Panel_Palette_Mixer() : PanelContent() constructor {
if(mouse_press(mb_right)) { if(mouse_press(mb_right)) {
conn_menu_ctx = [ conn[0], conn[1], _con_rat ]; conn_menu_ctx = [ conn[0], conn[1], _con_rat ];
menuCall(,,, [ menuCall("", [
menuItem("New Blend point", function() { array_push(palette_data.blends, { from : conn_menu_ctx[0], to : conn_menu_ctx[1], amount : conn_menu_ctx[2] }) } ), menuItem("New Blend point", function() { array_push(palette_data.blends, { from : conn_menu_ctx[0], to : conn_menu_ctx[1], amount : conn_menu_ctx[2] }) } ),
]); ]);
} }
@ -466,7 +466,7 @@ function Panel_Palette_Mixer() : PanelContent() constructor {
} }
if(mouse_press(mb_right)) { if(mouse_press(mb_right)) {
menuCall(,,, [ menuCall("", [
menuItem("Center view", function() { centerView(); } ), menuItem("Center view", function() { centerView(); } ),
-1, -1,
menuItem("Save mixed...", function() { menuItem("Save mixed...", function() {

View file

@ -110,7 +110,7 @@ function Panel_Presets(_node) : PanelContent() constructor {
if(mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_right, pFOCUS)) {
selecting_preset = preset; selecting_preset = preset;
menuCall("preset_window_menu",,, context_menu); menuCall("preset_window_menu", context_menu);
} }
} }
@ -130,7 +130,7 @@ function Panel_Presets(_node) : PanelContent() constructor {
} }
if(mouse_press(mb_right, pFOCUS)) if(mouse_press(mb_right, pFOCUS))
menuCall("preset_window_menu",,, context_def); menuCall("preset_window_menu", context_def);
} }
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text, aa); draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text, aa);
@ -167,7 +167,7 @@ function Panel_Presets(_node) : PanelContent() constructor {
if(mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_right, pFOCUS)) {
selecting_preset = preset; selecting_preset = preset;
dia = menuCall("preset_window_menu",,, context_menu); dia = menuCall("preset_window_menu", context_menu);
} }
} }

View file

@ -307,12 +307,12 @@ function Panel_Preview() : PanelContent() constructor {
return __txtx("panel_preview_tile_mode", "Tile mode"); return __txtx("panel_preview_tile_mode", "Tile mode");
}, },
function(data) { function(data) {
menuCall("preview_tile_menu", data.x + ui(28), data.y + ui(28), [ menuCall("preview_tile_menu", [
MENU_ITEMS.preview_set_tile_off, MENU_ITEMS.preview_set_tile_off,
MENU_ITEMS.preview_set_tile_horizontal, MENU_ITEMS.preview_set_tile_horizontal,
MENU_ITEMS.preview_set_tile_vertical, MENU_ITEMS.preview_set_tile_vertical,
MENU_ITEMS.preview_set_tile_both, MENU_ITEMS.preview_set_tile_both,
]); ], data.x + ui(28), data.y + ui(28));
} }
], ],
[ [
@ -2121,7 +2121,7 @@ function Panel_Preview() : PanelContent() constructor {
drawToolBar(tool, _prev_node); drawToolBar(tool, _prev_node);
if(mouse_on_preview && mouse_press(mb_right, pFOCUS) && !key_mod_press(SHIFT)) { if(mouse_on_preview && mouse_press(mb_right, pFOCUS) && !key_mod_press(SHIFT)) {
menuCall("preview_context_menu",,, [ menuCall("preview_context_menu", [
MENU_ITEMS.preview_new_preview_window, MENU_ITEMS.preview_new_preview_window,
-1, -1,
MENU_ITEMS.preview_save_current_frame, MENU_ITEMS.preview_save_current_frame,
@ -2130,7 +2130,7 @@ function Panel_Preview() : PanelContent() constructor {
MENU_ITEMS.preview_copy_current_frame, MENU_ITEMS.preview_copy_current_frame,
MENU_ITEMS.preview_copy_color, MENU_ITEMS.preview_copy_color,
MENU_ITEMS.preview_copy_color_hex, MENU_ITEMS.preview_copy_color_hex,
],, getNodePreview()); ], 0, 0, fa_left, getNodePreview());
} }
////////////////////////////////// File drop ////////////////////////////////// ////////////////////////////////// File drop //////////////////////////////////

View file

@ -165,7 +165,7 @@ function Panel_Preview_Window() : PanelContent() constructor {
array_push(_menu, menuItem(o.name, function(_dat) { changeChannel(_dat.index); })); array_push(_menu, menuItem(o.name, function(_dat) { changeChannel(_dat.index); }));
} }
menuCall("preview_window_menu",,, _menu,, node_target); menuCall("preview_window_menu", _menu, 0, 0, fa_left, node_target);
} }
} }
} }

View file

@ -102,7 +102,7 @@ function Panel_Workspace() : PanelContent() constructor {
if(mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_right, pFOCUS)) {
layout_selecting = str; layout_selecting = str;
menuCall("workspace_menu",,, [ menuCall("workspace_menu", [
menuItem(__txt("Select"), apply_space), menuItem(__txt("Select"), apply_space),
menuItem(__txtx("workspace_replace_current", "Replace with current"), replace_space), menuItem(__txtx("workspace_replace_current", "Replace with current"), replace_space),
menuItem(__txt("Delete"), delete_space, THEME.cross), menuItem(__txt("Delete"), delete_space, THEME.cross),