]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/mainwindow.c
00da54b59e45aabec936b3fe48141f9dce0b9fea
[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 configureMainWindowMainWindow(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         me.advancedDialog = i = spawnXonoticAdvancedDialog();
93         i.configureDialog(i);
94         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
95
96         me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
97         i.configureDialog(i);
98         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
99
100         me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
101         i.configureDialog(i);
102         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
103
104         me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
105         i.configureDialog(i);
106         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
107
108         me.winnerDialog = i = spawnXonoticWinnerDialog();
109         i.configureDialog(i);
110         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
111
112         me.weaponsDialog = i = spawnXonoticWeaponsDialog();
113         i.configureDialog(i);
114         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
115
116         me.waypointDialog = i = spawnXonoticWaypointDialog();
117         i.configureDialog(i);
118         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
119         
120         me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
121         i.configureDialog(i);
122         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
123         
124         me.cvarsDialog = i = spawnXonoticCvarsDialog();
125         i.configureDialog(i);
126         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
127         
128         me.mainNexposee = n = spawnXonoticNexposee();
129         /*
130                 if(checkextension("DP_GECKO_SUPPORT"))
131                 {
132                         i = spawnXonoticNewsDialog();
133                         i.configureDialog(i);
134                         n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
135                         n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
136                 }
137         */
138                 i = spawnXonoticSingleplayerDialog();
139                 i.configureDialog(i);
140                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
141                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
142                 
143                 i = spawnXonoticMultiplayerDialog();
144                 i.configureDialog(i);
145                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
146                 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
147
148                 i = spawnXonoticSettingsDialog();
149                 i.configureDialog(i);
150                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
151                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
152
153                 i = spawnXonoticCreditsDialog();
154                 i.configureDialog(i);
155                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
156                 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
157                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
158
159                 i = spawnXonoticQuitDialog();
160                 i.configureDialog(i);
161                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
162                 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
163                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
164         me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
165         me.moveItemAfter(me, n, NULL);
166
167         me.initializeDialog(me, n);
168 }
169 #endif
170
171 /* Click. The c-word is here so you can grep for it :-) */