More changes to the menu
[voretournament/voretournament.git] / data / qcsrc / menu / voret / mainwindow.c
1 #ifdef INTERFACE\r
2 CLASS(MainWindow) EXTENDS(ModalController)\r
3         METHOD(MainWindow, configureMainWindow, void(entity))\r
4         ATTRIB(MainWindow, advancedDialog, entity, NULL)\r
5         ATTRIB(MainWindow, mutatorsDialog, entity, NULL)\r
6         ATTRIB(MainWindow, weaponsDialog, entity, NULL)\r
7         ATTRIB(MainWindow, mapInfoDialog, entity, NULL)\r
8         ATTRIB(MainWindow, userbindEditDialog, entity, NULL)\r
9         ATTRIB(MainWindow, winnerDialog, entity, NULL)\r
10         ATTRIB(MainWindow, hudDialog, entity, NULL)\r
11         ATTRIB(MainWindow, serverInfoDialog, entity, NULL)\r
12         ATTRIB(MainWindow, cvarsDialog, entity, NULL)\r
13         ATTRIB(MainWindow, mainNexposee, entity, NULL)\r
14         ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)\r
15 ENDCLASS(MainWindow)\r
16 #endif\r
17 \r
18 #ifdef IMPLEMENTATION\r
19 \r
20 void DemoButton_Click(entity me, entity other)\r
21 {\r
22         if(me.text == "Do not press this button again!")\r
23                 DialogOpenButton_Click(me, other);\r
24         else\r
25                 me.setText(me, "Do not press this button again!");\r
26 }\r
27 \r
28 void configureMainWindowMainWindow(entity me)\r
29 {\r
30         entity n, i;\r
31 \r
32         i = spawnVoretTeamSelectDialog();\r
33         i.configureDialog(i);\r
34         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
35 \r
36         me.advancedDialog = i = spawnVoretAdvancedDialog();\r
37         i.configureDialog(i);\r
38         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
39 \r
40         me.mutatorsDialog = i = spawnVoretMutatorsDialog();\r
41         i.configureDialog(i);\r
42         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
43 \r
44         me.mapInfoDialog = i = spawnVoretMapInfoDialog();\r
45         i.configureDialog(i);\r
46         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
47 \r
48         me.userbindEditDialog = i = spawnVoretUserbindEditDialog();\r
49         i.configureDialog(i);\r
50         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
51 \r
52         me.winnerDialog = i = spawnVoretWinnerDialog();\r
53         i.configureDialog(i);\r
54         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
55 \r
56         me.weaponsDialog = i = spawnVoretWeaponsDialog();\r
57         i.configureDialog(i);\r
58         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
59 \r
60         me.hudDialog = i = spawnVoretHudDialog();\r
61         i.configureDialog(i);\r
62         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
63         \r
64         me.serverInfoDialog = i = spawnVoretServerInfoDialog();\r
65         i.configureDialog(i);\r
66         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
67         \r
68         me.cvarsDialog = i = spawnVoretCvarsDialog();\r
69         i.configureDialog(i);\r
70         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
71         \r
72         me.mainNexposee = n = spawnVoretNexposee();\r
73         /*\r
74                 if(checkextension("DP_GECKO_SUPPORT"))\r
75                 {\r
76                         i = spawnVoretNewsDialog();\r
77                         i.configureDialog(i);\r
78                         n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
79                         n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);\r
80                 }\r
81         */\r
82                 i = spawnVoretSingleplayerDialog();\r
83                 i.configureDialog(i);\r
84                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
85                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);\r
86                 \r
87                 i = spawnVoretMultiplayerDialog();\r
88                 i.configureDialog(i);\r
89                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
90                 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);\r
91 \r
92                 i = spawnVoretSettingsDialog();\r
93                 i.configureDialog(i);\r
94                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
95                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);\r
96 \r
97                 i = spawnVoretCreditsDialog();\r
98                 i.configureDialog(i);\r
99                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
100                 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);\r
101                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));\r
102 \r
103                 i = spawnVoretQuitDialog();\r
104                 i.configureDialog(i);\r
105                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);\r
106                 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);\r
107                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));\r
108         me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);\r
109         me.moveItemAfter(me, n, NULL);\r
110 \r
111         me.initializeDialog(me, n);\r
112 }\r
113 #endif\r
114 \r
115 /* Click. The c-word is here so you can grep for it :-) */\r