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, mainNexposee, entity, NULL)
16 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
17 ATTRIB(MainWindow, dialogToShow, entity, NULL)
22 void MainWindow_draw(entity me)
24 SUPER(MainWindow).draw(me);
28 DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
29 me.dialogToShow = NULL;
33 void DemoButton_Click(entity me, entity other)
35 if(me.text == _("Do not press this button again!"))
36 DialogOpenButton_Click(me, other);
38 me.setText(me, _("Do not press this button again!"));
41 void MainWindow_configureMainWindow(entity me)
45 me.firstRunDialog = i = spawnXonoticFirstRunDialog();
47 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
49 i = spawnXonoticTeamSelectDialog();
51 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
53 i = spawnXonoticHUDExitDialog();
55 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
57 i = spawnXonoticHUDNotificationDialog();
59 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
61 i = spawnXonoticHUDAmmoDialog();
63 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
65 i = spawnXonoticHUDHealthArmorDialog();
67 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
69 i = spawnXonoticHUDChatDialog();
71 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
73 i = spawnXonoticHUDModIconsDialog();
75 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
77 i = spawnXonoticHUDPowerupsDialog();
79 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
81 i = spawnXonoticHUDPressedKeysDialog();
83 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
85 i = spawnXonoticHUDRaceTimerDialog();
87 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
89 i = spawnXonoticHUDRadarDialog();
91 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
93 i = spawnXonoticHUDScoreDialog();
95 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
97 i = spawnXonoticHUDTimerDialog();
99 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
101 i = spawnXonoticHUDVoteDialog();
102 i.configureDialog(i);
103 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
105 i = spawnXonoticHUDWeaponsDialog();
106 i.configureDialog(i);
107 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
109 i = spawnXonoticHUDEngineInfoDialog();
110 i.configureDialog(i);
111 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
113 i = spawnXonoticHUDInfoMessagesDialog();
114 i.configureDialog(i);
115 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
117 me.advancedDialog = i = spawnXonoticAdvancedDialog();
118 i.configureDialog(i);
119 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
121 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
122 i.configureDialog(i);
123 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
125 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
126 i.configureDialog(i);
127 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
129 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
130 i.configureDialog(i);
131 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
133 me.winnerDialog = i = spawnXonoticWinnerDialog();
134 i.configureDialog(i);
135 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
137 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
138 i.configureDialog(i);
139 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
141 me.waypointDialog = i = spawnXonoticWaypointDialog();
142 i.configureDialog(i);
143 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
145 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
146 i.configureDialog(i);
147 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
149 me.cvarsDialog = i = spawnXonoticCvarsDialog();
150 i.configureDialog(i);
151 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
153 me.mainNexposee = n = spawnXonoticNexposee();
155 if(checkextension("DP_GECKO_SUPPORT"))
157 i = spawnXonoticNewsDialog();
158 i.configureDialog(i);
159 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
160 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
163 i = spawnXonoticSingleplayerDialog();
164 i.configureDialog(i);
165 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
166 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
168 i = spawnXonoticMultiplayerDialog();
169 i.configureDialog(i);
170 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
171 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
173 i = spawnXonoticSettingsDialog();
174 i.configureDialog(i);
175 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
176 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
178 i = spawnXonoticCreditsDialog();
179 i.configureDialog(i);
180 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
181 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
182 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
184 i = spawnXonoticQuitDialog();
185 i.configureDialog(i);
186 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
187 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
188 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
189 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
190 me.moveItemAfter(me, n, NULL);
192 me.initializeDialog(me, n);
194 if(cvar_string("_cl_name") == "Player")
195 me.dialogToShow = me.firstRunDialog;
199 /* Click. The c-word is here so you can grep for it :-) */