]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/nexuiz/button.c
-scmenu; make mapinfo default
[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         ATTRIB(NexuizButton, color, vector, SKINCOLOR_BUTTON_N)
8         ATTRIB(NexuizButton, colorC, vector, SKINCOLOR_BUTTON_C)
9         ATTRIB(NexuizButton, colorF, vector, SKINCOLOR_BUTTON_F)
10         ATTRIB(NexuizButton, colorD, vector, SKINCOLOR_BUTTON_D)
11         ATTRIB(NexuizButton, disabledAlpha, float, SKINALPHA_DISABLED)
12 ENDCLASS(NexuizButton)
13 entity makeNexuizButton(string theText, vector theColor);
14 #endif
15
16 #ifdef IMPLEMENTATION
17 entity makeNexuizButton(string theText, vector theColor)
18 {
19         entity me;
20         me = spawnNexuizButton();
21         me.configureNexuizButton(me, theText, theColor);
22         return me;
23 }
24
25 void configureNexuizButtonNexuizButton(entity me, string theText, vector theColor)
26 {
27         if(theColor == '0 0 0')
28         {
29                 me.configureButton(me, theText, me.fontSize, me.image);
30         }
31         else
32         {
33                 me.configureButton(me, theText, me.fontSize, me.grayImage);
34                 me.color = theColor;
35                 me.colorC = theColor;
36                 me.colorF = theColor;
37         }
38 }
39 #endif