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, waypointDialog, entity, NULL)
13 ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
14 ATTRIB(MainWindow, cvarsDialog, entity, NULL)
15 ATTRIB(MainWindow, screenshotViewerDialog, 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 = spawnXonoticHUDExitDialog();
56 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
58 i = spawnXonoticHUDNotificationDialog();
60 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
62 i = spawnXonoticHUDAmmoDialog();
64 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
66 i = spawnXonoticHUDHealthArmorDialog();
68 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
70 i = spawnXonoticHUDChatDialog();
72 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
74 i = spawnXonoticHUDModIconsDialog();
76 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
78 i = spawnXonoticHUDPowerupsDialog();
80 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
82 i = spawnXonoticHUDPressedKeysDialog();
84 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
86 i = spawnXonoticHUDRaceTimerDialog();
88 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
90 i = spawnXonoticHUDRadarDialog();
92 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
94 i = spawnXonoticHUDScoreDialog();
96 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
98 i = spawnXonoticHUDTimerDialog();
100 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
102 i = spawnXonoticHUDVoteDialog();
103 i.configureDialog(i);
104 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
106 i = spawnXonoticHUDWeaponsDialog();
107 i.configureDialog(i);
108 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
110 i = spawnXonoticHUDEngineInfoDialog();
111 i.configureDialog(i);
112 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
114 i = spawnXonoticHUDInfoMessagesDialog();
115 i.configureDialog(i);
116 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
118 i = spawnXonoticHUDPhysicsDialog();
119 i.configureDialog(i);
120 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
122 me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
123 i.configureDialog(i);
124 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
126 me.advancedDialog = i = spawnXonoticAdvancedDialog();
127 i.configureDialog(i);
128 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
130 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
131 i.configureDialog(i);
132 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
134 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
135 i.configureDialog(i);
136 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
138 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
139 i.configureDialog(i);
140 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
142 me.winnerDialog = i = spawnXonoticWinnerDialog();
143 i.configureDialog(i);
144 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
146 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
147 i.configureDialog(i);
148 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
150 me.waypointDialog = i = spawnXonoticWaypointDialog();
151 i.configureDialog(i);
152 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
154 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
155 i.configureDialog(i);
156 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
158 me.cvarsDialog = i = spawnXonoticCvarsDialog();
159 i.configureDialog(i);
160 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
162 me.mainNexposee = n = spawnXonoticNexposee();
164 if(checkextension("DP_GECKO_SUPPORT"))
166 i = spawnXonoticNewsDialog();
167 i.configureDialog(i);
168 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
169 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
172 i = spawnXonoticSingleplayerDialog();
173 i.configureDialog(i);
174 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
175 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
177 i = spawnXonoticMultiplayerDialog();
178 i.configureDialog(i);
179 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
180 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
182 i = spawnXonoticSettingsDialog();
183 i.configureDialog(i);
184 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
185 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
187 i = spawnXonoticCreditsDialog();
188 i.configureDialog(i);
189 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
190 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
191 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
193 i = spawnXonoticQuitDialog();
194 i.configureDialog(i);
195 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
196 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
197 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
198 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
199 me.moveItemAfter(me, n, NULL);
201 me.initializeDialog(me, n);
203 if(cvar_string("_cl_name") == "Player")
204 me.dialogToShow = me.firstRunDialog;
208 /* Click. The c-word is here so you can grep for it :-) */