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