]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 9d74fbb545940a353de84094e5ffad13a701f80d..5b5911fa9046672dab1bbe5290f448f510c2bcfb 100644 (file)
@@ -1,3 +1,5 @@
+#include "../menu.qh"
+
 #include "../../common/command/commands.qc"
 
 #include "menu_cmd.qc"
index 93825cd56098d73e2ebe53aa0aee97041fcaf03c..3f3f72f5753f61a291966d325f64ea0481d53bd3 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 05e7af227adccb9040870bc7e690e405a7b1d400..2796c05706d0647662ebff6c4dafd88ac5c24b7b 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 a8a3213f2a38584f94aed1b210308568e6aa048f..669e08fe726dbed788ad2cd7e363d4a31e4edb9f 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 33d467c2a08a4caaa302ccf75dfbd3d344a42d6e..020a65a20c318ac1cf8f1bbf5e1625759aa30cc2 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 60b2f8b319849dc8aefd3490425945fac2f2e70f..db1dfcf6ac663166fb0fa1ec261f1c4d19295c78 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 95bc0b28b71d6c485026d73693e0411b13687510..2170a83fcb3a077ab1de50531770b05c73ab756a 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 330b2bb726a0e89ccc19822ee8c8af0182b82e0e..444292712d1a968861d673f960441bd8d7d48347 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 784784f3b12a6ff78f477aec2e2bf1186864d953..e4f387861da3b0bbaae25215c95c29e4c3656ba8 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[@]