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