]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/item/checkbox.qc
menu: #undef IMPLEMENTATION
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / checkbox.qc
1 #include "checkbox.qh"
2
3         void CheckBox_setChecked(entity me, float val)
4         {
5                 me.checked = val;
6         }
7         void CheckBox_Click(entity me, entity other)
8         {
9                 me.setChecked(me, !me.checked);
10         }
11         string CheckBox_toString(entity me)
12         {
13                 return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked");
14         }
15         void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx)
16         {
17                 me.configureButton(me, txt, sz, gfx);
18                 me.align = 0;
19         }
20         void CheckBox_draw(entity me)
21         {
22                 float s;
23                 s = me.pressed;
24                 if (me.useDownAsChecked)
25                 {
26                         me.srcSuffix = string_null;
27                         me.forcePressed = me.checked;
28                 }
29                 else
30                 {
31                         me.srcSuffix = (me.checked ? "1" : "0");
32                 }
33                 me.pressed = s;
34                 SUPER(CheckBox).draw(me);
35         }
36         void CheckBox_playClickSound(entity me)
37         {
38                 m_play_click_sound(MENU_SOUND_SELECT);
39         }