]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
#includes: cleanup menu
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 10 Oct 2015 03:24:19 +0000 (14:24 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 10 Oct 2015 03:24:19 +0000 (14:24 +1100)
13 files changed:
qcsrc/menu/_all.qh
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/gamesettings.qh
qcsrc/menu/item/modalcontroller.qc
qcsrc/menu/item/slider.qc
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/cvarlist.qc
qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc
qcsrc/menu/xonotic/mainwindow.qc
qcsrc/menu/xonotic/screenshotlist.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/soundlist.qc
qcsrc/menu/xonotic/util.qc

index 7834cdb842f50b94ac5adf9527b750e31f5ab41b..0c4f926dd95c7bf76107bd2eeb972c7a17230788 100644 (file)
@@ -1,4 +1,7 @@
-#ifndef CLIENT_ALL_H
-#define CLIENT_ALL_H
+#ifndef MENU_ALL_H
+#define MENU_ALL_H
+
+#include "draw.qh"
+#include "xonotic/util.qh"
 
 #endif
index 8b12a7b7ddbe6289b0f722ed661ab468a954a9ea..179dc1949bad8c371ab1c0c2c901d6b6befbbb20 100644 (file)
@@ -81,7 +81,7 @@ void GameCommand(string theCommand)
                        entity e;
                        string s;
 
-                       for(i = 0, e = world; (e = nextent(e)); )
+                       for(i = 0, e = NULL; (e = nextent(e)); )
                                if(e.classname != "vtbl" && e.name != "")
                                {
                                        s = e.name;
index 7c7dc70db94987fd0a9ec17da3cffec0f9333713..cf0916ce9c6168cba438831b1a2bbc2641e564d1 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef GAMESETTINGS_H
 #define GAMESETTINGS_H
 
+#include "xonotic/tab.qc"
+
 REGISTRY(Settings, BIT(3))
 REGISTER_REGISTRY(RegisterSettings)
 #define REGISTER_SETTINGS(id, impl) \
index 8232125f750b69d7d3689e54eada9f7c830d7fdc..046d8e1942a18f72f80e3f935a396baa0cdb2264 100644 (file)
@@ -147,7 +147,7 @@ void ModalController_draw(entity me)
        vector fs;
        animating = 0;
 
-       front = world;
+       front = NULL;
        for(e = me.firstChild; e; e = e.nextSibling)
                if(e.ModalController_state)
                {
index 3340e335cb9aebe22d7b305022a52074cd84f123..3bde6565a6b6f16d1b436336479d5e32a091d510 100644 (file)
@@ -26,7 +26,7 @@ CLASS(Slider, Label)
        ATTRIB(Slider, value, float, 0)
        ATTRIB(Slider, animated, float, 1)
        ATTRIB(Slider, sliderValue, float, 0)
-       ATTRIB(Slider, sliderAnim, entity, world)
+       ATTRIB(Slider, sliderAnim, entity, NULL)
        ATTRIB(Slider, valueMin, float, 0)
        ATTRIB(Slider, valueMax, float, 0)
        ATTRIB(Slider, valueStep, float, 0)
@@ -311,7 +311,7 @@ void Slider_draw(entity me)
        if(me.sliderAnim.isFinished(me.sliderAnim))
        {
                anim.removeObjAnim(anim, me);
-               me.sliderAnim = world;
+               me.sliderAnim = NULL;
        }
 
        me.setText(me, me.valueToText(me, me.value));
index 3f6632f4e4663f2f57ab6c16d8088bdd311c80d3..fde2c3c1eb7594125c82cb2cac15eb99ae68284d 100644 (file)
@@ -478,7 +478,7 @@ entity m_findtooltipitem(entity root, vector pos)
        entity it;
        entity best;
 
-       best = world;
+       best = NULL;
        it = root;
 
        while(it.instanceOfContainer)
@@ -495,7 +495,7 @@ entity m_findtooltipitem(entity root, vector pos)
                                best = it;
                        else if(menu_tooltips == 2 && (it.cvarName || it.onClickCommand))
                                best = it;
-                       it = world;
+                       it = NULL;
                }
                else if(it.instanceOfModalController)
                        it = it.focusedChild;
@@ -545,9 +545,9 @@ void m_tooltip(vector pos)
        if (!menu_tooltips)
        {
                // don't return immediately, fade out the active tooltip first
-               if (menuTooltipItem == world)
+               if (menuTooltipItem == NULL)
                        return;
-               it = world;
+               it = NULL;
                menu_tooltips_old = menu_tooltips;
        }
        else
@@ -558,7 +558,7 @@ void m_tooltip(vector pos)
                if(f < 0.01)
                        it = m_findtooltipitem(main, pos);
                else
-                       it = world;
+                       it = NULL;
        }
        fontsize = '1 0 0' * (SKINFONTSIZE_TOOLTIP / conwidth) + '0 1 0' * (SKINFONTSIZE_TOOLTIP / conheight);
 
@@ -629,12 +629,12 @@ void m_tooltip(vector pos)
                        if(menuTooltipAlpha == 0)
                        {
                                menuTooltipState = 0;
-                               menuTooltipItem = world;
+                               menuTooltipItem = NULL;
                        }
                        break;
        }
 
