3 entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
11 else if(isInverted < -1)
16 else if(isInverted == 1)
26 return makeXonoticCheckBoxEx_T(y, n, theCvar, theText, theTooltip);
28 entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
30 return makeXonoticCheckBox_T(isInverted, theCvar, theText, string_null);
33 entity makeXonoticCheckBoxEx_T(float theYesValue, float theNoValue, string theCvar, string theText, string theTooltip)
36 me = NEW(XonoticCheckBox);
37 me.configureXonoticCheckBox(me, theYesValue, theNoValue, theCvar, theText, theTooltip);
40 entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
42 return makeXonoticCheckBoxEx_T(theYesValue, theNoValue, theCvar, theText, string_null);
45 void XonoticCheckBox_configureXonoticCheckBox(entity me, float theYesValue, float theNoValue, string theCvar, string theText, string theTooltip)
47 me.yesValue = theYesValue;
48 me.noValue = theNoValue;
50 me.cvarName = (theCvar) ? theCvar : string_null;
52 setZonedTooltip(me, theTooltip, theCvar);
53 me.configureCheckBox(me, theText, me.fontSize, me.image);
55 void XonoticCheckBox_setChecked(entity me, float val)
63 void XonoticCheckBox_loadCvars(entity me)
70 m = (me.yesValue + me.noValue) * 0.5;
71 d = (cvar(me.cvarName) - m) / (me.yesValue - m);
74 void XonoticCheckBox_saveCvars(entity me)
80 cvar_set(me.cvarName, ftos_mindecimals(me.yesValue));
82 cvar_set(me.cvarName, ftos_mindecimals(me.noValue));
84 CheckSendCvars(me, me.cvarName);