Make menu includes order insensitive
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 3 May 2015 23:24:19 +0000 (09:24 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 3 May 2015 23:24:19 +0000 (09:24 +1000)
qcsrc/menu/command/commands.qc
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/draw.qc
qcsrc/menu/menu.qc
qcsrc/menu/menu.qh
qcsrc/menu/oo/base.qh
qcsrc/menu/oo/classes.qc
qcsrc/menu/xonotic/util.qc
qcsrc/test/compilationunit.sh

index 9d74fbb..5b5911f 100644 (file)
@@ -1,3 +1,5 @@
+#include "../menu.qh"
+
 #include "../../common/command/commands.qc"
 
 #include "menu_cmd.qc"
index 93825cd..3f3f72f 100644 (file)
@@ -1,7 +1,12 @@
 #include "menu_cmd.qh"
 
+#include "../menu.qh"
+#include "../oo/classes.qc"
+
 #include "../../common/command/generic.qh"
 
+.entity firstChild, nextSibling;
+
 string _dumptree_space;
 void _dumptree_open(entity pass, entity me)
 {
@@ -29,6 +34,8 @@ void _dumptree_close(entity pass, entity me)
        }
 }
 
+float updateConwidths(float width, float height, float pixelheight);
+
 void GameCommand(string theCommand)
 {
        float argc;
index 05e7af2..2796c05 100644 (file)
@@ -1,7 +1,6 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "draw.qh"
+#include "../common/util.qh"
+#include "../common/constants.qh"
 
 string draw_mousepointer;
 vector draw_mousepointer_offset;
index a8a3213..669e08f 100644 (file)
@@ -1,7 +1,9 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "menu.qh"
+#include "oo/classes.qc"
+#include "xonotic/util.qh"
+
+#include "../common/weapons/weapons.qh"
+#include "../common/mapinfo.qh"
 
 ///////////////////////////////////////////////
 // Menu Source File
index 33d467c..020a65a 100644 (file)
@@ -50,6 +50,8 @@ void postMenuDraw(); // this is run just after the menu is drawn (or not). Usefu
 
 void m_sync();
 
+void draw_reset_cropped();
+
 // sounds
 
 const string MENU_SOUND_CLEAR   = "sound/menu/clear.wav";
index 60b2f8b..db1dfcf 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef BASE_H
 #define BASE_H
 
+#include "../../common/util.qh"
+#include "../../dpdefs/keycodes.qh"
+
 #define NULL (null_entity)
 #define world NULL
 
@@ -28,4 +31,37 @@ entity spawnObject(entity this, entity)
 
 #define NEW(cname) (spawn##cname(null_entity, null_entity))
 
+#define CLASS(cname, base)                                          \
+entity spawn##cname(entity this, entity basevtbl) {                 \
+    this = NEW(base); basevtbl = base##_vtbl;                       \
+}
+
+#define METHOD(cname, name, prototype)                              \
+prototype cname##_##name;                                           \
+.prototype name;                                                    \
+[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
+    this.name = cname##_##name;                                     \
+}
+
+#define ATTRIB(cname, name, type, val)                              \
+.type name;                                                         \
+[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
+    this.name = val;                                                \
+}
+
+#define ATTRIBARRAY(cname, name, type, cnt)                         \
+.type name[cnt];
+
+#define ENDCLASS(cname)                                             \
+.bool instanceOf##cname;                                            \
+entity cname##_vtbl;                                                \
+[[last]] entity spawn##cname(entity this, entity basevtbl) {        \
+    this.instanceOf##cname = true;                                  \
+    this.classname = #cname;                                        \
+    if (!cname##_vtbl) cname##_vtbl = spawnVtbl(this, basevtbl);    \
+    return this;                                                    \
+}
+
+#define SUPER(cname) (cname##_vtbl.vtblbase)
+
 #endif
index 95bc0b2..2170a83 100644 (file)
@@ -1,55 +1,9 @@
+#ifndef CLASSES_H
+#define CLASSES_H
 #include "base.qh"
 
