From: terencehill Date: Sat, 2 Apr 2022 12:42:46 +0000 (+0200) Subject: In the Game menu dialog on Quit press show the confirmation dialog in order to avoid... X-Git-Tag: xonotic-v0.8.5~109^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a18993a0890031b7e3a0f1b943ac8d373fb4b59c;p=xonotic%2Fxonotic-data.pk3dir.git In the Game menu dialog on Quit press show the confirmation dialog in order to avoid quitting the game by mistake. Restore the old Quit dialog without the Leave match button, no longer needed since it's present in the Game menu dialog. --- diff --git a/qcsrc/menu/xonotic/dialog_gamemenu.qc b/qcsrc/menu/xonotic/dialog_gamemenu.qc index 6374f370a..6ab4973cc 100644 --- a/qcsrc/menu/xonotic/dialog_gamemenu.qc +++ b/qcsrc/menu/xonotic/dialog_gamemenu.qc @@ -42,5 +42,5 @@ void XonoticGameMenuDialog_fill(entity me) me.TD(me, 1, 1, e = makeXonoticLeaveMatchButton('0 0 0', COMMANDBUTTON_CLOSE)); me.TR(me); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quit Xonotic"), '1 0 0', "echo ]quit; quit", 0)); + me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quit"), '1 0 0', "menu_showquitdialog", 0)); } diff --git a/qcsrc/menu/xonotic/dialog_quit.qc b/qcsrc/menu/xonotic/dialog_quit.qc index 89bfae806..f4cf02ae2 100644 --- a/qcsrc/menu/xonotic/dialog_quit.qc +++ b/qcsrc/menu/xonotic/dialog_quit.qc @@ -9,12 +9,11 @@ void XonoticQuitDialog_fill(entity me) { entity e; me.TR(me); - me.TDempty(me, 0.5); - me.TD(me, 1, 1, e = makeXonoticLeaveMatchButton('0 0 0', COMMANDBUTTON_CLOSE)); + me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to quit?"))); me.TR(me); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quit Xonotic"), '1 0 0', "echo ]quit; quit", 0)); - me.TD(me, 1, 1, e = makeXonoticButton(_("Cancel"), '0 1 0')); + me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Yes"), '1 0 0', "echo ]quit; quit", 0)); + me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0')); e.onClick = Dialog_Close; e.onClickEntity = me; } diff --git a/qcsrc/menu/xonotic/dialog_quit.qh b/qcsrc/menu/xonotic/dialog_quit.qh index ddf89e3a7..6e8c9fea9 100644 --- a/qcsrc/menu/xonotic/dialog_quit.qh +++ b/qcsrc/menu/xonotic/dialog_quit.qh @@ -3,8 +3,8 @@ #include "dialog.qh" CLASS(XonoticQuitDialog, XonoticDialog) METHOD(XonoticQuitDialog, fill, void(entity)); - ATTRIB(XonoticQuitDialog, title, string, _("Quit / Leave match")); - ATTRIB(XonoticQuitDialog, tooltip, string, _("Quit the game / Leave current match")); + ATTRIB(XonoticQuitDialog, title, string, _("Quit")); + ATTRIB(XonoticQuitDialog, tooltip, string, _("Quit the game")); ATTRIB(XonoticQuitDialog, color, vector, SKINCOLOR_DIALOG_QUIT); ATTRIB(XonoticQuitDialog, intendedWidth, float, 0.5); ATTRIB(XonoticQuitDialog, rows, float, 3); diff --git a/qcsrc/menu/xonotic/keybinder.qc b/qcsrc/menu/xonotic/keybinder.qc index d1bc88c46..c76af8cee 100644 --- a/qcsrc/menu/xonotic/keybinder.qc +++ b/qcsrc/menu/xonotic/keybinder.qc @@ -106,7 +106,7 @@ void KeyBinds_BuildList() KEYBIND_DEF("toggleconsole" , _("enter console")); string console_shortcut = strcat(translate_key("SHIFT"), "+", translate_key("ESCAPE")); KEYBIND_SPECIAL_DEF(console_shortcut, _("enter console")); - KEYBIND_DEF("menu_showquitdialog" , _("quit / leave match")); + KEYBIND_DEF("menu_showquitdialog" , _("quit")); KEYBIND_EMPTY_LINE(); KEYBIND_HEADER(_("Teamplay"));