]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/mainwindow.c
Merge commit 'origin/fruitiex/newpanelhud' into diabolik/newpanelhud
[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 = spawnXonoticHUDOptionsDialog();
41         i.configureDialog(i);
42         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
43
44         me.advancedDialog = i = spawnXonoticAdvancedDialog();
45         i.configureDialog(i);
46         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
47
48         me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
49         i.configureDialog(i);
50         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
51
52         me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
53         i.configureDialog(i);
54         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
55
56         me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
57         i.configureDialog(i);
58         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
59
60         me.winnerDialog = i = spawnXonoticWinnerDialog();
61         i.configureDialog(i);
62         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
63
64         me.weaponsDialog = i = spawnXonoticWeaponsDialog();
65         i.configureDialog(i);
66         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
67
68         me.waypointDialog = i = spawnXonoticWaypointDialog();
69         i.configureDialog(i);
70         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
71         
72         me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
73         i.configureDialog(i);
74         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
75         
76         me.cvarsDialog = i = spawnXonoticCvarsDialog();
77         i.configureDialog(i);
78         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
79         
80         me.mainNexposee = n = spawnXonoticNexposee();
81         /*
82                 if(checkextension("DP_GECKO_SUPPORT"))
83                 {
84                         i = spawnXonoticNewsDialog();
85                         i.configureDialog(i);
86                         n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
87                         n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
88                 }
89         */
90                 i = spawnXonoticSingleplayerDialog();
91                 i.configureDialog(i);
92                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
93                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
94                 
95                 i = spawnXonoticMultiplayerDialog();
96                 i.configureDialog(i);
97                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
98                 n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
99
100                 i = spawnXonoticSettingsDialog();
101                 i.configureDialog(i);
102                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
103                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
104
105                 i = spawnXonoticCreditsDialog();
106                 i.configureDialog(i);
107                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
108                 n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
109                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
110
111                 i = spawnXonoticQuitDialog();
112                 i.configureDialog(i);
113                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
114                 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
115                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
116         me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
117         me.moveItemAfter(me, n, NULL);
118
119         me.initializeDialog(me, n);
120 }
121 #endif
122
123 /* Click. The c-word is here so you can grep for it :-) */