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, mainNexposee, entity, NULL)
20 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
21 ATTRIB(MainWindow, dialogToShow, 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 i = spawnXonoticHUDCenterprintDialog();
125 i.configureDialog(i);
126 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
129 // dialogs used by settings
130 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
131 i.configureDialog(i);
132 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
134 me.cvarsDialog = i = spawnXonoticCvarsDialog();
135 i.configureDialog(i);
136 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
139 // dialog used by singleplayer
140 me.winnerDialog = i = spawnXonoticWinnerDialog();
141 i.configureDialog(i);
142 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
145 // dialog used by multiplayer/join
146 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
147 i.configureDialog(i);
148 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
151 // dialogs used by multiplayer/create
152 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
153 i.configureDialog(i);
154 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
156 me.advancedDialog = i = spawnXonoticAdvancedDialog();
157 i.configureDialog(i);
158 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
160 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
161 i.configureDialog(i);
162 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
165 // dialogs used by multiplayer/player setup
166 me.crosshairDialog = i = spawnXonoticCrosshairDialog();
167 i.configureDialog(i);
168 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
170 me.hudDialog = i = spawnXonoticHUDDialog();
171 i.configureDialog(i);
172 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
174 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
175 i.configureDialog(i);
176 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
178 me.modelDialog = i = spawnXonoticModelDialog();
179 i.configureDialog(i);
180 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
182 me.viewDialog = i = spawnXonoticViewDialog();
183 i.configureDialog(i);
184 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
186 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
187 i.configureDialog(i);
188 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
192 i = spawnXonoticSandboxToolsDialog();
193 i.configureDialog(i);
194 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
197 // miscellaneous dialogs
198 i = spawnXonoticTeamSelectDialog();
199 i.configureDialog(i);
200 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
203 // main dialogs/windows
204 me.mainNexposee = n = spawnXonoticNexposee();
206 if(checkextension("DP_GECKO_SUPPORT"))
208 i = spawnXonoticNewsDialog();
209 i.configureDialog(i);
210 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
211 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
214 i = spawnXonoticSingleplayerDialog();
215 i.configureDialog(i);
216 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
217 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
219 i = spawnXonoticMultiplayerDialog();
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_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
224 i = spawnXonoticSettingsDialog();
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_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
229 i = spawnXonoticCreditsDialog();
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_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
233 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
235 i = spawnXonoticQuitDialog();
236 i.configureDialog(i);
237 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
238 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
239 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
241 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
242 me.moveItemAfter(me, n, NULL);
244 me.initializeDialog(me, n);
246 if(cvar_string("_cl_name") == "Player")
247 me.dialogToShow = me.firstRunDialog;
251 /* Click. The c-word is here so you can grep for it :-) */