3 CLASS(MainWindow, ModalController)
4 METHOD(MainWindow, configureMainWindow, void(entity))
5 METHOD(MainWindow, draw, void(entity))
6 ATTRIB(MainWindow, firstRunDialog, entity, NULL)
7 ATTRIB(MainWindow, advancedDialog, entity, NULL)
8 ATTRIB(MainWindow, mutatorsDialog, 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, hudconfirmDialog, entity, NULL)
17 ATTRIB(MainWindow, languageWarningDialog, entity, NULL)
18 ATTRIB(MainWindow, mainNexposee, entity, NULL)
19 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
20 ATTRIB(MainWindow, dialogToShow, entity, NULL)
21 ATTRIB(MainWindow, demostartconfirmDialog, entity, NULL)
22 ATTRIB(MainWindow, demotimeconfirmDialog, entity, NULL)
23 ATTRIB(MainWindow, resetDialog, 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 = NEW(XonoticFirstRunDialog);
54 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
57 // hud_configure dialogs
58 i = NEW(XonoticHUDExitDialog);
60 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
62 i = NEW(XonoticHUDNotificationDialog);
64 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
66 i = NEW(XonoticHUDAmmoDialog);
68 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
70 i = NEW(XonoticHUDHealthArmorDialog);
72 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
74 i = NEW(XonoticHUDChatDialog);
76 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
78 i = NEW(XonoticHUDModIconsDialog);
80 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
82 i = NEW(XonoticHUDPowerupsDialog);
84 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
86 i = NEW(XonoticHUDPressedKeysDialog);
88 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
90 i = NEW(XonoticHUDRaceTimerDialog);
92 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
94 i = NEW(XonoticHUDRadarDialog);
96 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
98 i = NEW(XonoticHUDScoreDialog);
100 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
102 i = NEW(XonoticHUDTimerDialog);
103 i.configureDialog(i);
104 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
106 i = NEW(XonoticHUDVoteDialog);
107 i.configureDialog(i);
108 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
110 i = NEW(XonoticHUDWeaponsDialog);
111 i.configureDialog(i);
112 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
114 i = NEW(XonoticHUDEngineInfoDialog);
115 i.configureDialog(i);
116 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
118 i = NEW(XonoticHUDInfoMessagesDialog);
119 i.configureDialog(i);
120 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
122 i = NEW(XonoticHUDPhysicsDialog);
123 i.configureDialog(i);
124 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
126 me.screenshotViewerDialog = i = NEW(XonoticScreenshotViewerDialog);
127 i.configureDialog(i);
128 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
130 i = NEW(XonoticHUDCenterprintDialog);
131 i.configureDialog(i);
132 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
134 i = NEW(XonoticHUDBuffsDialog);
135 i.configureDialog(i);
136 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
139 // dialogs used by settings
140 me.userbindEditDialog = i = NEW(XonoticUserbindEditDialog);
141 i.configureDialog(i);
142 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
144 me.cvarsDialog = i = NEW(XonoticCvarsDialog);
145 i.configureDialog(i);
146 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
148 me.resetDialog = i = NEW(XonoticResetDialog);
149 i.configureDialog(i);
150 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
152 me.languageWarningDialog = i = NEW(XonoticLanguageWarningDialog);
153 i.configureDialog(i);
154 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
156 me.hudconfirmDialog = i = NEW(XonoticHUDConfirmDialog);
157 i.configureDialog(i);
158 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
161 // dialog used by singleplayer
162 me.winnerDialog = i = NEW(XonoticWinnerDialog);
163 i.configureDialog(i);
164 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
167 // dialog used by multiplayer/join
168 me.serverInfoDialog = i = NEW(XonoticServerInfoDialog);
169 i.configureDialog(i);
170 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
172 me.demostartconfirmDialog = i = NEW(XonoticDemoStartConfirmDialog);
173 i.configureDialog(i);
174 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
176 me.demotimeconfirmDialog = i = NEW(XonoticDemoTimeConfirmDialog);
177 i.configureDialog(i);
178 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
181 // dialogs used by multiplayer/create
182 me.mapInfoDialog = i = NEW(XonoticMapInfoDialog);
183 i.configureDialog(i);
184 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
186 me.mutatorsDialog = i = NEW(XonoticMutatorsDialog);
187 i.configureDialog(i);
188 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
191 i = NEW(XonoticSandboxToolsDialog);
192 i.configureDialog(i);
193 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
196 // miscellaneous dialogs
197 i = NEW(XonoticTeamSelectDialog);
198 i.configureDialog(i);
199 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
201 i = NEW(XonoticMonsterToolsDialog);
202 i.configureDialog(i);
203 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
206 // main dialogs/windows
207 me.mainNexposee = n = NEW(XonoticNexposee);
209 if(checkextension("DP_GECKO_SUPPORT"))
211 i = spawnXonoticNewsDialog();
212 i.configureDialog(i);
213 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
214 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
217 i = NEW(XonoticSingleplayerDialog);
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_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
222 i = NEW(XonoticMultiplayerDialog);
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_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
227 i = NEW(XonoticSettingsDialog);
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_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
232 i = NEW(XonoticCreditsDialog);
233 i.configureDialog(i);
234 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
235 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
236 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
238 i = NEW(XonoticQuitDialog);
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_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
242 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
244 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
245 me.moveItemAfter(me, n, NULL);
247 me.initializeDialog(me, n);
249 if(cvar_string("_cl_name") == cvar_defstring("_cl_name"))
250 me.dialogToShow = me.firstRunDialog;
254 /* Click. The c-word is here so you can grep for it :-) */