mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
hotkeys
This commit is contained in:
parent
97b567b2be
commit
fd42355a29
16 changed files with 131 additions and 103 deletions
|
@ -457,7 +457,7 @@
|
|||
"isEcma":false,
|
||||
"LibraryEmitters":[],
|
||||
"MetaData":{
|
||||
"IDEVersion":"2024.4.0.137",
|
||||
"IDEVersion":"2024.2.0.132",
|
||||
},
|
||||
"name":"PixelComposer",
|
||||
"resources":[
|
||||
|
|
|
@ -803,8 +803,9 @@ event_inherited();
|
|||
sp_hotkey.surface_w, th + padd * 2, COLORS.dialog_preference_prop_bg, 1);
|
||||
}
|
||||
|
||||
var _lb_y = yy + hh + ui(4);
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
|
||||
draw_text_add(ui(24), yy + hh, name);
|
||||
draw_text_add(ui(24), _lb_y, name);
|
||||
|
||||
var dk = key_get_name(key.key, key.modi);
|
||||
var kw = string_width(dk);
|
||||
|
@ -852,11 +853,11 @@ event_inherited();
|
|||
|
||||
dk = key_get_name(key.key, key.modi);
|
||||
kw = string_width(dk);
|
||||
draw_sprite_stretched(THEME.button_hide, 2, key_x1 - ui(40) - kw, yy + hh - ui(6), kw + ui(32), th + ui(12));
|
||||
draw_sprite_stretched(THEME.button_hide, 2, key_x1 - ui(40) - kw, yy + hh, kw + ui(32), th);
|
||||
} else {
|
||||
var bx = key_x1 - ui(40) - kw;
|
||||
var by = yy + hh - ui(6);
|
||||
if(buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th + ui(12), _m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) {
|
||||
var by = yy + hh;
|
||||
if(buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th, _m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) {
|
||||
hk_editing = key;
|
||||
keyboard_lastchar = pkey;
|
||||
}
|
||||
|
@ -866,7 +867,7 @@ event_inherited();
|
|||
if(hk_editing == key) cc = COLORS._main_text_accent;
|
||||
|
||||
draw_set_text(f_p0, fa_right, fa_top, cc);
|
||||
draw_text_add(key_x1 - ui(24), yy + hh, dk);
|
||||
draw_text_add(key_x1 - ui(24), _lb_y, dk);
|
||||
|
||||
if(key.key != dkey || key.modi != dmod) {
|
||||
modified = true;
|
||||
|
@ -910,13 +911,15 @@ event_inherited();
|
|||
|
||||
var name = __txt(_hotkey);
|
||||
var pkey = hotkey.key;
|
||||
if(pkey == "") pkey = "None";
|
||||
|
||||
if(j % 2 == 0)
|
||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy + hh - padd, sp_hotkey.surface_w, th + padd * 2, COLORS.dialog_preference_prop_bg, 1);
|
||||
|
||||
if(j % 2 == 0) {
|
||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy + hh - padd,
|
||||
sp_hotkey.surface_w, th + padd * 2, COLORS.dialog_preference_prop_bg, 1);
|
||||
}
|
||||
|
||||
var _lb_y = yy + hh + ui(4);
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
|
||||
draw_text_add(ui(24), yy + hh, name);
|
||||
draw_text_add(ui(24), _lb_y, name);
|
||||
|
||||
var kw = string_width(pkey);
|
||||
var bx = key_x1 - ui(40) - kw;
|
||||
|
@ -931,11 +934,11 @@ event_inherited();
|
|||
PREF_SAVE();
|
||||
}
|
||||
|
||||
draw_sprite_stretched(THEME.button_hide, 2, key_x1 - ui(40) - kw, yy + hh - ui(6), kw + ui(32), th + ui(12));
|
||||
draw_sprite_stretched(THEME.button_hide, 2, key_x1 - ui(40) - kw, yy + hh, kw + ui(32), th);
|
||||
} else {
|
||||
var bx = key_x1 - ui(40) - kw;
|
||||
var by = yy + hh - ui(6);
|
||||
if(buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th + ui(12), _m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) {
|
||||
var by = yy + hh;
|
||||
if(buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th, _m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) {
|
||||
hk_editing = key;
|
||||
keyboard_lastchar = pkey;
|
||||
}
|
||||
|
@ -945,7 +948,7 @@ event_inherited();
|
|||
if(hk_editing == key) cc = COLORS._main_text_accent;
|
||||
|
||||
draw_set_text(f_p0, fa_right, fa_top, cc);
|
||||
draw_text_add(key_x1 - ui(24), yy + hh, pkey);
|
||||
draw_text_add(key_x1 - ui(24), _lb_y, pkey);
|
||||
|
||||
if(key.key != key.dkey) {
|
||||
modified = true;
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
#region get name
|
||||
function key_get_name(_key, _mod) {
|
||||
if(_key == 0 && _mod == MOD_KEY.none)
|
||||
return "None";
|
||||
return "";
|
||||
|
||||
var dk = "";
|
||||
if(_mod & MOD_KEY.ctrl) dk += "Ctrl+";
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Iterator_Each_Inline_Input(_x, _y, _group = noone) : Node(_x, _y,
|
|||
name = "Loop Input";
|
||||
color = COLORS.node_blend_loop;
|
||||
loop = noone;
|
||||
setDimension(96, 48);
|
||||
|
||||
clonable = false;
|
||||
inline_parent_object = "Node_Iterate_Each_Inline";
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Iterator_Each_Inline_Output(_x, _y, _group = noone) : Node(_x, _y,
|
|||
name = "Loop Output";
|
||||
color = COLORS.node_blend_loop;
|
||||
loop = noone;
|
||||
setDimension(96, 48);
|
||||
|
||||
clonable = false;
|
||||
inline_parent_object = "Node_Iterate_Each_Inline";
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Iterator_Filter_Inline_Input(_x, _y, _group = noone) : Node(_x, _y
|
|||
name = "Filter Input";
|
||||
color = COLORS.node_blend_loop;
|
||||
loop = noone;
|
||||
setDimension(96, 48);
|
||||
|
||||
clonable = false;
|
||||
inline_parent_object = "Node_Iterate_Filter_Inline";
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Iterator_Filter_Inline_Output(_x, _y, _group = noone) : Node(_x, _
|
|||
name = "Filter Output";
|
||||
color = COLORS.node_blend_loop;
|
||||
loop = noone;
|
||||
setDimension(96, 48);
|
||||
|
||||
clonable = false;
|
||||
inline_parent_object = "Node_Iterate_Filter_Inline";
|
||||
|
|
|
@ -5,7 +5,7 @@ function Node_Iterator_Input(_x, _y, _group = noone) : Node_Group_Input(_x, _y,
|
|||
local_output = noone;
|
||||
|
||||
manual_ungroupable = false;
|
||||
setDimension(96, 32 + 24 * 2);
|
||||
setDimension(96, 48);
|
||||
|
||||
outputs[| 0].getValueDefault = method(outputs[| 0], outputs[| 0].getValueRecursive); //Get value from outside loop
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
is_group_io = true;
|
||||
|
||||
manual_ungroupable = false;
|
||||
setDimension(96, 32 + 24 * 2);
|
||||
setDimension(96, 48);
|
||||
|
||||
inputs[| 0].setFrom_condition = function(_valueFrom) { #region
|
||||
if(instanceof(_valueFrom.node) != "Node_Iterator_Input") return true;
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Iterator_Sort_Inline_Input(_x, _y, _group = noone) : Node(_x, _y,
|
|||
name = "Sort Input";
|
||||
color = COLORS.node_blend_loop;
|
||||
loop = noone;
|
||||
setDimension(96, 48);
|
||||
|
||||
clonable = false;
|
||||
inline_parent_object = "Node_Iterate_Sort_Inline";
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Iterator_Sort_Inline_Output(_x, _y, _group = noone) : Node(_x, _y,
|
|||
name = "Sort result";
|
||||
color = COLORS.node_blend_loop;
|
||||
loop = noone;
|
||||
setDimension(96, 48);
|
||||
|
||||
clonable = false;
|
||||
inline_parent_object = "Node_Iterate_Sort_Inline";
|
||||
|
|
|
@ -846,8 +846,8 @@ function __initNodes() {
|
|||
addNodeObject(values, "Sort Array", s_node_array_sort, "Node_Array_Sort", [1, Node_Array_Sort], ["array sort"]).setVersion(1120);
|
||||
addNodeObject(values, "Shuffle Array", s_node_array_shuffle, "Node_Array_Shuffle", [1, Node_Array_Shuffle], ["array shuffle"]).setVersion(1120);
|
||||
addNodeObject(values, "Loop Array", s_node_loop_array, "Node_Iterate_Each_Inline", [1, Node_Iterate_Each_Inline], ["iterate each", "for each", "array loop"], "Create group that iterate to each member in an array.");
|
||||
addNodeObject(values, "Filter Array", s_node_filter_array, "Node_Iterate_Filter_Inline", [1, Node_Iterate_Filter_Inline],, "Filter array using condition.").setVersion(1140);
|
||||
addNodeObject(values, "Sort Array", s_node_sort_array, "Node_Iterate_Sort_Inline", [1, Node_Iterate_Sort_Inline],, "Sort array using node graph.").setVersion(1143);
|
||||
addNodeObject(values, "Filter Array", s_node_filter_array, "Node_Iterate_Filter_Inline", [1, Node_Iterate_Filter_Inline], ["array filter"], "Filter array using condition.").setVersion(1140);
|
||||
addNodeObject(values, "Sort Array (inline)",s_node_sort_array, "Node_Iterate_Sort_Inline", [1, Node_Iterate_Sort_Inline], ["array sort"], "Sort array using node graph.").setVersion(1143);
|
||||
addNodeObject(values, "Parse CSV", s_node_csv_parse, "Node_Array_CSV_Parse", [1, Node_Array_CSV_Parse]).setVersion(1145);
|
||||
|
||||
ds_list_add(values, "Paths");
|
||||
|
|
|
@ -190,6 +190,11 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
addHotkey("Animation", "Collapse Toggle", "C", MOD_KEY.none, collapseToggle);
|
||||
addHotkey("Animation", "Toggle nodes", "H", MOD_KEY.none, panel_animation_show_nodes);
|
||||
|
||||
addHotkey("Animation", "Settings", "S", MOD_KEY.ctrl | MOD_KEY.shift, function() {
|
||||
var dia = dialogPanelCall(new Panel_Animation_Setting());
|
||||
dia.anchor = ANCHOR.none;
|
||||
});
|
||||
|
||||
tooltip_toggle_nodes = new tooltipHotkey(__txtx("panel_animation_show_node", "Toggle node label"), "Animation", "Toggle nodes");
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -162,6 +162,7 @@
|
|||
panelDisplayInit();
|
||||
|
||||
checkPanelValid();
|
||||
__initPanelHotkeys();
|
||||
} #endregion
|
||||
|
||||
function setPanel() { #region
|
||||
|
@ -432,4 +433,39 @@
|
|||
|
||||
return instanceof(FOCUS.getContent()) == instanceof(content);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region hotkey
|
||||
function __initPanelHotkeys() {
|
||||
addHotkey("", "Preference", "", MOD_KEY.none, function() /*=>*/ {return dialogCall(o_dialog_preference)});
|
||||
addHotkey("", "Splash screen", "", MOD_KEY.none, function() /*=>*/ {return dialogCall(o_dialog_splash)});
|
||||
addHotkey("", "Release note", "", MOD_KEY.none, function() /*=>*/ {return dialogCall(o_dialog_release_note)});
|
||||
addHotkey("", "Autosave folder", "", MOD_KEY.none, function() /*=>*/ {return shellOpenExplorer(DIRECTORY + "autosave")});
|
||||
|
||||
addHotkey("", "Recent files", "R", MOD_KEY.ctrl | MOD_KEY.shift, function() /*=>*/ {
|
||||
var arr = [];
|
||||
for(var i = 0; i < min(10, ds_list_size(RECENT_FILES)); i++)
|
||||
array_push(arr, menuItem(RECENT_FILES[| i], function(_dat) { LOAD_PATH(_dat.name); }));
|
||||
|
||||
return menuCall("Recent files",,, arr);
|
||||
});
|
||||
|
||||
addHotkey("", "Addons", "", MOD_KEY.none, function() /*=>*/ {return dialogPanelCall(new Panel_Addon())});
|
||||
addHotkey("", "History", "", MOD_KEY.none, function() /*=>*/ {return dialogPanelCall(new Panel_History())});
|
||||
|
||||
addHotkey("", "Notification Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Notification", true)});
|
||||
addHotkey("", "Collections Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Collection", true)});
|
||||
addHotkey("", "Graph Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Graph", true)});
|
||||
addHotkey("", "Preview Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Preview", true)});
|
||||
addHotkey("", "Inspector Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Inspector", true)});
|
||||
addHotkey("", "Workspace Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Workspace", true)});
|
||||
addHotkey("", "Animation Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Animation", true)});
|
||||
addHotkey("", "Align Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Node_Align", true)});
|
||||
addHotkey("", "Nodes Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Nodes", true)});
|
||||
addHotkey("", "Tunnels Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Tunnels", true)});
|
||||
addHotkey("", "Color Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Color", true)});
|
||||
addHotkey("", "Palettes Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Palette", true)});
|
||||
addHotkey("", "Gradients Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Gradient", true)});
|
||||
addHotkey("", "Console Panel", "", MOD_KEY.none, function() /*=>*/ {return panelAdd("Panel_Console", true)});
|
||||
}
|
||||
#endregion
|
|
@ -32,7 +32,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
|
||||
return submenuCall(_dat, arr);
|
||||
}).setIsShelf(),
|
||||
menuItem(__txtx("panel_menu_auto_save_folder", "Open autosave folder"), function() { shellOpenExplorer(DIRECTORY + "autosave"); }, THEME.save_auto),
|
||||
menuItem(__txtx("panel_menu_auto_save_folder", "Open autosave folder"), function() { shellOpenExplorer(DIRECTORY + "autosave"); }, THEME.save_auto, ["", "Autosave folder"]),
|
||||
menuItem(__txt("Import"), function(_dat) {
|
||||
var arr = [
|
||||
menuItem(__txt("Portable project (.zip)") + "...", function() { __IMPORT_ZIP(); }),
|
||||
|
@ -51,12 +51,12 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
];
|
||||
|
||||
menu_file = [
|
||||
menuItem(__txt("Preferences") + "...", function() { dialogCall(o_dialog_preference); }, THEME.gear),
|
||||
menuItem(__txt("Splash screen"), function() { dialogCall(o_dialog_splash); }),
|
||||
menuItem(__txt("Preferences") + "...", function() { dialogCall(o_dialog_preference); }, THEME.gear, ["", "Preference"]),
|
||||
menuItem(__txt("Splash screen"), function() { dialogCall(o_dialog_splash); }, noone, ["", "Splash Screen"]),
|
||||
-1,
|
||||
menuItem(__txt("Addons"), function(_dat) {
|
||||
var arr = [
|
||||
menuItem(__txt("Addons") + "...", function() { dialogPanelCall(new Panel_Addon()); }),
|
||||
menuItem(__txt("Addons") + "...", function() { dialogPanelCall(new Panel_Addon()); }, noone, ["", "Addons"]),
|
||||
menuItem(__txtx("panel_menu_addons_key", "Key displayer"), function() {
|
||||
if(instance_exists(addon_key_displayer)) {
|
||||
instance_destroy(addon_key_displayer);
|
||||
|
@ -76,10 +76,10 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
return submenuCall(_dat, arr);
|
||||
}, THEME.addon_icon ).setIsShelf(),
|
||||
-1,
|
||||
menuItem(__txt("Fullscreen"), function() { winMan_setFullscreen(!window_is_fullscreen); },, ["", "Fullscreen"]),
|
||||
menuItem(__txt("Close current project"), function() { PANEL_GRAPH.close(); },, [ "", "Close file" ]),
|
||||
menuItem(__txt("Close all projects"), function() { for( var i = array_length(PROJECTS) - 1; i >= 0; i-- ) closeProject(PROJECTS[i]); },, [ "", "Close all" ]),
|
||||
menuItem(__txt("Close program"), function() { window_close(); },, [ "", "Close program" ]),
|
||||
menuItem(__txt("Fullscreen"), function() { winMan_setFullscreen(!window_is_fullscreen); }, noone, ["", "Fullscreen"]),
|
||||
menuItem(__txt("Close current project"), function() { PANEL_GRAPH.close(); }, noone, [ "", "Close file" ]),
|
||||
menuItem(__txt("Close all projects"), function() { for( var i = array_length(PROJECTS) - 1; i >= 0; i-- ) closeProject(PROJECTS[i]); }, noone, [ "", "Close all" ]),
|
||||
menuItem(__txt("Close program"), function() { window_close(); }, noone, [ "", "Close program" ]),
|
||||
];
|
||||
|
||||
if(!DEMO) menu_file = array_append(menu_file_nondemo, menu_file);
|
||||
|
@ -112,13 +112,16 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
#endregion
|
||||
|
||||
#region //////// MENU ////////
|
||||
menuItem_undo = menuItem(__txt("Undo"), function() { UNDO(); }, THEME.undo, ["", "Undo"]);
|
||||
menuItem_redo = menuItem(__txt("Redo"), function() { REDO(); }, THEME.redo, ["", "Redo"]);
|
||||
|
||||
menus = [
|
||||
[ __txt("File"), menu_file ],
|
||||
|
||||
[ __txt("Edit"), [
|
||||
menuItem(__txt("Undo"), function() { UNDO(); }, THEME.undo, ["", "Undo"]),
|
||||
menuItem(__txt("Redo"), function() { REDO(); }, THEME.redo, ["", "Redo"]),
|
||||
menuItem(__txt("History"), function() { dialogPanelCall(new Panel_History()); }),
|
||||
menuItem_undo,
|
||||
menuItem_redo,
|
||||
menuItem(__txt("History"), function() { dialogPanelCall(new Panel_History()); }, noone, ["", "History"]),
|
||||
]],
|
||||
|
||||
[ __txt("Preview"), [
|
||||
|
@ -135,7 +138,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
menuItem(__txtx("panel_menu_animation_setting", "Animation Settings..."), function() {
|
||||
var dia = dialogPanelCall(new Panel_Animation_Setting());
|
||||
dia.anchor = ANCHOR.none;
|
||||
}, THEME.animation_setting),
|
||||
}, THEME.animation_setting, ["Animation", "Settings"]),
|
||||
-1,
|
||||
menuItem(__txtx("panel_menu_animation_scaler", "Animation Scaler..."), function() {
|
||||
dialogPanelCall(new Panel_Animation_Scaler());
|
||||
|
@ -198,28 +201,28 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
return submenuCall(_dat, arr);
|
||||
}).setIsShelf(),
|
||||
-1,
|
||||
menuItem(__txt("Collections"), function() { panelAdd("Panel_Collection", true) },,, function() { return findPanel("Panel_Collection") != noone; } ),
|
||||
menuItem(__txt("Graph"), function() { panelAdd("Panel_Graph", true) },,, function() { return findPanel("Panel_Graph") != noone; } ),
|
||||
menuItem(__txt("Preview"), function() { panelAdd("Panel_Preview", true) },,, function() { return findPanel("Panel_Preview") != noone; } ),
|
||||
menuItem(__txt("Inspector"), function() { panelAdd("Panel_Inspector", true) },,, function() { return findPanel("Panel_Inspector") != noone; } ),
|
||||
menuItem(__txt("Workspace"), function() { panelAdd("Panel_Workspace", true) },,, function() { return findPanel("Panel_Workspace") != noone; } ),
|
||||
menuItem(__txt("Animation"), function() { panelAdd("Panel_Animation", true) },,, function() { return findPanel("Panel_Animation") != noone; } ),
|
||||
menuItem(__txt("Notifications"), function() { panelAdd("Panel_Notification", true) },,, function() { return findPanel("Panel_Notification") != noone; } ),
|
||||
menuItem(__txtx("panel_globalvar", "Global Variables"), function() { panelAdd("Panel_Globalvar", true) },,, function() { return findPanel("Panel_Globalvar") != noone; } ),
|
||||
menuItem(__txt("Collections"), function() { panelAdd("Panel_Collection", true) }, noone, ["", "Collections Panel"], function() { return findPanel("Panel_Collection") != noone; } ),
|
||||
menuItem(__txt("Graph"), function() { panelAdd("Panel_Graph", true) }, noone, ["", "Graph Panel"], function() { return findPanel("Panel_Graph") != noone; } ),
|
||||
menuItem(__txt("Preview"), function() { panelAdd("Panel_Preview", true) }, noone, ["", "Preview Panel"], function() { return findPanel("Panel_Preview") != noone; } ),
|
||||
menuItem(__txt("Inspector"), function() { panelAdd("Panel_Inspector", true) }, noone, ["", "Inspector Panel"], function() { return findPanel("Panel_Inspector") != noone; } ),
|
||||
menuItem(__txt("Workspace"), function() { panelAdd("Panel_Workspace", true) }, noone, ["", "Workspace Panel"], function() { return findPanel("Panel_Workspace") != noone; } ),
|
||||
menuItem(__txt("Animation"), function() { panelAdd("Panel_Animation", true) }, noone, ["", "Animation Panel"], function() { return findPanel("Panel_Animation") != noone; } ),
|
||||
menuItem(__txt("Notifications"), function() { panelAdd("Panel_Notification", true) }, noone, ["", "Notification Panel"], function() { return findPanel("Panel_Notification") != noone; } ),
|
||||
menuItem(__txtx("panel_globalvar", "Global Variables"), function() { panelAdd("Panel_Globalvar", true) }, noone, noone, function() { return findPanel("Panel_Globalvar") != noone; } ),
|
||||
|
||||
menuItem(__txt("Nodes"), function(_dat) {
|
||||
return submenuCall(_dat, [
|
||||
menuItem(__txt("Align"), function() { panelAdd("Panel_Node_Align", true) },,, function() { return findPanel("Panel_Node_Align") != noone; } ),
|
||||
menuItem(__txt("Nodes"), function() { panelAdd("Panel_Nodes", true) },,, function() { return findPanel("Panel_Nodes") != noone; } ),
|
||||
menuItem(__txt("Tunnels"), function() { panelAdd("Panel_Tunnels", true) },,, function() { return findPanel("Panel_Tunnels") != noone; } ),
|
||||
menuItem(__txt("Align"), function() { panelAdd("Panel_Node_Align", true) }, noone, ["", "Align Panel"], function() { return findPanel("Panel_Node_Align") != noone; } ),
|
||||
menuItem(__txt("Nodes"), function() { panelAdd("Panel_Nodes", true) }, noone, ["", "Nodes Panel"], function() { return findPanel("Panel_Nodes") != noone; } ),
|
||||
menuItem(__txt("Tunnels"), function() { panelAdd("Panel_Tunnels", true) }, noone, ["", "Tunnels Panel"], function() { return findPanel("Panel_Tunnels") != noone; } ),
|
||||
]);
|
||||
} ).setIsShelf(),
|
||||
|
||||
menuItem(__txt("Color"), function(_dat) {
|
||||
return submenuCall(_dat, [
|
||||
menuItem(__txt("Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ),
|
||||
menuItem(__txt("Palettes"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ),
|
||||
menuItem(__txt("Gradients"), function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ),
|
||||
menuItem(__txt("Color"), function() { panelAdd("Panel_Color", true) }, noone, ["", "Color Panel"], function() { return findPanel("Panel_Color") != noone; } ),
|
||||
menuItem(__txt("Palettes"), function() { panelAdd("Panel_Palette", true) }, noone, ["", "Palettes Panel"], function() { return findPanel("Panel_Palette") != noone; } ),
|
||||
menuItem(__txt("Gradients"), function() { panelAdd("Panel_Gradient", true) }, noone, ["", "Gradients Panel"], function() { return findPanel("Panel_Gradient") != noone; } ),
|
||||
]);
|
||||
} ).setIsShelf(),
|
||||
]],
|
||||
|
@ -230,55 +233,27 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
|
||||
if(TESTING) { #region
|
||||
array_push(menus, [ __txt("Dev"), [
|
||||
menuItem(__txtx("panel_debug_console", "Console"), function() {
|
||||
panelAdd("Panel_Console", true)
|
||||
}),
|
||||
menuItem(__txtx("panel_debug_overlay", "Debug overlay"), function() {
|
||||
show_debug_overlay(true);
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_tester", "Tester"), function() {
|
||||
var dia = dialogPanelCall(new Panel_Test());
|
||||
dia.destroy_on_click_out = false;
|
||||
}),
|
||||
menuItem(__txtx("panel_debug_console", "Console"), function() /*=>*/ { panelAdd("Panel_Console", true) }, noone, ["", "Console Panel"]),
|
||||
menuItem(__txtx("panel_debug_overlay", "Debug overlay"), function() /*=>*/ { show_debug_overlay(true); }),
|
||||
menuItem(__txtx("panel_menu_tester", "Tester"), function() /*=>*/ { var dia = dialogPanelCall(new Panel_Test()); dia.destroy_on_click_out = false; }),
|
||||
-1,
|
||||
|
||||
menuItem(__txtx("panel_menu_test_load_all", "Load all current collections"), function() {
|
||||
__test_load_current_collections();
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_update_all", "Update all current collections"), function() {
|
||||
__test_update_current_collections();
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_add_meta", "Add metadata to current collections"), function() {
|
||||
__test_metadata_current_collections();
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_update_sam", "Update sample projects"), function() {
|
||||
__test_update_sample_projects();
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_load_all", "Load all current collections"), function() /*=>*/ { __test_load_current_collections(); }),
|
||||
menuItem(__txtx("panel_menu_test_update_all", "Update all current collections"), function() /*=>*/ { __test_update_current_collections(); }),
|
||||
menuItem(__txtx("panel_menu_test_add_meta", "Add metadata to current collections"), function() /*=>*/ { __test_metadata_current_collections(); }),
|
||||
menuItem(__txtx("panel_menu_test_update_sam", "Update sample projects"), function() /*=>*/ { __test_update_sample_projects(); }),
|
||||
-1,
|
||||
menuItem(__txtx("panel_menu_test_load_nodes", "Load all nodes"), function() {
|
||||
__test_load_all_nodes();
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_gen_guide", "Generate node guide"), function() {
|
||||
var dia = dialogPanelCall(new Panel_Node_Data_Gen());
|
||||
dia.destroy_on_click_out = false;
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_gen_theme", "Generate theme object"), function() {
|
||||
__test_generate_theme();
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_load_nodes", "Load all nodes"), function() /*=>*/ { __test_load_all_nodes(); }),
|
||||
menuItem(__txtx("panel_menu_test_gen_guide", "Generate node guide"), function() /*=>*/ { var dia = dialogPanelCall(new Panel_Node_Data_Gen()); dia.destroy_on_click_out = false; }),
|
||||
menuItem(__txtx("panel_menu_test_gen_theme", "Generate theme object"), function() /*=>*/ { __test_generate_theme(); }),
|
||||
-1,
|
||||
menuItem(__txtx("panel_menu_test_warning", "Display Warning"), function() {
|
||||
noti_warning("Error message")
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_error", "Display Error"), function() {
|
||||
noti_error("Error message")
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_crash", "Force crash"), function() {
|
||||
print(1 + "a");
|
||||
}),
|
||||
menuItem(__txtx("panel_menu_test_warning", "Display Warning"), function() /*=>*/ { noti_warning("Error message") }),
|
||||
menuItem(__txtx("panel_menu_test_error", "Display Error"), function() /*=>*/ { noti_error("Error message") }),
|
||||
menuItem(__txtx("panel_menu_test_crash", "Force crash"), function() /*=>*/ { print(1 + "a"); }),
|
||||
-1,
|
||||
menuItem(__txt("Misc."), function(_dat) {
|
||||
return submenuCall(_dat, [
|
||||
menuItem(__txtx("panel_menu_node_credit", "Node credit dialog"), function() { var dia = dialogPanelCall(new Panel_Node_Cost()); }),
|
||||
menuItem(__txtx("panel_menu_node_credit", "Node credit dialog"), function() /*=>*/ { var dia = dialogPanelCall(new Panel_Node_Cost()); }),
|
||||
]);
|
||||
} ).setIsShelf(),
|
||||
]]);
|
||||
|
@ -286,9 +261,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
|
||||
menu_help_steam = array_clone(menu_help);
|
||||
array_push(menu_help_steam, -1,
|
||||
menuItem(__txtx("panel_menu_steam_workshop", "Steam Workshop"), function() {
|
||||
steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/");
|
||||
}, THEME.steam) );
|
||||
menuItem(__txtx("panel_menu_steam_workshop", "Steam Workshop"), function() /*=>*/ { steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/"); }, THEME.steam) );
|
||||
|
||||
function onFocusBegin() { PANEL_MENU = self; }
|
||||
|
||||
|
@ -310,8 +283,8 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
txt = $"{__txt("Undo")} {act[0]}";
|
||||
}
|
||||
|
||||
menus[1][1][0].active = !ds_stack_empty(UNDO_STACK);
|
||||
menus[1][1][0].name = txt;
|
||||
menuItem_undo.active = !ds_stack_empty(UNDO_STACK);
|
||||
menuItem_undo.name = txt;
|
||||
|
||||
if(ds_stack_empty(REDO_STACK)) {
|
||||
txt = __txt("Redo");
|
||||
|
@ -323,8 +296,8 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
txt = $"{__txt("Redo")} {act[0]}";
|
||||
}
|
||||
|
||||
menus[1][1][1].active = !ds_stack_empty(REDO_STACK);
|
||||
menus[1][1][1].name = txt;
|
||||
menuItem_redo.active = !ds_stack_empty(REDO_STACK);
|
||||
menuItem_redo.name = txt;
|
||||
} #endregion
|
||||
|
||||
function drawContent(panel) { #region
|
||||
|
@ -404,8 +377,11 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
var _ww = 0;
|
||||
|
||||
for(var i = 0; i < array_length(menus); i++) {
|
||||
var _menu = menus[i];
|
||||
var _name = _menu[0];
|
||||
|
||||
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
|
||||
var ww = string_width(menus[i][0]) + ui(16);
|
||||
var ww = string_width(_name) + ui(16);
|
||||
var hh = line_get_height() + ui(8);
|
||||
|
||||
if(hori) {
|
||||
|
@ -433,13 +409,13 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
draw_sprite_stretched(THEME.menu_button, 0, x0, y0, x1 - x0, y1 - y0);
|
||||
|
||||
if((mouse_press(mb_left, pFOCUS)) || instance_exists(o_dialog_menubox)) {
|
||||
if(hori) menuCall("main_" + menus[i][0] + "_menu", x + x0, y + y1, menus[i][1]);
|
||||
else menuCall("main_" + menus[i][0] + "_menu", x + x1, y + y0, menus[i][1]);
|
||||
if(hori) menuCall($"main_{_name}_menu", x + x0, y + y1, _menu[1]);
|
||||
else menuCall($"main_{_name}_menu", x + x1, y + y0, _menu[1]);
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
|
||||
draw_text_add(xc, yc, menus[i][0]);
|
||||
draw_text_add(xc, yc, _name);
|
||||
|
||||
if(hori) {
|
||||
xx += ww + 8;
|
||||
|
@ -552,7 +528,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
|
||||
switch(action) {
|
||||
case "exit":
|
||||
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, pHOVER,, THEME.window_exit, 0, COLORS._main_accent);
|
||||
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], true, pHOVER,, THEME.window_exit, 0, COLORS._main_accent);
|
||||
if(b) _draggable = false;
|
||||
if(b == 2) window_close();
|
||||
break;
|
||||
|
@ -561,7 +537,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
if(OS == os_macosx)
|
||||
win_max = __win_is_maximized;
|
||||
|
||||
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, 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], true, pHOVER,, THEME.window_maximize, win_max, [ COLORS._main_icon, CDEF.lime ]);
|
||||
if(b) _draggable = false;
|
||||
if(b == 2) {
|
||||
if(OS == os_windows) {
|
||||
|
@ -582,7 +558,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
}
|
||||
break;
|
||||
case "minimize":
|
||||
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, 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], true, pHOVER,, THEME.window_minimize, 0, [ COLORS._main_icon, CDEF.yellow ]);
|
||||
if(b) _draggable = false;
|
||||
if(b == -2) {
|
||||
if(OS == os_windows)
|
||||
|
@ -593,7 +569,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
break;
|
||||
case "fullscreen":
|
||||
var win_full = window_is_fullscreen;
|
||||
var b = buttonInstant(THEME.button_hide_fill, x1 - bs, ui(6), bs, bs, [mx, my], pFOCUS, 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], true, pHOVER,, THEME.window_fullscreen, win_full, [ COLORS._main_icon, CDEF.cyan ]);
|
||||
if(b) _draggable = false;
|
||||
if(b == 2) {
|
||||
if(OS == os_windows)
|
||||
|
|
|
@ -7,6 +7,8 @@ function shellOpenExplorer(path) { #region
|
|||
path = string_replace_all(path, "\\", "/");
|
||||
var res = shell_execute_async("open", path);
|
||||
}
|
||||
|
||||
return 0;
|
||||
} #endregion
|
||||
|
||||
function shell_execute(path, command, ref = noone) { #region
|
||||
|
|
Loading…
Reference in a new issue