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