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, crosshairDialog, entity, NULL)
18 ATTRIB(MainWindow, hudDialog, entity, NULL)
19 ATTRIB(MainWindow, hudconfirmDialog, entity, NULL)
20 ATTRIB(MainWindow, mainNexposee, entity, NULL)
21 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
22 ATTRIB(MainWindow, dialogToShow, entity, NULL)
23 ATTRIB(MainWindow, notificationDialog, entity, NULL)
24 ATTRIB(MainWindow, democonfirmDialog, entity, NULL)
29 void MainWindow_draw(entity me)
31 SUPER(MainWindow).draw(me);
35 DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
36 me.dialogToShow = NULL;
40 void DemoButton_Click(entity me, entity other)
42 if(me.text == _("Do not press this button again!"))
43 DialogOpenButton_Click(me, other);
45 me.setText(me, _("Do not press this button again!"));
48 void MainWindow_configureMainWindow(entity me)
52 // dialog run upon startup
53 me.firstRunDialog = i = spawnXonoticFirstRunDialog();
55 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
58 // hud_configure dialogs
59 i = spawnXonoticHUDExitDialog();
61 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
63 i = spawnXonoticHUDNotificationDialog();
65 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
67 i = spawnXonoticHUDAmmoDialog();
69 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
71 i = spawnXonoticHUDHealthArmorDialog();
73 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
75 i = spawnXonoticHUDChatDialog();
77 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
79 i = spawnXonoticHUDModIconsDialog();
81 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
83 i = spawnXonoticHUDPowerupsDialog();
85 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
87 i = spawnXonoticHUDPressedKeysDialog();
89 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
91 i = spawnXonoticHUDRaceTimerDialog();
93 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
95 i = spawnXonoticHUDRadarDialog();
97 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
99 i = spawnXonoticHUDScoreDialog();
100 i.configureDialog(i);
101 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
103 i = spawnXonoticHUDTimerDialog();
104 i.configureDialog(i);
105 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
107 i = spawnXonoticHUDVoteDialog();
108 i.configureDialog(i);
109 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
111 i = spawnXonoticHUDWeaponsDialog();
112 i.configureDialog(i);
113 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
115 i = spawnXonoticHUDEngineInfoDialog();
116 i.configureDialog(i);
117 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
119 i = spawnXonoticHUDInfoMessagesDialog();
120 i.configureDialog(i);
121 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
123 i = spawnXonoticHUDPhysicsDialog();
124 i.configureDialog(i);
125 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
127 me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
128 i.configureDialog(i);
129 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
131 i = spawnXonoticHUDCenterprintDialog();
132 i.configureDialog(i);
133 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
136 // dialogs used by settings
137 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
138 i.configureDialog(i);
139 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
141 me.cvarsDialog = i = spawnXonoticCvarsDialog();
142 i.configureDialog(i);
143 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
146 // dialog used by singleplayer
147 me.winnerDialog = i = spawnXonoticWinnerDialog();
148 i.configureDialog(i);
149 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
152 // dialog used by multiplayer/join
153 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
154 i.configureDialog(i);
155 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
157 me.democonfirmDialog = i = spawnXonoticDemoConfirmDialog();
158 i.configureDialog(i);
159 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
162 // dialogs used by multiplayer/create
163 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
164 i.configureDialog(i);
165 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
167 me.advancedDialog = i = spawnXonoticAdvancedDialog();
168 i.configureDialog(i);
169 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
171 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
172 i.configureDialog(i);
173 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
176 // dialogs used by multiplayer/player setup
177 me.crosshairDialog = i = spawnXonoticCrosshairDialog();
178 i.configureDialog(i);
179 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
181 me.hudDialog = i = spawnXonoticHUDDialog();
182 i.configureDialog(i);
183 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
185 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
186 i.configureDialog(i);
187 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
189 me.modelDialog = i = spawnXonoticModelDialog();
190 i.configureDialog(i);
191 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
193 me.viewDialog = i = spawnXonoticViewDialog();
194 i.configureDialog(i);
195 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
197 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
198 i.configureDialog(i);
199 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
201 me.notificationDialog = i = spawnXonoticNotificationDialog();
202 i.configureDialog(i);
203 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
206 i = spawnXonoticSandboxToolsDialog();
207 i.configureDialog(i);
208 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
211 // miscellaneous dialogs
212 i = spawnXonoticTeamSelectDialog();
213 i.configureDialog(i);
214 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
217 // main dialogs/windows
218 me.mainNexposee = n = spawnXonoticNexposee();
220 if(checkextension("DP_GECKO_SUPPORT"))
222 i = spawnXonoticNewsDialog();
223 i.configureDialog(i);
224 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
225 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
228 i = spawnXonoticSingleplayerDialog();
229 i.configureDialog(i);
230 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
231 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
233 i = spawnXonoticMultiplayerDialog();
234 i.configureDialog(i);
235 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
236 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
238 i = spawnXonoticSettingsDialog();
239 i.configureDialog(i);
240 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
241 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
243 i = spawnXonoticCreditsDialog();
244 i.configureDialog(i);
245 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
246 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
247 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
249 i = spawnXonoticQuitDialog();
250 i.configureDialog(i);
251 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
252 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
253 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
255 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
256 me.moveItemAfter(me, n, NULL);
258 me.initializeDialog(me, n);
260 if(cvar_string("_cl_name") == "Player")
261 me.dialogToShow = me.firstRunDialog;
265 /* Click. The c-word is here so you can grep for it :-) */