]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/nexuiz/mainwindow.c
team radar menu controls
[divverent/nexuiz.git] / data / qcsrc / menu / nexuiz / mainwindow.c
1 #ifdef INTERFACE
2 CLASS(MainWindow) EXTENDS(ModalController)
3         METHOD(MainWindow, configureMainWindow, void(entity))
4         ATTRIB(MainWindow, mutatorsDialog, entity, NULL)
5         ATTRIB(MainWindow, weaponsDialog, entity, NULL)
6         ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
7         ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
8         ATTRIB(MainWindow, winnerDialog, entity, NULL)
9         ATTRIB(MainWindow, radarDialog, entity, NULL)
10         ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
11 ENDCLASS(MainWindow)
12 #endif
13
14 #ifdef IMPLEMENTATION
15
16 void DemoButton_Click(entity me, entity other)
17 {
18         if(me.text == "Do not press this button again!")
19                 DialogOpenButton_Click(me, other);
20         else
21                 me.setText(me, "Do not press this button again!");
22 }
23
24 void configureMainWindowMainWindow(entity me)
25 {
26         entity n, i;
27
28         i = spawnNexuizTeamSelectDialog();
29         i.configureDialog(i);
30         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
31
32         me.mutatorsDialog = i = spawnNexuizMutatorsDialog();
33         i.configureDialog(i);
34         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
35
36         me.mapInfoDialog = i = spawnNexuizMapInfoDialog();
37         i.configureDialog(i);
38         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
39
40         me.userbindEditDialog = i = spawnNexuizUserbindEditDialog();
41         i.configureDialog(i);
42         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
43
44         me.winnerDialog = i = spawnNexuizWinnerDialog();
45         i.configureDialog(i);
46         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
47
48         me.weaponsDialog = i = spawnNexuizWeaponsDialog();
49         i.configureDialog(i);
50         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
51
52         me.radarDialog = i = spawnNexuizRadarDialog();
53         i.configureDialog(i);
54         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
55
56         n = spawnNexuizNexposee();
57         /*
58                 if(checkextension("DP_GECKO_SUPPORT"))
59                 {
60                         i = spawnNexuizNewsDialog();
61                         i.configureDialog(i);
62                         n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
63                         n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
64                 }
65         */
66                 i = spawnNexuizSingleplayerDialog();
67                 i.configureDialog(i);
68                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
69                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
70                 
71                 i = spawnNexuizMultiplayerDialog();
72                 i.configureDialog(i);
73                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
74                 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
75
76                 i = spawnNexuizSettingsDialog();
77                 i.configureDialog(i);
78                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
79                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
80
81                 i = spawnNexuizCreditsDialog();
82                 i.configureDialog(i);
83                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
84                 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
85                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
86
87                 i = spawnNexuizQuitDialog();
88                 i.configureDialog(i);
89                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
90                 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
91                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
92         me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
93         me.moveItemAfter(me, n, NULL);
94
95         me.initializeDialog(me, n);
96 }
97 #endif
98
99 // click. The C-word so you can grep for it.