2 CLASS(MainWindow) EXTENDS(ModalController)
3 METHOD(MainWindow, configureMainWindow, void(entity))
4 ATTRIB(MainWindow, advancedDialog, entity, NULL)
5 ATTRIB(MainWindow, mutatorsDialog, entity, NULL)
6 ATTRIB(MainWindow, weaponsDialog, entity, NULL)
7 ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
8 ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
9 ATTRIB(MainWindow, winnerDialog, entity, NULL)
10 ATTRIB(MainWindow, waypointDialog, entity, NULL)
11 ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
12 ATTRIB(MainWindow, cvarsDialog, entity, NULL)
13 ATTRIB(MainWindow, mainNexposee, entity, NULL)
14 ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
20 void DemoButton_Click(entity me, entity other)
22 if(me.text == "Do not press this button again!")
23 DialogOpenButton_Click(me, other);
25 me.setText(me, "Do not press this button again!");
28 void MainWindow_configureMainWindow(entity me)
32 i = spawnXonoticTeamSelectDialog();
34 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
36 i = spawnXonoticHUDExitDialog();
38 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
40 i = spawnXonoticHUDNotificationDialog();
42 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
44 i = spawnXonoticHUDAmmoDialog();
46 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
48 i = spawnXonoticHUDHealthArmorDialog();
50 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
52 i = spawnXonoticHUDChatDialog();
54 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
56 i = spawnXonoticHUDModIconsDialog();
58 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
60 i = spawnXonoticHUDPowerupsDialog();
62 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
64 i = spawnXonoticHUDPressedKeysDialog();
66 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
68 i = spawnXonoticHUDRaceTimerDialog();
70 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
72 i = spawnXonoticHUDRadarDialog();
74 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
76 i = spawnXonoticHUDScoreDialog();
78 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
80 i = spawnXonoticHUDTimerDialog();
82 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
84 i = spawnXonoticHUDVoteDialog();
86 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
88 i = spawnXonoticHUDWeaponsDialog();
90 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
92 i = spawnXonoticHUDEngineInfoDialog();
94 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
96 i = spawnXonoticHUDInfoMessagesDialog();
98 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
100 me.advancedDialog = i = spawnXonoticAdvancedDialog();
101 i.configureDialog(i);
102 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
104 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
105 i.configureDialog(i);
106 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
108 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
109 i.configureDialog(i);
110 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
112 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
113 i.configureDialog(i);
114 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
116 me.winnerDialog = i = spawnXonoticWinnerDialog();
117 i.configureDialog(i);
118 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
120 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
121 i.configureDialog(i);
122 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
124 me.waypointDialog = i = spawnXonoticWaypointDialog();
125 i.configureDialog(i);
126 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
128 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
129 i.configureDialog(i);
130 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
132 me.cvarsDialog = i = spawnXonoticCvarsDialog();
133 i.configureDialog(i);
134 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
136 me.mainNexposee = n = spawnXonoticNexposee();
138 if(checkextension("DP_GECKO_SUPPORT"))
140 i = spawnXonoticNewsDialog();
141 i.configureDialog(i);
142 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
143 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
146 i = spawnXonoticSingleplayerDialog();
147 i.configureDialog(i);
148 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
149 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
151 i = spawnXonoticMultiplayerDialog();
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_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
156 i = spawnXonoticSettingsDialog();
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_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
161 i = spawnXonoticCreditsDialog();
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_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
165 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
167 i = spawnXonoticQuitDialog();
168 i.configureDialog(i);
169 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
170 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
171 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
172 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
173 me.moveItemAfter(me, n, NULL);
175 me.initializeDialog(me, n);
179 /* Click. The c-word is here so you can grep for it :-) */