X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fcheckbox_string.qc;h=a93c9acf5d666a56611e30b01eb5b8f7acb4b322;hb=1ab266594766ef637911e9962e1d6b3b4c1f513a;hp=aeda757f0e83718cbca511cace58aa2c9fc04d85;hpb=d99a102842ced06e6e1a0c9358c07c3b64523968;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/checkbox_string.qc b/qcsrc/menu/xonotic/checkbox_string.qc index aeda757f0..a93c9acf5 100644 --- a/qcsrc/menu/xonotic/checkbox_string.qc +++ b/qcsrc/menu/xonotic/checkbox_string.qc @@ -1,7 +1,9 @@ -#ifdef INTERFACE -CLASS(XonoticCheckBoxString) EXTENDS(CheckBox) - METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string)) - METHOD(XonoticCheckBoxString, setChecked, void(entity, float)) +#ifndef CHECKBOX_STRING_H +#define CHECKBOX_STRING_H +#include "../item/checkbox.qc" +CLASS(XonoticCheckBoxString, 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) @@ -13,8 +15,8 @@ CLASS(XonoticCheckBoxString) EXTENDS(CheckBox) ATTRIB(XonoticCheckBoxString, colorD, vector, SKINCOLOR_CHECKBOX_D) ATTRIB(XonoticCheckBoxString, cvarName, string, string_null) - METHOD(XonoticCheckBoxString, loadCvars, void(entity)) - METHOD(XonoticCheckBoxString, saveCvars, void(entity)) + METHOD(XonoticCheckBoxString, loadCvars, void(entity)); + METHOD(XonoticCheckBoxString, saveCvars, void(entity)); ATTRIB(XonoticCheckBoxString, sendCvars, float, 0) ATTRIB(XonoticCheckBoxString, alpha, float, SKINALPHA_TEXT) @@ -27,7 +29,7 @@ entity makeXonoticCheckBoxString(string, string, string, string); 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 +38,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)