]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/nexuiz/dialog_teamselect.c
first attempt at teamselect dialog... not good yet (need a better way to implement...
[divverent/nexuiz.git] / data / qcsrc / menu-div0test / nexuiz / dialog_teamselect.c
1 #ifdef INTERFACE
2 CLASS(TeamSelectDialog) EXTENDS(Dialog)
3         METHOD(TeamSelectDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
4         ATTRIB(TeamSelectDialog, closable, float, 1)
5         ATTRIB(TeamSelectDialog, title, string, "Team selection") // ;)
6         ATTRIB(TeamSelectDialog, color, vector, '1 1 1')
7         ATTRIB(TeamSelectDialog, intendedWidth, float, 0.6)
8         ATTRIB(TeamSelectDialog, intendedHeight, float, 0.15)
9         ATTRIB(TeamSelectDialog, name, string, "TeamSelect")
10 ENDCLASS(TeamSelectDialog)
11 #endif
12
13 #ifdef IMPLEMENTATION
14 void fillTeamSelectDialog(entity me)
15 {
16         entity e;
17
18         e = spawnCommandButton();
19         e.configureCommandButton(e, "Auto", '0 0 0', "cmd selectteam auto; cmd join", 1);
20         me.addItemSimple(me, 1, 1, 1, e);
21
22         e = spawnCommandButton();
23         e.configureCommandButton(e, "Red", '1 0 0', "cmd selectteam red; cmd join", 1);
24         me.addItemSimple(me, me.lines, 1, 4, e);
25         e = spawnCommandButton();
26         e.configureCommandButton(e, "Blue", '0 0 1', "cmd selectteam blue; cmd join", 1);
27         me.addItemSimple(me, me.lines, 2, 4, e);
28         e = spawnCommandButton();
29         e.configureCommandButton(e, "Yellow", '1 1 0', "cmd selectteam yellow; cmd join", 1);
30         me.addItemSimple(me, me.lines, 3, 4, e);
31         e = spawnCommandButton();
32         e.configureCommandButton(e, "Pink", '1 0 1', "cmd selectteam pink; cmd join", 1);
33         me.addItemSimple(me, me.lines, 4, 4, e);
34 }
35 #endif
36
37 // click. The C-word so you can grep for it.