]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/datasource.qh
ATTRIB: overload default value, require semicolon
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / datasource.qh
index 1808b765515d0d81f60e9a3c517ef1ecdbe423be..87c614ab737b31a34d5a2c447693b69679e6a3a7 100644 (file)
@@ -1,12 +1,8 @@
 #pragma once
 
 CLASS(DataSource, Object)
-    entity DataSource_true;
-    entity DataSource_false;
-    INIT_STATIC(DataSource) {
-        DataSource_true = NEW(Object);
-        DataSource_false = NULL;
-    }
+    STATIC_ATTRIB(DataSource, true, entity, NEW(Object));
+    STATIC_ATTRIB(DataSource, false, entity, NULL);
     /**
      * get entry `i` passing `name` and `icon` through `returns` if it is not null
      * returns `DataSource_false` if out of bounds
@@ -23,15 +19,15 @@ ENDCLASS(DataSource)
 
 
 CLASS(StringSource, DataSource)
-    ATTRIB(StringSource, StringSource_str, string, string_null)
-    ATTRIB(StringSource, StringSource_sep, string, string_null)
+    ATTRIB(StringSource, StringSource_str, string);
+    ATTRIB(StringSource, StringSource_sep, string);
     CONSTRUCTOR(StringSource, string str, string sep);
     METHOD(StringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns));
     METHOD(StringSource, reload, int(entity this, string filter));
 ENDCLASS(StringSource)
 
 CLASS(CvarStringSource, StringSource)
-    ATTRIB(CvarStringSource, CvarStringSource_cvar, string, string_null)
+    ATTRIB(CvarStringSource, CvarStringSource_cvar, string);
     CONSTRUCTOR(CvarStringSource, string cv, string sep);
     METHOD(CvarStringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns));
     METHOD(CvarStringSource, reload, int(entity this, string filter));