#include <menu/xonotic/playerlist.qc>
#include <menu/xonotic/playermodel.qc>
#include <menu/xonotic/playlist.qc>
-#include <menu/xonotic/quitbutton.qc>
+#include <menu/xonotic/leavematchbutton.qc>
#include <menu/xonotic/radiobutton.qc>
#include <menu/xonotic/rootdialog.qc>
#include <menu/xonotic/screenshotimage.qc>
#include <menu/xonotic/playerlist.qh>
#include <menu/xonotic/playermodel.qh>
#include <menu/xonotic/playlist.qh>
-#include <menu/xonotic/quitbutton.qh>
+#include <menu/xonotic/leavematchbutton.qh>
#include <menu/xonotic/radiobutton.qh>
#include <menu/xonotic/rootdialog.qh>
#include <menu/xonotic/screenshotimage.qh>
#include "mainwindow.qh"
#include "button.qh"
#include "commandbutton.qh"
-#include "quitbutton.qh"
+#include "leavematchbutton.qh"
#include "inputbox.qh"
void GameType_ConfigureSliders(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip)
#include "inputbox.qh"
#include "checkbox.qh"
#include "commandbutton.qh"
-#include "quitbutton.qh"
+#include "leavematchbutton.qh"
#include "button.qh"
entity makeXonoticServerListTab()
#include "textlabel.qh"
#include "commandbutton.qh"
-#include "quitbutton.qh"
+#include "leavematchbutton.qh"
#include "button.qh"
void XonoticQuitDialog_fill(entity me)
#include <common/gamemodes/_mod.qh>
#include "bigbutton.qh"
#include "commandbutton.qh"
-#include "quitbutton.qh"
+#include "leavematchbutton.qh"
#include "radiobutton.qh"
#include "textlabel.qh"
#include "campaign.qh"
--- /dev/null
+#include "leavematchbutton.qh"
+
+// 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
+// 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";
+
+string quitGameButton_getText(entity me)
+{
+ if (me.disabled)
+ return _("Quit current game");
+ else if(cvar("g_campaign"))
+ return _("Quit campaign");
+ else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
+ return _("Quit singleplayer");
+ else
+ return _("Quit multiplayer");
+}
+
+string quitGameButton_getTooltip(entity me)
+{
+ if (me.disabled)
+ return "-";
+ else if(cvar("g_campaign"))
+ return _("Quit current campaign level");
+ else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
+ return _("Quit current singleplayer match");
+ else
+ return _("Quit current multiplayer match / Disconnect from the server");
+}
+
+entity makeXonoticQuitButton(vector theColor, int theFlags)
+{
+ entity me;
+ me = NEW(XonoticQuitButton);
+ me.configureXonoticQuitButton(me, theColor, theFlags);
+ return me;
+}
+
+void XonoticQuitButton_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);
+}
+
+void XonoticQuitButton_configureXonoticQuitButton(entity me, vector theColor, int theFlags)
+{
+ me.configureXonoticCommandButton(me, string_null, theColor, QUITGAME_CMD, theFlags, string_null);
+ me.draw = XonoticQuitButton_draw;
+}
--- /dev/null
+#pragma once
+
+#include "commandbutton.qh"
+CLASS(XonoticQuitButton, XonoticCommandButton)
+ METHOD(XonoticQuitButton, draw, void(entity));
+ METHOD(XonoticQuitButton, configureXonoticQuitButton, void(entity, vector, int));
+ENDCLASS(XonoticQuitButton)
+
+entity makeXonoticQuitButton(vector theColor, int theFlags);
+++ /dev/null
-#include "quitbutton.qh"
-
-// 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
-// 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";
-
-string quitGameButton_getText(entity me)
-{
- if (me.disabled)
- return _("Quit current game");
- else if(cvar("g_campaign"))
- return _("Quit campaign");
- else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
- return _("Quit singleplayer");
- else
- return _("Quit multiplayer");
-}
-
-string quitGameButton_getTooltip(entity me)
-{
- if (me.disabled)
- return "-";
- else if(cvar("g_campaign"))
- return _("Quit current campaign level");
- else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
- return _("Quit current singleplayer match");
- else
- return _("Quit current multiplayer match / Disconnect from the server");
-}
-
-entity makeXonoticQuitButton(vector theColor, int theFlags)
-{
- entity me;
- me = NEW(XonoticQuitButton);
- me.configureXonoticQuitButton(me, theColor, theFlags);
- return me;
-}
-
-void XonoticQuitButton_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);
-}
-
-void XonoticQuitButton_configureXonoticQuitButton(entity me, vector theColor, int theFlags)
-{
- me.configureXonoticCommandButton(me, string_null, theColor, QUITGAME_CMD, theFlags, string_null);
- me.draw = XonoticQuitButton_draw;
-}
+++ /dev/null
-#pragma once
-
-#include "commandbutton.qh"
-CLASS(XonoticQuitButton, XonoticCommandButton)
- METHOD(XonoticQuitButton, draw, void(entity));
- METHOD(XonoticQuitButton, configureXonoticQuitButton, void(entity, vector, int));
-ENDCLASS(XonoticQuitButton)
-
-entity makeXonoticQuitButton(vector theColor, int theFlags);