1 #ifndef GAMETYPEBUTTON_H
2 #define GAMETYPEBUTTON_H
3 CLASS(XonoticGametypeButton, RadioButton)
4 METHOD(XonoticGametypeButton, configureXonoticGametypeButton, void(entity, float, string, string))
5 METHOD(XonoticGametypeButton, setChecked, void(entity, float))
6 ATTRIB(XonoticGametypeButton, fontSize, float, SKINFONTSIZE_NORMAL)
7 ATTRIB(XonoticGametypeButton, image, string, SKINGFX_BUTTON_BIG)
8 ATTRIB(XonoticGametypeButton, color, vector, SKINCOLOR_BUTTON_N)
9 ATTRIB(XonoticGametypeButton, colorC, vector, SKINCOLOR_BUTTON_C)
10 ATTRIB(XonoticGametypeButton, colorF, vector, SKINCOLOR_BUTTON_F)
11 ATTRIB(XonoticGametypeButton, colorD, vector, SKINCOLOR_BUTTON_D)
12 ATTRIB(XonoticGametypeButton, srcMulti, float, 1)
13 ATTRIB(XonoticGametypeButton, useDownAsChecked, float, 1)
15 ATTRIB(XonoticGametypeButton, cvarName, string, string_null)
16 METHOD(XonoticGametypeButton, loadCvars, void(entity))
17 METHOD(XonoticGametypeButton, saveCvars, void(entity))
19 ATTRIB(XonoticGametypeButton, alpha, float, SKINALPHA_TEXT)
20 ATTRIB(XonoticGametypeButton, disabledAlpha, float, SKINALPHA_DISABLED)
21 ENDCLASS(XonoticGametypeButton)
22 entity makeXonoticGametypeButton(float, string, string);
26 void GameTypeButton_Click(entity me, entity other);
27 entity makeXonoticGametypeButton(float theGroup, string theCvar, string theText)
30 me = NEW(XonoticGametypeButton);
31 me.configureXonoticGametypeButton(me, theGroup, theCvar, theText);
34 void XonoticGametypeButton_configureXonoticGametypeButton(entity me, float theGroup, string theCvar, string theText)
38 me.cvarName = theCvar;
39 me.tooltip = getZonedTooltipForIdentifier(theCvar);
42 me.configureRadioButton(me, theText, me.fontSize, me.image, theGroup, 0);
44 me.onClick = GameTypeButton_Click;
45 me.onClickEntity = NULL;
47 void XonoticGametypeButton_setChecked(entity me, float val)
55 void XonoticGametypeButton_loadCvars(entity me)
60 me.checked = cvar(me.cvarName);
62 void XonoticGametypeButton_saveCvars(entity me)
67 cvar_set(me.cvarName, ftos(me.checked));
69 void GameTypeButton_Click(entity me, entity other)
71 RadioButton_Click(me, other);
72 me.parent.gameTypeChangeNotify(me.parent);