-       if(menuTooltipItem == world)
+       if(menuTooltipItem == NULL)
        {
                if (menuTooltipText)
                {
@@ -648,7 +648,7 @@ void m_tooltip(vector pos)
                if(menu_tooltips != menu_tooltips_old)
                {
                        if (menu_tooltips != 0 && menu_tooltips_old != 0)
-                               menuTooltipItem = world; // reload tooltip next frame
+                               menuTooltipItem = NULL; // reload tooltip next frame
                        menu_tooltips_old = menu_tooltips;
                }
                else if(menuTooltipOrigin.x < 0) // unallocated?
index 9943731f7b313b6f7410d690606762f569cf30ab..c303615327496e94af5505bc1c7d5b96368af7cb 100644 (file)
@@ -200,7 +200,7 @@ float XonoticCvarList_keyDown(entity me, float scan, float ascii, float shift)
 {
        if (scan == K_MOUSE3 || ((shift & S_CTRL) && scan == K_SPACE))
        {
-               CvarList_Revert_Click(world, me);
+               CvarList_Revert_Click(NULL, me);
                return 1;
        }
        else if(scan == K_ENTER)
index 3cf20b7b5c01bea40b73c08d3b2bffe6fac1fa9b..880dda03258c0cab772312f45474d8642c6a1671 100644 (file)
@@ -98,7 +98,7 @@ float XonoticScreenshotViewerDialog_keyDown(entity me, float key, float ascii, f
                        // to press buttons while browsing with only the keyboard
                        if (shift & S_CTRL)
                        {
-                               toggleSlideShow_Click(world, me);
+                               toggleSlideShow_Click(NULL, me);
                                return 1;
                        }
                        return SUPER(XonoticScreenshotViewerDialog).keyDown(me, key, ascii, shift);
index 244d6b2b206ecf55a047a2223391063341bd4d87..3d41104488085fe1c629fc8980f728a055b921d6 100644 (file)
@@ -32,7 +32,7 @@ void MainWindow_draw(entity me)
 
        if(me.dialogToShow)
        {
-               DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
+               DialogOpenButton_Click_withCoords(NULL, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
                me.dialogToShow = NULL;
        }
 }
index e7693a2e351080f0eaa6e7fba4807c040f2fbc6a..6655e8a62c1bacff3be95b2b0f88846fba30883b 100644 (file)
@@ -208,7 +208,7 @@ void ScreenshotList_Filter_Change(entity box, entity me)
        else
                me.filterString = string_null;
 
-       ScreenshotList_Refresh_Click(world, me);
+       ScreenshotList_Refresh_Click(NULL, me);
 }
 
 void ScreenshotList_Filter_Would_Change(entity box, entity me)
index f49ea947e73bb7dd8601718453a75cd152b3a1f4..e2c6472092fe53d19068e426b1adbcff9a0f279a 100644 (file)
@@ -231,7 +231,7 @@ entity RetrieveCategoryEnt(int catnum)
        else
        {
                error(sprintf("RetrieveCategoryEnt(%d): Improper category number!\n", catnum));
-               return world;
+               return NULL;
        }
 }
 
index 6d283526801ac95de2ae61d99a882832c72d716d..159cd76c53d60a2bfe8c3b3c73c9fea6a74b9679 100644 (file)
@@ -24,7 +24,7 @@ CLASS(XonoticSoundList, XonoticListBox)
        ATTRIB(XonoticSoundList, itemAbsSize, vector, '0 0 0')
 
        ATTRIB(XonoticSoundList, filterString, string, string_null)
-       ATTRIB(XonoticSoundList, playlist, entity, world)
+       ATTRIB(XonoticSoundList, playlist, entity, NULL)
 ENDCLASS(XonoticSoundList)
 
 entity makeXonoticSoundList();
index 3ef0213966933ea073240aac8d4f75a5786a5b3a..157a9199cbe2dcfed876764332dbdb699020ceb4 100644 (file)
@@ -1,4 +1,7 @@
 #include "util.qh"
+
+#include "../item.qc"
+
 #include "../menu.qh"
 #include "../../common/campaign_common.qh"
 #include "../../common/constants.qh"