]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/checkbox_string.qc
Merge branch 'master' into terencehill/translated_keys
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / checkbox_string.qc
index aeda757f0e83718cbca511cace58aa2c9fc04d85..99db16e35bd483bb6e4136a2d017cd2d4e003065 100644 (file)
@@ -1,33 +1,9 @@
-#ifdef INTERFACE
-CLASS(XonoticCheckBoxString) EXTENDS(CheckBox)
-       METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string))
-       METHOD(XonoticCheckBoxString, setChecked, void(entity, float))
-       ATTRIB(XonoticCheckBoxString, fontSize, float, SKINFONTSIZE_NORMAL)
-       ATTRIB(XonoticCheckBoxString, image, string, SKINGFX_CHECKBOX)
-       ATTRIB(XonoticCheckBoxString, yesString, string, string_null)
-       ATTRIB(XonoticCheckBoxString, noString, string, string_null)
+#include "checkbox_string.qh"
 
-       ATTRIB(XonoticCheckBoxString, color, vector, SKINCOLOR_CHECKBOX_N)
-       ATTRIB(XonoticCheckBoxString, colorC, vector, SKINCOLOR_CHECKBOX_C)
-       ATTRIB(XonoticCheckBoxString, colorF, vector, SKINCOLOR_CHECKBOX_F)
-       ATTRIB(XonoticCheckBoxString, colorD, vector, SKINCOLOR_CHECKBOX_D)
-
-       ATTRIB(XonoticCheckBoxString, cvarName, string, string_null)
-       METHOD(XonoticCheckBoxString, loadCvars, void(entity))
-       METHOD(XonoticCheckBoxString, saveCvars, void(entity))
-       ATTRIB(XonoticCheckBoxString, sendCvars, float, 0)
-
-       ATTRIB(XonoticCheckBoxString, alpha, float, SKINALPHA_TEXT)
-       ATTRIB(XonoticCheckBoxString, disabledAlpha, float, SKINALPHA_DISABLED)
-ENDCLASS(XonoticCheckBoxString)
-entity makeXonoticCheckBoxString(string, string, string, string);
-#endif
-
-#ifdef IMPLEMENTATION
 entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
 {
        entity me;
-       me = spawnXonoticCheckBoxString();
+       me = NEW(XonoticCheckBoxString);
        me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
        return me;
 }
@@ -36,12 +12,8 @@ void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theY
        me.yesString = theYesValue;
        me.noString = theNoValue;
        me.checked = 0;
-       if(theCvar)
-       {
-               me.cvarName = theCvar;
-               me.tooltip = getZonedTooltipForIdentifier(theCvar);
-               me.loadCvars(me);
-       }
+       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.loadCvars(me);
        me.configureCheckBox(me, theText, me.fontSize, me.image);
 }
 void XonoticCheckBoxString_setChecked(entity me, float foo)
@@ -69,4 +41,3 @@ void XonoticCheckBoxString_saveCvars(entity me)
 
        CheckSendCvars(me, me.cvarName);
 }
-#endif