]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/nexuiz/mainwindow.c
better support odd resolutions (like widescreen)
[divverent/nexuiz.git] / data / qcsrc / menu-div0test / 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, mapInfoDialog, entity, NULL)
6         ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
7         ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
8 ENDCLASS(MainWindow)
9 #endif
10
11 #ifdef IMPLEMENTATION
12
13 void DemoButton_Click(entity me, entity other)
14 {
15         if(me.text == "Do not press this button again!")
16                 DialogOpenButton_Click(me, other);
17         else
18                 me.setText(me, "Do not press this button again!");
19 }
20
21 void configureMainWindowMainWindow(entity me)
22 {
23         entity n, i;
24
25         i = spawnNexuizTeamSelectDialog();
26         i.configureDialog(i);
27         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
28
29         me.mutatorsDialog = i = spawnNexuizMutatorsDialog();
30         i.configureDialog(i);
31         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
32
33         me.mapInfoDialog = i = spawnNexuizMapInfoDialog();
34         i.configureDialog(i);
35         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
36
37         me.userbindEditDialog = i = spawnNexuizUserbindEditDialog();
38         i.configureDialog(i);
39         me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
40
41         n = spawnNexuizNexposee();
42                 if(checkextension("DP_GECKO_SUPPORT"))
43                 {
44                         i = spawnNexuizNewsDialog();
45                         i.configureDialog(i);
46                         n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
47                         n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
48                 }
49                 
50                 i = spawnNexuizSettingsDialog();
51                 i.configureDialog(i);
52                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
53                 n.setNexposee(n, i, '0.1 0.9 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
54
55                 i = spawnNexuizMultiplayerDialog();
56                 i.configureDialog(i);
57                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
58                 n.setNexposee(n, i, '0.9 0.5 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
59
60                 i = spawnNexuizQuitDialog();
61                 i.configureDialog(i);
62                 n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
63                 n.setNexposee(n, i, '0.9 1.2 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
64                 n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
65         me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
66         me.moveItemAfter(me, n, NULL);
67
68         me.initializeDialog(me, n);
69 }
70 #endif
71
72 // click. The C-word so you can grep for it.