]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename quitbutton.qc/qh files to leavematchbutton.qc/qh
authorterencehill <piuntn@gmail.com>
Sun, 6 Jun 2021 10:19:58 +0000 (12:19 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 6 Jun 2021 10:19:58 +0000 (12:19 +0200)
qcsrc/menu/xonotic/_mod.inc
qcsrc/menu/xonotic/_mod.qh
qcsrc/menu/xonotic/dialog_multiplayer_create.qc
qcsrc/menu/xonotic/dialog_multiplayer_join.qc
qcsrc/menu/xonotic/dialog_quit.qc
qcsrc/menu/xonotic/dialog_singleplayer.qc
qcsrc/menu/xonotic/leavematchbutton.qc [new file with mode: 0644]
qcsrc/menu/xonotic/leavematchbutton.qh [new file with mode: 0644]
qcsrc/menu/xonotic/quitbutton.qc [deleted file]
qcsrc/menu/xonotic/quitbutton.qh [deleted file]

index 8d37e048624d02621e96071bff9f0c66c5fc927d..88d0c2abd13bfa9028fe0e8deba451ea25c37755 100644 (file)
@@ -96,7 +96,7 @@
 #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>
index 7982295e90387480b66d83dcd4d3d9111096fed6..8a2fb97cacf2ccf3f39499a4cca0e1c1f61c4118 100644 (file)
@@ -96,7 +96,7 @@
 #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>
index 7ca58a07af769afff4d67d6ed5ca85b499a5309f..999912d665a3898a7b8fe68fddd8bf250edf8ba2 100644 (file)
@@ -14,7 +14,7 @@
 #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)
index 9f05d0c2a1ed91e9a479435d275264beaf979377..68f2cc45cbe44629d561bff205aac7114bf8ff13 100644 (file)
@@ -6,7 +6,7 @@
 #include "inputbox.qh"
 #include "checkbox.qh"
 #include "commandbutton.qh"
-#include "quitbutton.qh"
+#include "leavematchbutton.qh"
 #include "button.qh"
 
 entity makeXonoticServerListTab()
index fcf937c6bf5ef313bf77102ec4ca1a50b2cd6ce7..2f3f15b52665ba8b1fe852cdc5238db2503cf0a4 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "textlabel.qh"
 #include "commandbutton.qh"
-#include "quitbutton.qh"
+#include "leavematchbutton.qh"
 #include "button.qh"
 
 void XonoticQuitDialog_fill(entity me)
index e310e69d2559a14d57c9ea6add70ed41245003e5..1650004f45daaf147abdc9b6ce7a1e678fdbc6b4 100644 (file)
@@ -3,7 +3,7 @@
 #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"
diff --git a/qcsrc/menu/xonotic/leavematchbutton.qc b/qcsrc/menu/xonotic/leavematchbutton.qc
new file mode 100644 (file)
index 0000000..cda1c82
--- /dev/null
@@ -0,0 +1,53 @@
+#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;
+}
diff --git a/qcsrc/menu/xonotic/leavematchbutton.qh b/qcsrc/menu/xonotic/leavematchbutton.qh
new file mode 100644 (file)
index 0000000..f23e9dc
--- /dev/null
@@ -0,0 +1,9 @@
+#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);
diff --git a/qcsrc/menu/xonotic/quitbutton.qc b/qcsrc/menu/xonotic/quitbutton.qc
deleted file mode 100644 (file)
index 0e535cf..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#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;
-}
diff --git a/qcsrc/menu/xonotic/quitbutton.qh b/qcsrc/menu/xonotic/quitbutton.qh
deleted file mode 100644 (file)
index f23e9dc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#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);