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, mapInfoDialog, entity, NULL)
9 ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
10 ATTRIB(MainWindow, winnerDialog, entity, NULL)
11 ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
12 ATTRIB(MainWindow, cvarsDialog, entity, NULL)
13 ATTRIB(MainWindow, screenshotViewerDialog, entity, NULL)
14 ATTRIB(MainWindow, viewDialog, entity, NULL)
15 ATTRIB(MainWindow, hudconfirmDialog, entity, NULL)
16 ATTRIB(MainWindow, languageWarningDialog, entity, NULL)
17 ATTRIB(MainWindow, mainNexposee, entity, NULL)
18 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
19 ATTRIB(MainWindow, dialogToShow, entity, NULL)
20 ATTRIB(MainWindow, demostartconfirmDialog, entity, NULL)
21 ATTRIB(MainWindow, demotimeconfirmDialog, entity, NULL)
22 ATTRIB(MainWindow, resetDialog, entity, NULL)
27 void MainWindow_draw(entity me)
29 SUPER(MainWindow).draw(me);
33 DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
34 me.dialogToShow = NULL;
38 void DemoButton_Click(entity me, entity other)
40 if(me.text == _("Do not press this button again!"))
41 DialogOpenButton_Click(me, other);
43 me.setText(me, _("Do not press this button again!"));
46 void MainWindow_configureMainWindow(entity me)
50 // dialog run upon startup
51 me.firstRunDialog = i = spawnXonoticFirstRunDialog();
53 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
56 // hud_configure dialogs
57 i = spawnXonoticHUDExitDialog();
59 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
61 i = spawnXonoticHUDNotificationDialog();
63 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
65 i = spawnXonoticHUDAmmoDialog();
67 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
69 i = spawnXonoticHUDHealthArmorDialog();
71 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
73 i = spawnXonoticHUDChatDialog();
75 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
77 i = spawnXonoticHUDModIconsDialog();
79 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
81 i = spawnXonoticHUDPowerupsDialog();
83 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
85 i = spawnXonoticHUDPressedKeysDialog();
87 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
89 i = spawnXonoticHUDRaceTimerDialog();
91 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
93 i = spawnXonoticHUDRadarDialog();
95 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
97 i = spawnXonoticHUDScoreDialog();
99 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
101 i = spawnXonoticHUDTimerDialog();
102 i.configureDialog(i);
103 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
105 i = spawnXonoticHUDVoteDialog();
106 i.configureDialog(i);
107 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
109 i = spawnXonoticHUDWeaponsDialog();
110 i.configureDialog(i);
111 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
113 i = spawnXonoticHUDEngineInfoDialog();
114 i.configureDialog(i);
115 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
117 i = spawnXonoticHUDInfoMessagesDialog();
118 i.configureDialog(i);
119 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
121 i = spawnXonoticHUDPhysicsDialog();
122 i.configureDialog(i);
123 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
125 me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
126 i.configureDialog(i);
127 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
129 i = spawnXonoticHUDCenterprintDialog();
130 i.configureDialog(i);
131 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
133 i = spawnXonoticHUDBuffsDialog();
134 i.configureDialog(i);
135 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
137 i = spawnXonoticHUDQuickMenuDialog();
138 i.configureDialog(i);
139 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
141 // dialogs used by settings
142 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
143 i.configureDialog(i);
144 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
146 me.cvarsDialog = i = spawnXonoticCvarsDialog();
147 i.configureDialog(i);
148 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
150 me.resetDialog = i = spawnXonoticResetDialog();
151 i.configureDialog(i);
152 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
154 me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
155 i.configureDialog(i);
156 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
158 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
159 i.configureDialog(i);
160 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
163 // dialog used by singleplayer
164 me.winnerDialog = i = spawnXonoticWinnerDialog();
165 i.configureDialog(i);
166 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
169 // dialog used by multiplayer/join
170 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
171 i.configureDialog(i);
172 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
174 me.demostartconfirmDialog = i = spawnXonoticDemoStartConfirmDialog();
175 i.configureDialog(i);
176 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
178 me.demotimeconfirmDialog = i = spawnXonoticDemoTimeConfirmDialog();
179 i.configureDialog(i);
180 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
183 // dialogs used by multiplayer/create
184 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
185 i.configureDialog(i);
186 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
188 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
189 i.configureDialog(i);
190 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
193 i = spawnXonoticSandboxToolsDialog();
194 i.configureDialog(i);
195 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
198 // miscellaneous dialogs
199 i = spawnXonoticTeamSelectDialog();
200 i.configureDialog(i);
201 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
203 i = spawnXonoticMonsterToolsDialog();
204 i.configureDialog(i);
205 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
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") == cvar_defstring("_cl_name"))
252 me.dialogToShow = me.firstRunDialog;
256 /* Click. The c-word is here so you can grep for it :-) */