From: TimePath Date: Sat, 10 Oct 2015 03:24:19 +0000 (+1100) Subject: #includes: cleanup menu X-Git-Tag: xonotic-v0.8.2~1839^2~4 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=b9b32643554806fb5f901f9bd48ecfcc43fd98b8;hp=f40d50ebdbbfc5c65f0e75cdfa3bd176501e8d4a #includes: cleanup menu --- diff --git a/qcsrc/menu/_all.qh b/qcsrc/menu/_all.qh index 7834cdb84..0c4f926dd 100644 --- a/qcsrc/menu/_all.qh +++ b/qcsrc/menu/_all.qh @@ -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 diff --git a/qcsrc/menu/command/menu_cmd.qc b/qcsrc/menu/command/menu_cmd.qc index 8b12a7b7d..179dc1949 100644 --- a/qcsrc/menu/command/menu_cmd.qc +++ b/qcsrc/menu/command/menu_cmd.qc @@ -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; diff --git a/qcsrc/menu/gamesettings.qh b/qcsrc/menu/gamesettings.qh index 7c7dc70db..cf0916ce9 100644 --- a/qcsrc/menu/gamesettings.qh +++ b/qcsrc/menu/gamesettings.qh @@ -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) \ diff --git a/qcsrc/menu/item/modalcontroller.qc b/qcsrc/menu/item/modalcontroller.qc index 8232125f7..046d8e194 100644 --- a/qcsrc/menu/item/modalcontroller.qc +++ b/qcsrc/menu/item/modalcontroller.qc @@ -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) { diff --git a/qcsrc/menu/item/slider.qc b/qcsrc/menu/item/slider.qc index 3340e335c..3bde6565a 100644 --- a/qcsrc/menu/item/slider.qc +++ b/qcsrc/menu/item/slider.qc @@ -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)); diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 3f6632f4e..fde2c3c1e 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -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? diff --git a/qcsrc/menu/xonotic/cvarlist.qc b/qcsrc/menu/xonotic/cvarlist.qc index 9943731f7..c30361532 100644 --- a/qcsrc/menu/xonotic/cvarlist.qc +++ b/qcsrc/menu/xonotic/cvarlist.qc @@ -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) diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc index 3cf20b7b5..880dda032 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc @@ -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); diff --git a/qcsrc/menu/xonotic/mainwindow.qc b/qcsrc/menu/xonotic/mainwindow.qc index 244d6b2b2..3d4110448 100644 --- a/qcsrc/menu/xonotic/mainwindow.qc +++ b/qcsrc/menu/xonotic/mainwindow.qc @@ -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; } } diff --git a/qcsrc/menu/xonotic/screenshotlist.qc b/qcsrc/menu/xonotic/screenshotlist.qc index e7693a2e3..6655e8a62 100644 --- a/qcsrc/menu/xonotic/screenshotlist.qc +++ b/qcsrc/menu/xonotic/screenshotlist.qc @@ -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) diff --git a/qcsrc/menu/xonotic/serverlist.qc b/qcsrc/menu/xonotic/serverlist.qc index f49ea947e..e2c647209 100644 --- a/qcsrc/menu/xonotic/serverlist.qc +++ b/qcsrc/menu/xonotic/serverlist.qc @@ -231,7 +231,7 @@ entity RetrieveCategoryEnt(int catnum) else { error(sprintf("RetrieveCategoryEnt(%d): Improper category number!\n", catnum)); - return world; + return NULL; } } diff --git a/qcsrc/menu/xonotic/soundlist.qc b/qcsrc/menu/xonotic/soundlist.qc index 6d2835268..159cd76c5 100644 --- a/qcsrc/menu/xonotic/soundlist.qc +++ b/qcsrc/menu/xonotic/soundlist.qc @@ -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(); diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 3ef021396..157a9199c 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -1,4 +1,7 @@ #include "util.qh" + +#include "../item.qc" + #include "../menu.qh" #include "../../common/campaign_common.qh" #include "../../common/constants.qh"