From 803bb1f7a6849bd8b662d2f968c1297beb46ffce Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 6 Jun 2021 12:22:47 +0200 Subject: [PATCH] Use "leave" instead of "quit" in the menu where appropriate; the "Quit" dialogue is now called "Quit / Leave match" --- qcsrc/menu/menu.qc | 2 +- .../menu/xonotic/dialog_multiplayer_create.qc | 4 +- qcsrc/menu/xonotic/dialog_multiplayer_join.qc | 4 +- qcsrc/menu/xonotic/dialog_quit.qc | 2 +- qcsrc/menu/xonotic/dialog_quit.qh | 4 +- qcsrc/menu/xonotic/dialog_singleplayer.qc | 4 +- qcsrc/menu/xonotic/keybinder.qc | 2 +- qcsrc/menu/xonotic/leavematchbutton.qc | 40 +++++++++---------- qcsrc/menu/xonotic/leavematchbutton.qh | 10 ++--- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 8a00d713f..f374b0a10 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -685,7 +685,7 @@ void m_draw(float width, float height) { // in the case player uses the disconnect command (in the console or with a key) // reset g_campaign and update menu items to reflect cvar values that may have been restored after quiting the campaign - // see also QUITGAME_CMD + // see also LEAVEMATCH_CMD cvar_set("g_campaign", "0"); m_sync(); } diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create.qc b/qcsrc/menu/xonotic/dialog_multiplayer_create.qc index 999912d66..a72fd1b0c 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create.qc @@ -66,7 +66,7 @@ entity makeXonoticServerCreateTab() return me; } -.entity quitGameButton; +.entity leaveMatchButton; void XonoticServerCreateTab_fill(entity me) { @@ -211,7 +211,7 @@ void XonoticServerCreateTab_fill(entity me) // bottom row me.gotoRC(me, me.rows - 1, 0); me.TDempty(me, me.columns * 1/12); - me.TD(me, 1, me.columns * 5/12, me.quitGameButton = makeXonoticQuitButton('0 0 0', 0)); + me.TD(me, 1, me.columns * 5/12, me.leaveMatchButton = makeXonoticLeaveMatchButton('0 0 0', 0)); me.TD(me, 1, me.columns * 5/12, e = makeXonoticButton(_("Start multiplayer!"), '0 0 0')); e.onClick = MapList_LoadMap; e.onClickEntity = me.mapListBox; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join.qc b/qcsrc/menu/xonotic/dialog_multiplayer_join.qc index 68f2cc45c..e826cd9c4 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join.qc @@ -23,7 +23,7 @@ void XonoticServerListTab_refresh(entity this, entity slist) slist.refreshServerList(slist, clear ? REFRESHSERVERLIST_RESET : REFRESHSERVERLIST_ASK); } -.entity quitGameButton; +.entity leaveMatchButton; void XonoticServerListTab_fill(entity me) { @@ -92,7 +92,7 @@ void XonoticServerListTab_fill(entity me) e.onClickEntity = slist; slist.infoButton = e; me.TR(me); - me.TD(me, 1, me.columns * 0.5, me.quitGameButton = makeXonoticQuitButton('0 0 0', 0)); + me.TD(me, 1, me.columns * 0.5, me.leaveMatchButton = makeXonoticLeaveMatchButton('0 0 0', 0)); me.TD(me, 1, me.columns * 0.5, e = makeXonoticButton(_("Join!"), '0 0 0')); e.onClick = ServerList_Connect_Click; e.onClickEntity = slist; diff --git a/qcsrc/menu/xonotic/dialog_quit.qc b/qcsrc/menu/xonotic/dialog_quit.qc index 2f3f15b52..8cc751621 100644 --- a/qcsrc/menu/xonotic/dialog_quit.qc +++ b/qcsrc/menu/xonotic/dialog_quit.qc @@ -10,7 +10,7 @@ void XonoticQuitDialog_fill(entity me) entity e; me.TR(me); me.TDempty(me, 0.5); - me.TD(me, 1, 1, me.disconnectButton = makeXonoticQuitButton('0 0 0', COMMANDBUTTON_CLOSE)); + me.TD(me, 1, 1, me.disconnectButton = 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)); diff --git a/qcsrc/menu/xonotic/dialog_quit.qh b/qcsrc/menu/xonotic/dialog_quit.qh index 59b4752ac..7348a24c8 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")); - ATTRIB(XonoticQuitDialog, tooltip, string, _("Quit the game")); + ATTRIB(XonoticQuitDialog, title, string, _("Quit / Leave match")); + ATTRIB(XonoticQuitDialog, tooltip, string, _("Quit the game / Leave current match")); ATTRIB(XonoticQuitDialog, color, vector, SKINCOLOR_DIALOG_QUIT); ATTRIB(XonoticQuitDialog, intendedWidth, float, 0.5); ATTRIB(XonoticQuitDialog, rows, float, 3); diff --git a/qcsrc/menu/xonotic/dialog_singleplayer.qc b/qcsrc/menu/xonotic/dialog_singleplayer.qc index 1650004f4..686c0bfcb 100644 --- a/qcsrc/menu/xonotic/dialog_singleplayer.qc +++ b/qcsrc/menu/xonotic/dialog_singleplayer.qc @@ -140,7 +140,7 @@ void InstantAction_LoadMap(entity btn, entity dummy) cvar_set("lastlevel", "1"); } -.entity quitGameButton; +.entity leaveMatchButton; void XonoticSingleplayerDialog_fill(entity me) { @@ -174,7 +174,7 @@ void XonoticSingleplayerDialog_fill(entity me) me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "g_campaign_skill", "2", ZCTX(_("CSKL^Hard")))); me.TR(me); me.TDempty(me, me.columns * 1/13); - me.TD(me, 1, me.columns * 5/13, me.quitGameButton = makeXonoticQuitButton('0 0 0', 0)); + me.TD(me, 1, me.columns * 5/13, me.leaveMatchButton = makeXonoticLeaveMatchButton('0 0 0', 0)); me.TDempty(me, me.columns * 1/13); me.TD(me, 1, me.columns * 5/13, e = makeXonoticButton(_("Play campaign!"), '0 0 0')); e.onClick = CampaignList_LoadMap; diff --git a/qcsrc/menu/xonotic/keybinder.qc b/qcsrc/menu/xonotic/keybinder.qc index 4eff8b2f7..d1bc88c46 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" , _("disconnect / quit")); + KEYBIND_DEF("menu_showquitdialog" , _("quit / leave match")); KEYBIND_EMPTY_LINE(); KEYBIND_HEADER(_("Teamplay")); diff --git a/qcsrc/menu/xonotic/leavematchbutton.qc b/qcsrc/menu/xonotic/leavematchbutton.qc index cda1c82ff..efaafc120 100644 --- a/qcsrc/menu/xonotic/leavematchbutton.qc +++ b/qcsrc/menu/xonotic/leavematchbutton.qc @@ -2,52 +2,52 @@ // resets g_campaign and updates menu items to reflect cvar values that may have been restored after leaving the campaign // the delay is for allowing listening to the button sound (if enabled), since the disconnect command stops all sounds -// menu_sync is also useful when quitting Instant Action mode +// menu_sync is also useful when leaving Instant Action mode // see also m_draw -const string QUITGAME_CMD = "defer 0.4 disconnect; defer 0.4 wait; defer 0.4 \"g_campaign 0\"; defer 0.4 menu_sync\n"; +const string LEAVEMATCH_CMD = "defer 0.4 disconnect; defer 0.4 wait; defer 0.4 \"g_campaign 0\"; defer 0.4 menu_sync\n"; -string quitGameButton_getText(entity me) +string leaveMatchButton_getText(entity me) { if (me.disabled) - return _("Quit current game"); + return _("Leave current match"); else if(cvar("g_campaign")) - return _("Quit campaign"); + return _("Leave campaign"); else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1") - return _("Quit singleplayer"); + return _("Leave singleplayer"); else - return _("Quit multiplayer"); + return _("Leave multiplayer"); } -string quitGameButton_getTooltip(entity me) +string leaveMatchButton_getTooltip(entity me) { if (me.disabled) return "-"; else if(cvar("g_campaign")) - return _("Quit current campaign level"); + return _("Leave current campaign level"); else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1") - return _("Quit current singleplayer match"); + return _("Leave current singleplayer match"); else - return _("Quit current multiplayer match / Disconnect from the server"); + return _("Leave current multiplayer match / Disconnect from the server"); } -entity makeXonoticQuitButton(vector theColor, int theFlags) +entity makeXonoticLeaveMatchButton(vector theColor, int theFlags) { entity me; - me = NEW(XonoticQuitButton); - me.configureXonoticQuitButton(me, theColor, theFlags); + me = NEW(XonoticLeaveMatchButton); + me.configureXonoticLeaveMatchButton(me, theColor, theFlags); return me; } -void XonoticQuitButton_draw(entity me) +void XonoticLeaveMatchButton_draw(entity me) { SUPER(XonoticCommandButton).draw(me); me.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)); - me.setText(me, quitGameButton_getText(me)); - setZonedTooltip(me, quitGameButton_getTooltip(me), string_null); + me.setText(me, leaveMatchButton_getText(me)); + setZonedTooltip(me, leaveMatchButton_getTooltip(me), string_null); } -void XonoticQuitButton_configureXonoticQuitButton(entity me, vector theColor, int theFlags) +void XonoticLeaveMatchButton_configureXonoticLeaveMatchButton(entity me, vector theColor, int theFlags) { - me.configureXonoticCommandButton(me, string_null, theColor, QUITGAME_CMD, theFlags, string_null); - me.draw = XonoticQuitButton_draw; + me.configureXonoticCommandButton(me, string_null, theColor, LEAVEMATCH_CMD, theFlags, string_null); + me.draw = XonoticLeaveMatchButton_draw; } diff --git a/qcsrc/menu/xonotic/leavematchbutton.qh b/qcsrc/menu/xonotic/leavematchbutton.qh index f23e9dcfb..e1e13cbb9 100644 --- a/qcsrc/menu/xonotic/leavematchbutton.qh +++ b/qcsrc/menu/xonotic/leavematchbutton.qh @@ -1,9 +1,9 @@ #pragma once #include "commandbutton.qh" -CLASS(XonoticQuitButton, XonoticCommandButton) - METHOD(XonoticQuitButton, draw, void(entity)); - METHOD(XonoticQuitButton, configureXonoticQuitButton, void(entity, vector, int)); -ENDCLASS(XonoticQuitButton) +CLASS(XonoticLeaveMatchButton, XonoticCommandButton) + METHOD(XonoticLeaveMatchButton, draw, void(entity)); + METHOD(XonoticLeaveMatchButton, configureXonoticLeaveMatchButton, void(entity, vector, int)); +ENDCLASS(XonoticLeaveMatchButton) -entity makeXonoticQuitButton(vector theColor, int theFlags); +entity makeXonoticLeaveMatchButton(vector theColor, int theFlags); -- 2.39.2