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, viewDialog, entity, NULL)
15 ATTRIB(MainWindow, modelDialog, entity, NULL)
16 ATTRIB(MainWindow, crosshairDialog, entity, NULL)
17 ATTRIB(MainWindow, hudDialog, entity, NULL)
18 ATTRIB(MainWindow, hudconfirmDialog, entity, NULL)
19 ATTRIB(MainWindow, languageWarningDialog, entity, NULL)
20 ATTRIB(MainWindow, mainNexposee, entity, NULL)
21 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
22 ATTRIB(MainWindow, dialogToShow, 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 = 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 i = spawnXonoticHUDCenterprintDialog();
127 i.configureDialog(i);
128 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
130 i = spawnXonoticHUDBuffsDialog();
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);
144 me.resetDialog = i = spawnXonoticResetDialog();
145 i.configureDialog(i);
146 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
148 me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
149 i.configureDialog(i);
150 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
153 // dialog used by singleplayer
154 me.winnerDialog = i = spawnXonoticWinnerDialog();
155 i.configureDialog(i);
156 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
159 // dialog used by multiplayer/join
160 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
161 i.configureDialog(i);
162 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
165 // dialogs used by multiplayer/create
166 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
167 i.configureDialog(i);
168 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
170 me.advancedDialog = i = spawnXonoticAdvancedDialog();
171 i.configureDialog(i);
172 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
174 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
175 i.configureDialog(i);
176 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
179 // dialogs used by multiplayer/player setup
180 me.crosshairDialog = i = spawnXonoticCrosshairDialog();
181 i.configureDialog(i);
182 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
184 me.hudDialog = i = spawnXonoticHUDDialog();
185 i.configureDialog(i);
186 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
188 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
189 i.configureDialog(i);
190 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
192 me.modelDialog = i = spawnXonoticModelDialog();
193 i.configureDialog(i);
194 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
196 me.viewDialog = i = spawnXonoticViewDialog();
197 i.configureDialog(i);
198 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
200 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
201 i.configureDialog(i);
202 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);
216 i = spawnXonoticMonsterToolsDialog();
217 i.configureDialog(i);
218 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
221 // main dialogs/windows
222 me.mainNexposee = n = spawnXonoticNexposee();
224 if(checkextension("DP_GECKO_SUPPORT"))
226 i = spawnXonoticNewsDialog();
227 i.configureDialog(i);
228 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
229 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
232 i = spawnXonoticSingleplayerDialog();
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_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
237 i = spawnXonoticMultiplayerDialog();
238 i.configureDialog(i);
239 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
240 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
242 i = spawnXonoticSettingsDialog();
243 i.configureDialog(i);
244 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
245 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
247 i = spawnXonoticCreditsDialog();
248 i.configureDialog(i);
249 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
250 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
251 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
253 i = spawnXonoticQuitDialog();
254 i.configureDialog(i);
255 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
256 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
257 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
259 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
260 me.moveItemAfter(me, n, NULL);
262 me.initializeDialog(me, n);
264 if(cvar_string("_cl_name") == "Player")
265 me.dialogToShow = me.firstRunDialog;
269 /* Click. The c-word is here so you can grep for it :-) */