]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/nexuiz/mainwindow.c
support for pointer warping
[divverent/nexuiz.git] / data / qcsrc / menu / nexuiz / mainwindow.c
1 #ifdef INTERFACE
2 CLASS(MainWindow) EXTENDS(ModalController)
3         METHOD(MainWindow, configureMainWindow, void(entity))
4         ATTRIB(MainWindow, mutatorsDialog, entity, NULL)
5         ATTRIB(MainWindow, weaponsDialog, entity, NULL)
6         ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
7         ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
8         ATTRIB(MainWindow, winnerDialog, entity, NULL)
9         ATTRIB(MainWindow, radarDialog, entity, NULL)
10         ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
11         ATTRIB(MainWindow, cvarsDialog, entity, NULL)
12         ATTRIB(MainWindow, mainNexposee, entity, NULL)
13         ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
14 ENDCLASS(MainWindow)
15 #endif
16
17 #ifdef IMPLEMENTATION
18
19 void DemoButton_Click(entity me, entity other)
20 {
21         if(me.text == "Do not press this button again!")
22                 DialogOpenButton_Click(me, other);
23         else
24                 me.setText(me, "Do not press this button again!");
25 }
26
27 void configureMainWindowMainWindow(entity me)
28 {
29         entity n, i;
30
31         i = spawnNexuizTeamSelectDialog();
32         i.configureDialog(i);
33         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
34
35         me.mutatorsDialog = i = spawnNexuizMutatorsDialog();
36         i.configureDialog(i);
37         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
38
39         me.mapInfoDialog = i = spawnNexuizMapInfoDialog();
40         i.configureDialog(i);
41         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
42
43         me.userbindEditDialog = i = spawnNexuizUserbindEditDialog();
44         i.configureDialog(i);
45         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
46
47         me.winnerDialog = i = spawnNexuizWinnerDialog();
48         i.configureDialog(i);
49         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
50
51         me.weaponsDialog = i = spawnNexuizWeaponsDialog();
52         i.configureDialog(i);
53         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
54
55         me.radarDialog = i = spawnNexuizRadarDialog();
56         i.configureDialog(i);
57         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
58         
59         me.serverInfoDialog = i = spawnNexuizServerInfoDialog();
60         i.configureDialog(i);
61         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
62         
63         me.cvarsDialog = i = spawnNexuizCvarsDialog();
64         i.configureDialog(i);
65         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
66         
67         me.mainNexposee = n = spawnNexuizNexposee();
68         /*
69                 if(checkextension("DP_GECKO_SUPPORT"))
70                 {
71                         i = spawnNexuizNewsDialog();
72                         i.configureDialog(i);
73                         n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
74                         n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
75                 }
76         */
77                 i = spawnNexuizSingleplayerDialog();
78                 i.configureDialog(i);
79                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
80                 n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
81                 
82                 i = spawnNexuizMultiplayerDialog();
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_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
86
87                 i = spawnNexuizSettingsDialog();
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_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
91
92                 i = spawnNexuizCreditsDialog();
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_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
96                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
97
98                 i = spawnNexuizQuitDialog();
99                 i.configureDialog(i);
100                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
101                 n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
102                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
103         me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
104         me.moveItemAfter(me, n, NULL);
105
106         me.initializeDialog(me, n);
107 }
108 #endif
109
110 // click. The C-word so you can grep for it.