2 CLASS(MainWindow) EXTENDS(ModalController)
3 METHOD(MainWindow, configureMainWindow, void(entity))
4 METHOD(MainWindow, draw, void(entity))
5 ATTRIB(MainWindow, firstRunDialog, entity, NULL)
6 ATTRIB(MainWindow, advancedDialog, entity, NULL)
7 ATTRIB(MainWindow, mutatorsDialog, entity, NULL)
8 ATTRIB(MainWindow, weaponsDialog, entity, NULL)
9 ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
10 ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
11 ATTRIB(MainWindow, winnerDialog, entity, NULL)
12 ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
13 ATTRIB(MainWindow, cvarsDialog, entity, NULL)
14 ATTRIB(MainWindow, screenshotViewerDialog, entity, NULL)
15 ATTRIB(MainWindow, viewDialog, entity, NULL)
16 ATTRIB(MainWindow, modelDialog, entity, NULL)
17 ATTRIB(MainWindow, hudDialog, entity, NULL)
18 ATTRIB(MainWindow, hudconfirmDialog, entity, NULL)
19 ATTRIB(MainWindow, mainNexposee, entity, NULL)
20 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
21 ATTRIB(MainWindow, dialogToShow, entity, NULL)
22 ATTRIB(MainWindow, notificationDialog, entity, NULL)
23 ATTRIB(MainWindow, democonfirmDialog, entity, NULL)
28 void MainWindow_draw(entity me)
30 SUPER(MainWindow).draw(me);
34 DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
35 me.dialogToShow = NULL;
39 void DemoButton_Click(entity me, entity other)
41 if(me.text == _("Do not press this button again!"))
42 DialogOpenButton_Click(me, other);
44 me.setText(me, _("Do not press this button again!"));
47 void MainWindow_configureMainWindow(entity me)
51 // dialog run upon startup
52 me.firstRunDialog = i = spawnXonoticFirstRunDialog();
54 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
57 // hud_configure dialogs
58 i = spawnXonoticHUDExitDialog();
60 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
62 i = spawnXonoticHUDNotificationDialog();
64 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
66 i = spawnXonoticHUDAmmoDialog();
68 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
70 i = spawnXonoticHUDHealthArmorDialog();
72 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
74 i = spawnXonoticHUDChatDialog();
76 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
78 i = spawnXonoticHUDModIconsDialog();
80 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
82 i = spawnXonoticHUDPowerupsDialog();
84 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
86 i = spawnXonoticHUDPressedKeysDialog();
88 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
90 i = spawnXonoticHUDRaceTimerDialog();
92 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
94 i = spawnXonoticHUDRadarDialog();
96 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
98 i = spawnXonoticHUDScoreDialog();
100 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
102 i = spawnXonoticHUDTimerDialog();
103 i.configureDialog(i);
104 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
106 i = spawnXonoticHUDVoteDialog();
107 i.configureDialog(i);
108 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
110 i = spawnXonoticHUDWeaponsDialog();
111 i.configureDialog(i);
112 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
114 i = spawnXonoticHUDEngineInfoDialog();
115 i.configureDialog(i);
116 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
118 i = spawnXonoticHUDInfoMessagesDialog();
119 i.configureDialog(i);
120 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
122 i = spawnXonoticHUDPhysicsDialog();
123 i.configureDialog(i);
124 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
126 me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
127 i.configureDialog(i);
128 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
130 i = spawnXonoticHUDCenterprintDialog();
131 i.configureDialog(i);
132 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
135 // dialogs used by settings
136 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
137 i.configureDialog(i);
138 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
140 me.cvarsDialog = i = spawnXonoticCvarsDialog();
141 i.configureDialog(i);
142 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
145 // dialog used by singleplayer
146 me.winnerDialog = i = spawnXonoticWinnerDialog();
147 i.configureDialog(i);
148 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
151 // dialog used by multiplayer/join
152 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
153 i.configureDialog(i);
154 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
156 me.democonfirmDialog = i = spawnXonoticDemoConfirmDialog();
157 i.configureDialog(i);
158 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
161 // dialogs used by multiplayer/create
162 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
163 i.configureDialog(i);
164 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
166 me.advancedDialog = i = spawnXonoticAdvancedDialog();
167 i.configureDialog(i);
168 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
170 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
171 i.configureDialog(i);
172 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
175 // dialogs used by multiplayer/player setup
176 me.hudDialog = i = spawnXonoticHUDDialog();
177 i.configureDialog(i);
178 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
180 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
181 i.configureDialog(i);
182 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
184 me.modelDialog = i = spawnXonoticModelDialog();
185 i.configureDialog(i);
186 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
188 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
189 i.configureDialog(i);
190 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
192 me.notificationDialog = i = spawnXonoticNotificationDialog();
193 i.configureDialog(i);
194 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
197 i = spawnXonoticSandboxToolsDialog();
198 i.configureDialog(i);
199 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
202 // miscellaneous dialogs
203 i = spawnXonoticTeamSelectDialog();
204 i.configureDialog(i);
205 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
208 // main dialogs/windows
209 me.mainNexposee = n = spawnXonoticNexposee();
211 if(checkextension("DP_GECKO_SUPPORT"))
213 i = spawnXonoticNewsDialog();
214 i.configureDialog(i);
215 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
216 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
219 i = spawnXonoticSingleplayerDialog();
220 i.configureDialog(i);
221 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
222 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
224 i = spawnXonoticMultiplayerDialog();
225 i.configureDialog(i);
226 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
227 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
229 i = spawnXonoticSettingsDialog();
230 i.configureDialog(i);
231 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
232 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
234 i = spawnXonoticCreditsDialog();
235 i.configureDialog(i);
236 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
237 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
238 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
240 i = spawnXonoticQuitDialog();
241 i.configureDialog(i);
242 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
243 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
244 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
246 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
247 me.moveItemAfter(me, n, NULL);
249 me.initializeDialog(me, n);
251 if(cvar_string("_cl_name") == "Player")
252 me.dialogToShow = me.firstRunDialog;
256 /* Click. The c-word is here so you can grep for it :-) */