2 CLASS(MainWindow) EXTENDS(ModalController)
3 METHOD(MainWindow, configureMainWindow, void(entity))
4 ATTRIB(MainWindow, screenshotViewerDialog, entity, NULL)
5 ATTRIB(MainWindow, advancedDialog, entity, NULL)
6 ATTRIB(MainWindow, mutatorsDialog, entity, NULL)
7 ATTRIB(MainWindow, weaponsDialog, entity, NULL)
8 ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
9 ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
10 ATTRIB(MainWindow, winnerDialog, entity, NULL)
11 ATTRIB(MainWindow, waypointDialog, entity, NULL)
12 ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
13 ATTRIB(MainWindow, cvarsDialog, entity, NULL)
14 ATTRIB(MainWindow, mainNexposee, entity, NULL)
15 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
21 void DemoButton_Click(entity me, entity other)
23 if(me.text == "Do not press this button again!")
24 DialogOpenButton_Click(me, other);
26 me.setText(me, "Do not press this button again!");
29 void MainWindow_configureMainWindow(entity me)
33 i = spawnXonoticTeamSelectDialog();
35 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
37 i = spawnXonoticHUDExitDialog();
39 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
41 i = spawnXonoticHUDNotificationDialog();
43 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
45 i = spawnXonoticHUDAmmoDialog();
47 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
49 i = spawnXonoticHUDHealthArmorDialog();
51 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
53 i = spawnXonoticHUDChatDialog();
55 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
57 i = spawnXonoticHUDModIconsDialog();
59 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
61 i = spawnXonoticHUDPowerupsDialog();
63 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
65 i = spawnXonoticHUDPressedKeysDialog();
67 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
69 i = spawnXonoticHUDRaceTimerDialog();
71 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
73 i = spawnXonoticHUDRadarDialog();
75 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
77 i = spawnXonoticHUDScoreDialog();
79 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
81 i = spawnXonoticHUDTimerDialog();
83 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
85 i = spawnXonoticHUDVoteDialog();
87 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
89 i = spawnXonoticHUDWeaponsDialog();
91 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
93 i = spawnXonoticHUDEngineInfoDialog();
95 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
97 i = spawnXonoticHUDInfoMessagesDialog();
99 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
101 me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
102 i.configureDialog(i);
103 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
105 me.advancedDialog = i = spawnXonoticAdvancedDialog();
106 i.configureDialog(i);
107 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
109 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
110 i.configureDialog(i);
111 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
113 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
114 i.configureDialog(i);
115 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
117 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
118 i.configureDialog(i);
119 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
121 me.winnerDialog = i = spawnXonoticWinnerDialog();
122 i.configureDialog(i);
123 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
125 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
126 i.configureDialog(i);
127 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
129 me.waypointDialog = i = spawnXonoticWaypointDialog();
130 i.configureDialog(i);
131 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
133 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
134 i.configureDialog(i);
135 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
137 me.cvarsDialog = i = spawnXonoticCvarsDialog();
138 i.configureDialog(i);
139 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
141 me.mainNexposee = n = spawnXonoticNexposee();
143 if(checkextension("DP_GECKO_SUPPORT"))
145 i = spawnXonoticNewsDialog();
146 i.configureDialog(i);
147 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
148 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
151 i = spawnXonoticSingleplayerDialog();
152 i.configureDialog(i);
153 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
154 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
156 i = spawnXonoticMultiplayerDialog();
157 i.configureDialog(i);
158 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
159 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
161 i = spawnXonoticSettingsDialog();
162 i.configureDialog(i);
163 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
164 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
166 i = spawnXonoticCreditsDialog();
167 i.configureDialog(i);
168 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
169 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
170 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
172 i = spawnXonoticQuitDialog();
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_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
176 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
177 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
178 me.moveItemAfter(me, n, NULL);
180 me.initializeDialog(me, n);
184 /* Click. The c-word is here so you can grep for it :-) */