]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/nexuiz/button.c
fix selection bugs when enabling/disabling the checkboxes
[divverent/nexuiz.git] / data / qcsrc / menu-div0test / nexuiz / button.c
1 #ifdef INTERFACE
2 CLASS(NexuizButton) EXTENDS(Button)
3         METHOD(NexuizButton, configureNexuizButton, void(entity, string, vector))
4         ATTRIB(NexuizButton, fontSize, float, SKINFONTSIZE_NORMAL)
5         ATTRIB(NexuizButton, image, string, SKINGFX_BUTTON)
6         ATTRIB(NexuizButton, grayImage, string, SKINGFX_BUTTON_GRAY)
7 ENDCLASS(NexuizButton)
8 entity makeNexuizButton(string theText, vector theColor);
9 #endif
10
11 #ifdef IMPLEMENTATION
12 entity makeNexuizButton(string theText, vector theColor)
13 {
14         entity me;
15         me = spawnNexuizButton();
16         me.configureNexuizButton(me, theText, theColor);
17         return me;
18 }
19
20 void configureNexuizButtonNexuizButton(entity me, string theText, vector theColor)
21 {
22         if(theColor == '0 0 0')
23         {
24                 me.configureButton(me, theText, me.fontSize, me.image);
25         }
26         else
27         {
28                 me.configureButton(me, theText, me.fontSize, me.grayImage);
29                 me.color = theColor;
30         }
31 }
32 #endif