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)
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 i = spawnXonoticHUDCenterprintDialog();
126 i.configureDialog(i);
127 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
129 i = spawnXonoticHUDBuffsDialog();
130 i.configureDialog(i);
131 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
134 // dialogs used by settings
135 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
136 i.configureDialog(i);
137 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
139 me.cvarsDialog = i = spawnXonoticCvarsDialog();
140 i.configureDialog(i);
141 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
143 me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
144 i.configureDialog(i);
145 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
148 // dialog used by singleplayer
149 me.winnerDialog = i = spawnXonoticWinnerDialog();
150 i.configureDialog(i);
151 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
154 // dialog used by multiplayer/join
155 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
156 i.configureDialog(i);
157 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
160 // dialogs used by multiplayer/create
161 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
162 i.configureDialog(i);
163 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
165 me.advancedDialog = i = spawnXonoticAdvancedDialog();
166 i.configureDialog(i);
167 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
169 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
170 i.configureDialog(i);
171 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
174 // dialogs used by multiplayer/player setup
175 me.crosshairDialog = i = spawnXonoticCrosshairDialog();
176 i.configureDialog(i);
177 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
179 me.hudDialog = i = spawnXonoticHUDDialog();
180 i.configureDialog(i);
181 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
183 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
184 i.configureDialog(i);
185 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
187 me.modelDialog = i = spawnXonoticModelDialog();
188 i.configureDialog(i);
189 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
191 me.viewDialog = i = spawnXonoticViewDialog();
192 i.configureDialog(i);
193 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
195 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
196 i.configureDialog(i);
197 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
201 i = spawnXonoticSandboxToolsDialog();
202 i.configureDialog(i);
203 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
206 // miscellaneous dialogs
207 i = spawnXonoticTeamSelectDialog();
208 i.configureDialog(i);
209 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
211 i = spawnXonoticMonsterToolsDialog();
212 i.configureDialog(i);
213 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
216 // main dialogs/windows
217 me.mainNexposee = n = spawnXonoticNexposee();
219 if(checkextension("DP_GECKO_SUPPORT"))
221 i = spawnXonoticNewsDialog();
222 i.configureDialog(i);
223 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
224 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
227 i = spawnXonoticSingleplayerDialog();
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_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
232 i = spawnXonoticMultiplayerDialog();
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_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
237 i = spawnXonoticSettingsDialog();
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_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
242 i = spawnXonoticCreditsDialog();
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_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
246 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
248 i = spawnXonoticQuitDialog();
249 i.configureDialog(i);
250 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
251 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
252 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
254 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
255 me.moveItemAfter(me, n, NULL);
257 me.initializeDialog(me, n);
259 if(cvar_string("_cl_name") == "Player")
260 me.dialogToShow = me.firstRunDialog;
264 /* Click. The c-word is here so you can grep for it :-) */