-#ifdef INTERFACE
-CLASS(XonoticRadioButton) EXTENDS(RadioButton)
- METHOD(XonoticRadioButton, configureXonoticRadioButton, void(entity, float, string, string, string))
- METHOD(XonoticRadioButton, draw, void(entity))
- METHOD(XonoticRadioButton, setChecked, void(entity, float))
+#ifndef RADIOBUTTON_H
+#define RADIOBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticRadioButton, RadioButton)
+ METHOD(XonoticRadioButton, configureXonoticRadioButton, void(entity, float, string, string, string));
+ METHOD(XonoticRadioButton, draw, void(entity));
+ METHOD(XonoticRadioButton, setChecked, void(entity, float));
ATTRIB(XonoticRadioButton, fontSize, float, SKINFONTSIZE_NORMAL)
ATTRIB(XonoticRadioButton, image, string, SKINGFX_RADIOBUTTON)
ATTRIB(XonoticRadioButton, color, vector, SKINCOLOR_RADIOBUTTON_N)
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))
+ ATTRIB(XonoticRadioButton, cvarValueIsAnotherCvar, float, 0)
+ METHOD(XonoticRadioButton, loadCvars, void(entity));
+ METHOD(XonoticRadioButton, saveCvars, void(entity));
ATTRIB(XonoticRadioButton, alpha, float, SKINALPHA_TEXT)
ATTRIB(XonoticRadioButton, disabledAlpha, float, SKINALPHA_DISABLED)
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
{
entity me;
- me = spawnXonoticRadioButton();
+ me = NEW(XonoticRadioButton);
me.configureXonoticRadioButton(me, theGroup, theCvar, theValue, theText);
return me;
}
if(me.cvarValue)
{
if(me.cvarName)
- me.checked = (cvar_string(me.cvarName) == me.cvarValue);
+ {
+ if(me.cvarValueIsAnotherCvar)
+ me.checked = (cvar_string(me.cvarName) == cvar_string(me.cvarValue));
+ else
+ me.checked = (cvar_string(me.cvarName) == me.cvarValue);
+ }
}
else
{
{
if(me.checked)
{
- if(me.getCvarValueFromCvar)
+ if(me.cvarValueIsAnotherCvar)
cvar_set(me.cvarName, cvar_string(me.cvarValue));
else
cvar_set(me.cvarName, me.cvarValue);