bind PAUSE pause
bind F9 "cl_cmd hud minigame"
bind F10 menu_showquitdialog
-bind F11 menu_showgamemenudialog
bind F12 screenshot
bind F4 ready
if(override)
return true;
+ if(bInputType == 3 || bInputType == 2)
+ return false;
+
+ // at this point bInputType can only be 0 or 1 (key pressed or released)
+ bool key_pressed = (bInputType == 0);
+
+ if(key_pressed) {
+ if(nPrimary == K_ALT) hudShiftState |= S_ALT;
+ if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
+ if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+ }
+ else {
+ if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
+ if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
+ if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
+ }
+
+ if (nPrimary == K_ESCAPE && !(hudShiftState & S_SHIFT) && key_pressed)
+ {
+ if (cvar("_menu_gamemenu_dialog_available"))
+ {
+ localcmd("\nmenu_showgamemenudialog\n");
+ return true;
+ }
+ }
+
return false;
}
#include "leavematchbutton.qh"
#include "button.qh"
+void XonoticGameMenuDialog_destroy(entity me)
+{
+ cvar_set("_menu_gamemenu_dialog_available", "0");
+}
+
void XonoticGameMenuDialog_fill(entity me)
{
+ registercvar("_menu_gamemenu_dialog_available", "0", 0);
+ cvar_set("_menu_gamemenu_dialog_available", "1");
+
entity e;
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Main menu"), '0 0 0', "menu_cmd nexposee", 0));
#include "rootdialog.qh"
CLASS(XonoticGameMenuDialog, XonoticRootDialog)
+ METHOD(XonoticGameMenuDialog, destroy, void(entity));
METHOD(XonoticGameMenuDialog, fill, void(entity));
ATTRIB(XonoticGameMenuDialog, title, string, _("Game menu"));
ATTRIB(XonoticGameMenuDialog, color, vector, SKINCOLOR_DIALOG_QUIT);
KEYBIND_DEF("+use" , _("drop key/flag, exit vehicle"));
KEYBIND_DEF("kill" , _("suicide / respawn"));
KEYBIND_DEF("quickmenu" , _("quick menu"));
- KEYBIND_DEF("menu_showgamemenudialog" , _("game menu"));
KEYBIND_EMPTY_LINE();
KEYBIND_HEADER(_("User defined"));