]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c
-scmenu; make mapinfo default
[divverent/nexuiz.git] / data / qcsrc / menu / nexuiz / dialog_multiplayer_create_mutators.c
1 #ifdef INTERFACE
2 CLASS(NexuizMutatorsDialog) EXTENDS(NexuizDialog)
3         METHOD(NexuizMutatorsDialog, toString, string(entity))
4         METHOD(NexuizMutatorsDialog, fill, void(entity))
5         METHOD(NexuizMutatorsDialog, showNotify, void(entity))
6         METHOD(NexuizMutatorsDialog, close, void(entity))
7         ATTRIB(NexuizMutatorsDialog, title, string, "Mutators")
8         ATTRIB(NexuizMutatorsDialog, color, vector, SKINCOLOR_DIALOG_MUTATORS)
9         ATTRIB(NexuizMutatorsDialog, intendedWidth, float, 0.6)
10         ATTRIB(NexuizMutatorsDialog, rows, float, 9)
11         ATTRIB(NexuizMutatorsDialog, columns, float, 4)
12         ATTRIB(NexuizMutatorsDialog, refilterEntity, entity, NULL)
13 ENDCLASS(NexuizMutatorsDialog)
14 #endif
15
16 #ifdef IMPLEMENTATION
17 void showNotifyNexuizMutatorsDialog(entity me)
18 {
19         loadAllCvars(me);
20 }
21 string toStringNexuizMutatorsDialog(entity me)
22 {
23         string s;
24         s = "";
25         if(cvar("g_instagib"))
26                 s = strcat(s, ", InstaGib");
27         if(cvar("g_minstagib"))
28                 s = strcat(s, ", MinstaGib");
29         if(cvar("g_nixnex"))
30                 s = strcat(s, ", NixNex");
31         if(cvar("g_rocketarena"))
32                 s = strcat(s, ", RL arena");
33         if(cvar("sv_gravity") < 800)
34                 s = strcat(s, ", Low gravity");
35         if(cvar("g_cloaked"))
36                 s = strcat(s, ", Cloaked");
37         if(cvar("g_footsteps"))
38                 s = strcat(s, ", Steps");
39         if(cvar("g_grappling_hook"))
40                 s = strcat(s, ", Hook");
41         if(cvar("g_laserguided_missile"))
42                 s = strcat(s, ", LG missiles");
43         if(cvar("g_midair"))
44                 s = strcat(s, ", Mid-air");
45         if(cvar("g_vampire"))
46                 s = strcat(s, ", Vampire");
47         if(s == "")
48                 return "None";
49         else
50                 return substring(s, 2, strlen(s) - 2);
51 }
52 void fillNexuizMutatorsDialog(entity me)
53 {
54         entity e, s;
55         me.TR(me);
56                 me.TD(me, 1, 2, makeNexuizTextLabel(0, "Game mutators:"));
57         me.TR(me);
58                 me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_cloaked", "Cloaked"));
59         me.TR(me);
60                 me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_footsteps", "Foot steps"));
61         me.TR(me);
62                 me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_grappling_hook", "Grappling hook"));
63         me.TR(me);
64                 me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_laserguided_missile", "Laser guided missiles"));
65         me.TR(me);
66                 me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_midair", "Mid-air"));
67         me.TR(me);
68                 me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_vampire", "Vampire"));
69
70         me.gotoXY(me, 0, 2); me.setFirstColumn(me, me.currentColumn);
71                 me.TD(me, 1, 2, makeNexuizTextLabel(0, "Arena mutators:"));
72         me.TR(me);
73                 me.TD(me, 1, 2, e = makeNexuizRadioButton(1, string_null, string_null, "Regular"));
74         me.TR(me);
75                 me.TD(me, 1, 2, e = makeNexuizRadioButton(1, "g_instagib", string_null, "InstaGib"));
76         me.TR(me);
77                 me.TD(me, 1, 2, e = makeNexuizRadioButton(1, "g_minstagib", string_null, "MinstaGib"));
78         me.TR(me);
79                 me.TD(me, 1, 2, e = makeNexuizRadioButton(1, "g_nixnex", string_null, "NixNex"));
80         me.TR(me);
81                 me.TDempty(me, 0.2);
82                 me.TD(me, 1, 1.8, e = makeNexuizCheckBox(1, "g_nixnex_with_laser", "with laser"));
83                         setDependent(e, "g_nixnex", 1, 1);
84         me.TR(me);
85                 me.TD(me, 1, 2, e = makeNexuizRadioButton(1, "g_rocketarena", string_null, "Rocket launcher arena"));
86
87         me.gotoXY(me, me.rows - 2, 0);
88                 s = makeNexuizSlider(80, 400, 8, "sv_gravity");
89                         s.valueDigits = 0;
90                         s.valueDisplayMultiplier = 0.125; // show gravity in percent
91                 me.TD(me, 1, 1, e = makeNexuizSliderCheckBox(800, 1, s, "Low gravity"));
92                         e.savedValue = 200; // good on silvercity
93                 me.TD(me, 1, 3, s);
94
95         me.gotoXY(me, me.rows - 1, 0);
96                 me.TD(me, 1, me.columns, e = makeNexuizButton("OK", '0 0 0'));
97                         e.onClick = Dialog_Close;
98                         e.onClickEntity = me;
99 }
100
101 void closeNexuizMutatorsDialog(entity me)
102 {
103         if(me.refilterEntity)
104                 me.refilterEntity.refilter(me.refilterEntity);
105         closeDialog(me);
106 }
107 #endif