]> de.git.xonotic.org Git - voretournament/voretournament.git/blob - data/qcsrc/menu/voret/button.c
Tweak the Effects menu, and add iris adaptation to it as well.
[voretournament/voretournament.git] / data / qcsrc / menu / voret / button.c
1 #ifdef INTERFACE\r
2 CLASS(VoretButton) EXTENDS(Button)\r
3         METHOD(VoretButton, configureVoretButton, void(entity, string, vector))\r
4         ATTRIB(VoretButton, fontSize, float, SKINFONTSIZE_NORMAL)\r
5         ATTRIB(VoretButton, image, string, SKINGFX_BUTTON)\r
6         ATTRIB(VoretButton, grayImage, string, SKINGFX_BUTTON_GRAY)\r
7         ATTRIB(VoretButton, color, vector, SKINCOLOR_BUTTON_N)\r
8         ATTRIB(VoretButton, colorC, vector, SKINCOLOR_BUTTON_C)\r
9         ATTRIB(VoretButton, colorF, vector, SKINCOLOR_BUTTON_F)\r
10         ATTRIB(VoretButton, colorD, vector, SKINCOLOR_BUTTON_D)\r
11         ATTRIB(VoretButton, alpha, float, SKINALPHA_TEXT)\r
12         ATTRIB(VoretButton, disabledAlpha, float, SKINALPHA_DISABLED)\r
13 ENDCLASS(VoretButton)\r
14 entity makeVoretButton(string theText, vector theColor);\r
15 #endif\r
16 \r
17 #ifdef IMPLEMENTATION\r
18 entity makeVoretButton(string theText, vector theColor)\r
19 {\r
20         entity me;\r
21         me = spawnVoretButton();\r
22         me.configureVoretButton(me, theText, theColor);\r
23         return me;\r
24 }\r
25 \r
26 void configureVoretButtonVoretButton(entity me, string theText, vector theColor)\r
27 {\r
28         if(theColor == '0 0 0')\r
29         {\r
30                 me.configureButton(me, theText, me.fontSize, me.image);\r
31         }\r
32         else\r
33         {\r
34                 me.configureButton(me, theText, me.fontSize, me.grayImage);\r
35                 me.color = theColor;\r
36                 me.colorC = theColor;\r
37                 me.colorF = theColor;\r
38         }\r
39         me.tooltip = getZonedTooltipForIdentifier(strcat(currentDialog.classname, "/", me.text));\r
40 }\r
41 #endif\r