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)
26 void MainWindow_draw(entity me)
28 SUPER(MainWindow).draw(me);
32 DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
33 me.dialogToShow = NULL;
37 void DemoButton_Click(entity me, entity other)
39 if(me.text == _("Do not press this button again!"))
40 DialogOpenButton_Click(me, other);
42 me.setText(me, _("Do not press this button again!"));
45 void MainWindow_configureMainWindow(entity me)
49 // dialog run upon startup
50 me.firstRunDialog = i = spawnXonoticFirstRunDialog();
52 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
55 // hud_configure dialogs
56 i = spawnXonoticHUDExitDialog();
58 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
60 i = spawnXonoticHUDNotificationDialog();
62 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
64 i = spawnXonoticHUDAmmoDialog();
66 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
68 i = spawnXonoticHUDHealthArmorDialog();
70 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
72 i = spawnXonoticHUDChatDialog();
74 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
76 i = spawnXonoticHUDModIconsDialog();
78 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
80 i = spawnXonoticHUDPowerupsDialog();
82 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
84 i = spawnXonoticHUDPressedKeysDialog();
86 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
88 i = spawnXonoticHUDRaceTimerDialog();
90 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
92 i = spawnXonoticHUDRadarDialog();
94 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
96 i = spawnXonoticHUDScoreDialog();
98 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
100 i = spawnXonoticHUDTimerDialog();
101 i.configureDialog(i);
102 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
104 i = spawnXonoticHUDVoteDialog();
105 i.configureDialog(i);
106 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
108 i = spawnXonoticHUDWeaponsDialog();
109 i.configureDialog(i);
110 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
112 i = spawnXonoticHUDEngineInfoDialog();
113 i.configureDialog(i);
114 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
116 i = spawnXonoticHUDInfoMessagesDialog();
117 i.configureDialog(i);
118 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
120 i = spawnXonoticHUDPhysicsDialog();
121 i.configureDialog(i);
122 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
124 me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
125 i.configureDialog(i);
126 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
128 i = spawnXonoticHUDCenterprintDialog();
129 i.configureDialog(i);
130 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
132 i = spawnXonoticHUDBuffsDialog();
133 i.configureDialog(i);
134 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
137 // dialogs used by settings
138 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
139 i.configureDialog(i);
140 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
142 me.cvarsDialog = i = spawnXonoticCvarsDialog();
143 i.configureDialog(i);
144 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
146 me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
147 i.configureDialog(i);
148 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
150 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
151 me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
152 i.configureDialog(i);
153 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
156 // dialog used by singleplayer
157 me.winnerDialog = i = spawnXonoticWinnerDialog();
158 i.configureDialog(i);
159 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
162 // dialog used by multiplayer/join
163 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
164 i.configureDialog(i);
165 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
167 me.demostartconfirmDialog = i = spawnXonoticDemoStartConfirmDialog();
168 i.configureDialog(i);
169 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
171 me.demotimeconfirmDialog = i = spawnXonoticDemoTimeConfirmDialog();
172 i.configureDialog(i);
173 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
176 // dialogs used by multiplayer/create
177 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
178 i.configureDialog(i);
179 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
181 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
182 i.configureDialog(i);
183 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
186 i = spawnXonoticSandboxToolsDialog();
187 i.configureDialog(i);
188 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
191 // miscellaneous dialogs
192 i = spawnXonoticTeamSelectDialog();
193 i.configureDialog(i);
194 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
196 i = spawnXonoticMonsterToolsDialog();
197 i.configureDialog(i);
198 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
201 // main dialogs/windows
202 me.mainNexposee = n = spawnXonoticNexposee();
204 if(checkextension("DP_GECKO_SUPPORT"))
206 i = spawnXonoticNewsDialog();
207 i.configureDialog(i);
208 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
209 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
212 i = spawnXonoticSingleplayerDialog();
213 i.configureDialog(i);
214 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
215 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
217 i = spawnXonoticMultiplayerDialog();
218 i.configureDialog(i);
219 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
220 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
222 i = spawnXonoticSettingsDialog();
223 i.configureDialog(i);
224 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
225 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
227 i = spawnXonoticCreditsDialog();
228 i.configureDialog(i);
229 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
230 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
231 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
233 i = spawnXonoticQuitDialog();
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_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
237 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
239 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
240 me.moveItemAfter(me, n, NULL);
242 me.initializeDialog(me, n);
244 if(cvar_string("_cl_name") == cvar_defstring("_cl_name"))
245 me.dialogToShow = me.firstRunDialog;
249 /* Click. The c-word is here so you can grep for it :-) */