]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/mainwindow.c
Merge remote branch 'origin/fruitiex/fruitbalance' into divVerent/fruitbalance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / mainwindow.c
1 #ifdef INTERFACE
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)
15 ENDCLASS(MainWindow)
16 #endif
17
18 #ifdef IMPLEMENTATION
19
20 void DemoButton_Click(entity me, entity other)
21 {
22         if(me.text == "Do not press this button again!")
23                 DialogOpenButton_Click(me, other);
24         else
25                 me.setText(me, "Do not press this button again!");
26 }
27
28 void MainWindow_configureMainWindow(entity me)
29 {
30         entity n, i;
31
32         i = spawnXonoticTeamSelectDialog();
33         i.configureDialog(i);
34         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
35         
36         i = spawnXonoticHUDExitDialog();
37         i.configureDialog(i);
38         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
39         
40         i = spawnXonoticHUDNotificationDialog();
41         i.configureDialog(i);
42         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
43         
44         i = spawnXonoticHUDInventoryDialog();
45         i.configureDialog(i);
46         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
47         
48         i = spawnXonoticHUDHealthArmorDialog();
49         i.configureDialog(i);
50         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
51         
52         i = spawnXonoticHUDChatDialog();
53         i.configureDialog(i);
54         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
55         
56         i = spawnXonoticHUDModIconsDialog();
57         i.configureDialog(i);
58         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
59         
60         i = spawnXonoticHUDPowerupsDialog();
61         i.configureDialog(i);
62         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
63         
64         i = spawnXonoticHUDPressedKeysDialog();
65         i.configureDialog(i);
66         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
67         
68         i = spawnXonoticHUDRaceTimerDialog();
69         i.configureDialog(i);
70         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
71         
72         i = spawnXonoticHUDRadarDialog();
73         i.configureDialog(i);
74         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
75         
76         i = spawnXonoticHUDScoreDialog();
77         i.configureDialog(i);
78         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
79         
80         i = spawnXonoticHUDTimerDialog();
81         i.configureDialog(i);
82         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
83         
84         i = spawnXonoticHUDVoteDialog();
85         i.configureDialog(i);
86         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
87         
88         i = spawnXonoticHUDWeaponIconsDialog();
89         i.configureDialog(i);
90         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
91
92         i = spawnXonoticHUDEngineInfoDialog();
93         i.configureDialog(i);
94         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
95
96         i = spawnXonoticHUDInfoMessagesDialog();
97         i.configureDialog(i);
98         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
99
100         me.advancedDialog = i = spawnXonoticAdvancedDialog();
101         i.configureDialog(i);
102         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
103
104         me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
105         i.configureDialog(i);
106         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
107
108         me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
109         i.configureDialog(i);
110         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
111
112         me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
113         i.configureDialog(i);
114         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
115
116         me.winnerDialog = i = spawnXonoticWinnerDialog();
117         i.configureDialog(i);
118         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
119
120         me.weaponsDialog = i = spawnXonoticWeaponsDialog();
121         i.configureDialog(i);
122         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
123
124         me.waypointDialog = i = spawnXonoticWaypointDialog();
125         i.configureDialog(i);
126         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
127         
128         me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
129         i.configureDialog(i);
130         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
131         
132         me.cvarsDialog = i = spawnXonoticCvarsDialog();
133         i.configureDialog(i);
134         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
135         
136         me.mainNexposee = n = spawnXonoticNexposee();
137         /*
138                 if(checkextension("DP_GECKO_SUPPORT"))
139                 {
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);
144                 }
145         */
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);
150                 
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);
155
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);
160
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));
166
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);
174
175         me.initializeDialog(me, n);
176 }
177 #endif
178
179 /* Click. The c-word is here so you can grep for it :-) */