-#ifdef CLASS
-#undef CLASS
-#undef METHOD
-#undef ATTRIB
-#undef ATTRIBARRAY
-#undef ENDCLASS
-#undef SUPER
-#endif
-
-#define CLASS(cname, base)                                          \
-entity spawn##cname(entity this, entity basevtbl) {                 \
-    this = NEW(base); basevtbl = base##_vtbl;                       \
-}
-
-#define METHOD(cname, name, prototype)                              \
-prototype cname##_##name;                                           \
-.prototype name;                                                    \
-[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
-    this.name = cname##_##name;                                     \
-}
-
-#define ATTRIB(cname, name, type, val)                              \
-.type name;                                                         \
-[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {  \
-    this.name = val;                                                \
-}
-
-#define ATTRIBARRAY(cname, name, type, cnt)                         \
-.type name[cnt];
-
-#define ENDCLASS(cname)                                             \
-.bool instanceOf##cname;                                            \
-entity cname##_vtbl;                                                \
-[[last]] entity spawn##cname(entity this, entity basevtbl) {        \
-    this.instanceOf##cname = true;                                  \
-    this.classname = #cname;                                        \
-    if (!cname##_vtbl) cname##_vtbl = spawnVtbl(this, basevtbl);    \
-    return this;                                                    \
-}
-
-#define SUPER(cname) (cname##_vtbl.vtblbase)
-
-#ifdef IMPLEMENTATION
-#undef IMPLEMENTATION
-#endif
-
 #include "../classes.inc"
-
-#ifndef IMPLEMENTATION
 #define IMPLEMENTATION
-#endif
-
 #include "../classes.inc"
+
+#endif
index 330b2bb..4442927 100644 (file)
@@ -1,4 +1,12 @@
+#include "util.qh"
+#include "../menu.qh"
+#include "../oo/base.qh"
+#include "../../common/campaign_common.qh"
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
 #include "../../common/urllib.qh"
+#include "../../common/util.qh"
+#include "../../common/command/generic.qh"
 
 float GL_CheckExtension(string ext)
 {
@@ -43,6 +51,7 @@ string getZonedTooltipForIdentifier(string s)
        return string_null;
 }
 
+.entity parent, firstChild, nextSibling;
 void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass)
 {
        depthfirst(root, parent, firstChild, nextSibling, funcPre, funcPost, pass);
@@ -52,11 +61,15 @@ void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, e
 void SUB_Null_ee(entity e1, entity e2)
 {
 }
+
+.void(entity) saveCvars;
 void saveCvarsOf(entity ignore, entity e)
 {
        if(e.saveCvars)
                e.saveCvars(e);
 }
+
+.void(entity) loadCvars;
 void loadCvarsOf(entity ignore, entity e)
 {
        if(e.loadCvars)
@@ -135,6 +148,7 @@ void makeCallback(entity e, entity cbent, void(entity, entity) cbfunc)
 .string cvarString_setDependent;
 .string cvarValue_setDependent;
 .float(entity) func_setDependent;
+.bool disabled;
 void setDependent_Check(entity e)
 {
        float f;
@@ -181,6 +195,7 @@ void setDependent_Draw(entity e)
        setDependent_Check(e);
        e.draw_setDependent(e);
 }
+.void(entity) draw;
 void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
 {
        e.draw_setDependent = e.draw;
@@ -529,6 +544,8 @@ void postMenuDraw()
                draw_CenterText('0.5 0.1 0', sprintf(_("^1%s TEST BUILD"), autocvar_menu_watermark), globalToBoxSize('32 32 0', draw_scale), '1 1 1', 0.05, 1);
        }
 }
+void DialogOpenButton_Click_withCoords(entity button, entity tab, vector theOrigin, vector theSize);
+.entity winnerDialog;
 void preMenuDraw()
 {
        vector fs, sz = '0 0 0', line, mid;
@@ -709,6 +726,18 @@ string GameType_GetIcon(int cnt)
        return "";
 }
 
+.void(entity) TR;
+.void(entity, float, float, entity) TD;
+.void(entity, float) TDempty;
+entity makeXonoticTextLabel(float theAlign, string theText);
+entity makeXonoticTextSlider(string);
+.void(entity, string, string) addValue;
+.void(entity) configureXonoticTextSliderValues;
+entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar);
+entity makeXonoticCheckBoxString(string, string, string, string);
+entity makeXonoticCheckBox(float, string, string);
+.bool sendCvars;
+
 void dialog_hudpanel_common_notoggle(entity me, string panelname)
 {
        float i;
index 784784f..e4f3878 100755 (executable)
@@ -29,5 +29,5 @@ check "client" clientdefs[@]
 serverdefs=("-DSVQC" "common/util-pre.qh" "server/sys-pre.qh" "dpdefs/progsdefs.qh" "dpdefs/dpextensions.qh" "server/sys-post.qh" "server/defs.qh" "server/autocvars.qh")
 check "server" serverdefs[@]
 
-# menudefs=("-DMENUQC" "common/util-pre.qh" "dpdefs/menudefs.qh" "menu/oo/interface.qc" "menu/oo/implementation.qc")
-check "menu" menudefs[@]
+menudefs=("-DMENUQC" "common/util-pre.qh" "dpdefs/menudefs.qh")
+check "menu" menudefs[@]