ATTRIB(XonoticRadioButton, cvarName, string, string_null)
ATTRIB(XonoticRadioButton, cvarValue, string, string_null)
ATTRIB(XonoticRadioButton, cvarOffValue, string, string_null)
+ ATTRIB(XonoticRadioButton, getCvarValueFromCvar, float, 0)
METHOD(XonoticRadioButton, loadCvars, void(entity))
METHOD(XonoticRadioButton, saveCvars, void(entity))
me.configureXonoticRadioButton(me, theGroup, theCvar, theValue, theText);
return me;
}
-void configureXonoticRadioButtonXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText)
+void XonoticRadioButton_configureXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText)
{
if(theCvar)
{
}
me.configureRadioButton(me, theText, me.fontSize, me.image, theGroup, 0);
}
-void setCheckedXonoticRadioButton(entity me, float val)
+void XonoticRadioButton_setChecked(entity me, float val)
{
if(val != me.checked)
{
me.saveCvars(me);
}
}
-void loadCvarsXonoticRadioButton(entity me)
+void XonoticRadioButton_loadCvars(entity me)
{
if(me.cvarValue)
{
}
}
}
-void drawXonoticRadioButton(entity me)
+void XonoticRadioButton_draw(entity me)
{
if not(me.cvarValue)
if not(me.cvarName)
}
SUPER(XonoticRadioButton).draw(me);
}
-void saveCvarsXonoticRadioButton(entity me)
+void XonoticRadioButton_saveCvars(entity me)
{
if(me.cvarValue)
{
if(me.cvarName)
{
if(me.checked)
- cvar_set(me.cvarName, me.cvarValue);
+ {
+ if(me.getCvarValueFromCvar)
+ cvar_set(me.cvarName, cvar_string(me.cvarValue));
+ else
+ cvar_set(me.cvarName, me.cvarValue);
+ }
else if(me.cvarOffValue)
cvar_set(me.cvarName, me.cvarOffValue);
}