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, hudconfirmDialog, entity, NULL)
18 ATTRIB(MainWindow, mainNexposee, entity, NULL)
19 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
20 ATTRIB(MainWindow, dialogToShow, entity, NULL)
25 void MainWindow_draw(entity me)
27 SUPER(MainWindow).draw(me);
31 DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
32 me.dialogToShow = NULL;
36 void DemoButton_Click(entity me, entity other)
38 if(me.text == _("Do not press this button again!"))
39 DialogOpenButton_Click(me, other);
41 me.setText(me, _("Do not press this button again!"));
44 void MainWindow_configureMainWindow(entity me)
48 me.firstRunDialog = i = spawnXonoticFirstRunDialog();
50 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
52 i = spawnXonoticTeamSelectDialog();
54 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
56 i = spawnXonoticSandboxToolsDialog();
58 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
60 i = spawnXonoticHUDExitDialog();
62 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
64 i = spawnXonoticHUDNotificationDialog();
66 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
68 i = spawnXonoticHUDAmmoDialog();
70 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
72 i = spawnXonoticHUDHealthArmorDialog();
74 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
76 i = spawnXonoticHUDChatDialog();
78 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
80 i = spawnXonoticHUDModIconsDialog();
82 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
84 i = spawnXonoticHUDPowerupsDialog();
86 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
88 i = spawnXonoticHUDPressedKeysDialog();
90 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
92 i = spawnXonoticHUDRaceTimerDialog();
94 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
96 i = spawnXonoticHUDRadarDialog();
98 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
100 i = spawnXonoticHUDScoreDialog();
101 i.configureDialog(i);
102 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
104 i = spawnXonoticHUDTimerDialog();
105 i.configureDialog(i);
106 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
108 i = spawnXonoticHUDVoteDialog();
109 i.configureDialog(i);
110 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
112 i = spawnXonoticHUDWeaponsDialog();
113 i.configureDialog(i);
114 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
116 i = spawnXonoticHUDEngineInfoDialog();
117 i.configureDialog(i);
118 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
120 i = spawnXonoticHUDInfoMessagesDialog();
121 i.configureDialog(i);
122 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
124 i = spawnXonoticHUDPhysicsDialog();
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 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
133 i.configureDialog(i);
134 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
136 me.advancedDialog = i = spawnXonoticAdvancedDialog();
137 i.configureDialog(i);
138 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
140 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
141 i.configureDialog(i);
142 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
144 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
145 i.configureDialog(i);
146 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
148 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
149 i.configureDialog(i);
150 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
152 me.winnerDialog = i = spawnXonoticWinnerDialog();
153 i.configureDialog(i);
154 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
156 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
157 i.configureDialog(i);
158 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
160 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
161 i.configureDialog(i);
162 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
164 me.cvarsDialog = i = spawnXonoticCvarsDialog();
165 i.configureDialog(i);
166 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
168 me.viewDialog = i = spawnXonoticViewDialog();
169 i.configureDialog(i);
170 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
172 me.modelDialog = i = spawnXonoticModelDialog();
173 i.configureDialog(i);
174 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
176 me.crosshairDialog = i = spawnXonoticCrosshairDialog();
177 i.configureDialog(i);
178 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
180 me.mainNexposee = n = spawnXonoticNexposee();
182 if(checkextension("DP_GECKO_SUPPORT"))
184 i = spawnXonoticNewsDialog();
185 i.configureDialog(i);
186 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
187 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
190 i = spawnXonoticSingleplayerDialog();
191 i.configureDialog(i);
192 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
193 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
195 i = spawnXonoticMultiplayerDialog();
196 i.configureDialog(i);
197 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
198 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
200 i = spawnXonoticSettingsDialog();
201 i.configureDialog(i);
202 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
203 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
205 i = spawnXonoticCreditsDialog();
206 i.configureDialog(i);
207 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
208 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
209 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
211 i = spawnXonoticQuitDialog();
212 i.configureDialog(i);
213 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
214 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
215 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
217 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
218 me.moveItemAfter(me, n, NULL);
220 me.initializeDialog(me, n);
222 if(cvar_string("_cl_name") == "Player")
223 me.dialogToShow = me.firstRunDialog;
227 /* Click. The c-word is here so you can grep for it :-) */