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 i = spawnXonoticHUDPhysicsDialog();
101 i.configureDialog(i);
102 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
104 me.advancedDialog = i = spawnXonoticAdvancedDialog();
105 i.configureDialog(i);
106 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
108 me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
109 i.configureDialog(i);
110 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
112 me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
113 i.configureDialog(i);
114 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
116 me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
117 i.configureDialog(i);
118 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
120 me.winnerDialog = i = spawnXonoticWinnerDialog();
121 i.configureDialog(i);
122 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
124 me.weaponsDialog = i = spawnXonoticWeaponsDialog();
125 i.configureDialog(i);
126 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
128 me.waypointDialog = i = spawnXonoticWaypointDialog();
129 i.configureDialog(i);
130 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
132 me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
133 i.configureDialog(i);
134 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
136 me.cvarsDialog = i = spawnXonoticCvarsDialog();
137 i.configureDialog(i);
138 me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
140 me.mainNexposee = n = spawnXonoticNexposee();
142 if(checkextension("DP_GECKO_SUPPORT"))
144 i = spawnXonoticNewsDialog();
145 i.configureDialog(i);
146 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
147 n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
150 i = spawnXonoticSingleplayerDialog();
151 i.configureDialog(i);
152 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
153 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
155 i = spawnXonoticMultiplayerDialog();
156 i.configureDialog(i);
157 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
158 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
160 i = spawnXonoticSettingsDialog();
161 i.configureDialog(i);
162 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
163 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
165 i = spawnXonoticCreditsDialog();
166 i.configureDialog(i);
167 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
168 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
169 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
171 i = spawnXonoticQuitDialog();
172 i.configureDialog(i);
173 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
174 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
175 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
176 me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
177 me.moveItemAfter(me, n, NULL);
179 me.initializeDialog(me, n);
183 /* Click. The c-word is here so you can grep for it :-) */