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, hudconfirmDialog, entity, NULL)
16 ATTRIB(MainWindow, mainNexposee, entity, NULL)
17 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
18 ATTRIB(MainWindow, dialogToShow, entity, NULL)
23 void MainWindow_draw(entity me)
25 SUPER(MainWindow).draw(me);
29 DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
30 me.dialogToShow = NULL;
34 void DemoButton_Click(entity me, entity other)
36 if(me.text == _("Do not press this button again!"))
37 DialogOpenButton_Click(me, other);
39 me.setText(me, _("Do not press this button again!"));
42 void MainWindow_configureMainWindow(entity me)
46 me.firstRunDialog = i = spawnXonoticFirstRunDialog();
48 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
50 i = spawnXonoticTeamSelectDialog();
52 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
54 i = spawnXonoticSandboxToolsDialog();
56 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
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 me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
131 i.configureDialog(i);
132 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
134 me.advancedDialog = i = spawnXonoticAdvancedDialog();
135 i.configureDialog(i);
136 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
138 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
139 i.configureDialog(i);
140 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
142 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
143 i.configureDialog(i);
144 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
146 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
147 i.configureDialog(i);
148 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
150 me.winnerDialog = i = spawnXonoticWinnerDialog();
151 i.configureDialog(i);
152 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
154 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
155 i.configureDialog(i);
156 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
158 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
159 i.configureDialog(i);
160 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
162 me.cvarsDialog = i = spawnXonoticCvarsDialog();
163 i.configureDialog(i);
164 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
166 me.viewDialog = i = spawnXonoticViewDialog();
167 i.configureDialog(i);
168 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
170 me.mainNexposee = n = spawnXonoticNexposee();
172 if(checkextension("DP_GECKO_SUPPORT"))
174 i = spawnXonoticNewsDialog();
175 i.configureDialog(i);
176 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
177 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
180 i = spawnXonoticSingleplayerDialog();
181 i.configureDialog(i);
182 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
183 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
185 i = spawnXonoticMultiplayerDialog();
186 i.configureDialog(i);
187 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
188 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
190 i = spawnXonoticSettingsDialog();
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_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
195 i = spawnXonoticCreditsDialog();
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_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
199 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
201 i = spawnXonoticQuitDialog();
202 i.configureDialog(i);
203 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
204 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
205 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
207 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
208 me.moveItemAfter(me, n, NULL);
210 me.initializeDialog(me, n);
212 if(cvar_string("_cl_name") == "Player")
213 me.dialogToShow = me.firstRunDialog;
217 /* Click. The c-word is here so you can grep for it :-) */