Xonotic
dialog_settings_game_crosshair.qc
Go to the documentation of this file.
2 
3 #include "radiobutton.qh"
4 #include "crosshairpicker.qh"
5 #include "crosshairpreview.qh"
6 #include "textlabel.qh"
7 #include "slider.qh"
8 #include "colorpicker_string.qh"
9 #include "checkbox.qh"
10 #include "textslider.qh"
11 
13 {
14  loadAllCvars(me);
15 }
17 {
18  entity me;
20  me.configureDialog(me);
21  return me;
22 }
23 
25 {
26  entity e;
27 
28  // crosshair_enabled: 0 = no crosshair options, 1 = no crosshair selection, but everything else enabled, 2 = all crosshair options enabled
29  // FIXME: In the future, perhaps make one global crosshair_type cvar which has 0 for disabled, 1 for custom, 2 for per weapon, etc?
30  me.TR(me); //me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
31  me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "0", _("No crosshair")));
32  //me.TR(me);
33  me.TD(me, 1, 1, e = makeXonoticRadioButton_T(3, "crosshair_per_weapon", string_null, _("Per weapon"),
34  _("Set a different crosshair for each weapon, good if you play without weapon models")));
35  makeMulti(e, "crosshair_enabled");
36  //me.TR(me);
37  me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "2", _("Custom")));
38  me.TR(me);
39  me.TDempty(me, 0.1);
40  me.TD(me, 3, 2, e = makeXonoticCrosshairPicker());
41  setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
42  me.TD(me, 3, 0.9, e = makeXonoticCrosshairPreview());
43  setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
44  me.TR(me);
45  me.TR(me);
46  me.TR(me);
47  me.TDempty(me, 0.1);
48  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
49  setDependent(e, "crosshair_enabled", 1, 2);
50  me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size"));
51  setDependent(e, "crosshair_enabled", 1, 2);
52  me.TR(me);
53  me.TDempty(me, 0.1);
54  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Alpha:")));
55  setDependent(e, "crosshair_enabled", 1, 2);
56  me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
57  setDependent(e, "crosshair_enabled", 1, 2);
58  me.TR(me);
59  me.TDempty(me, 0.1);
60  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color:")));
61  setDependent(e, "crosshair_enabled", 1, 2);
62  me.TD(me, 1, 0.9, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon")));
63  setDependent(e, "crosshair_enabled", 1, 2);
64  me.TD(me, 1, 1, e = makeXonoticRadioButton(5, "crosshair_color_special", "2", _("By health")));
65  setDependent(e, "crosshair_enabled", 1, 2);
66  me.TR(me);
67  me.TDempty(me, 0.2);
68  me.TD(me, 1, 0.8, e = makeXonoticRadioButton(5, "crosshair_color_special", "0", _("Custom")));
69  setDependent(e, "crosshair_enabled", 1, 2);
70  me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
71  setDependentAND(e, "crosshair_color_special", 0, 0, "crosshair_enabled", 1, 2);
72  me.TR(me);
73  me.TR(me);
74  me.TR(me);
75  me.TDempty(me, 0.1);
76  me.TD(me, 1, 2.9, e = makeXonoticCheckBox_T(0, "crosshair_ring", _("Use rings to indicate weapon status"), "-"));
77  makeMulti(e, "crosshair_ring_reload");
78  setDependent(e, "crosshair_enabled", 1, 2);
79  me.TR(me);
80  me.TDempty(me, 0.3);
81  me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Size:")));
82  setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
83  me.TD(me, 1, 1.8, e = makeXonoticSlider(2, 4, 0.1, "crosshair_ring_size"));
84  setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
85  me.TR(me);
86  me.TDempty(me, 0.3);
87  me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Alpha:")));
88  setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
89  me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
90  setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
91 
92  me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
93  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
94  setDependent(e, "crosshair_enabled", 1, 2);
95  me.TR(me);
96  me.TDempty(me, 0.1);
97  me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Size:")));
98  setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
99  me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
100  setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
101  me.TR(me);
102  me.TDempty(me, 0.1);
103  me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Alpha:")));
104  setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
105  me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
106  setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
107  me.TR(me);
108  me.TDempty(me, 0.1);
109  me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Color:")));
110  setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
111  me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color")));
112  setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
113  me.TR(me);
114  me.TDempty(me, 0.2);
115  me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
116  setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
117  me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
118  setDependentAND3(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2, "crosshair_dot_color_custom", 1, 1);
119  me.TR(me);
120  me.TR(me);
121  me.TR(me);
122  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
123  setDependent(e, "crosshair_enabled", 1, 2);
124  me.TR(me);
125  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_hittest", _("Perform hit tests for the crosshair")));
126  setDependent(e, "crosshair_enabled", 1, 2);
127  me.TR(me);
128  me.TDempty(me, 0.1);
129  me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_hittest_blur_wall", _("Blur if obstructed by an obstacle")));
130  setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
131  me.TR(me);
132  me.TDempty(me, 0.1);
133  me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_hittest_blur_teammate", _("Blur if obstructed by a teammate")));
134  setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
135  me.TR(me);
136  me.TDempty(me, 0.1);
137  me.TD(me, 1, 2.9, e = makeXonoticCheckBoxEx(1.25, 1, "crosshair_hittest", _("Shrink if obstructed by a teammate")));
138  setDependentAND(e, "crosshair_enabled", 1, 2, "crosshair_hittest", 1, 100);
139  me.TR(me);
140  me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy")));
141  setDependent(e, "crosshair_enabled", 1, 2);
142  me.TR(me);
143  me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item")));
144  setDependent(e, "crosshair_enabled", 1, 2);
145 }
string string_null
Definition: nil.qh:9
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
Definition: checkbox.qc:40
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
Definition: radiobutton.qc:10
entity makeXonoticCrosshairPreview()
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
entity makeXonoticRadioButton_T(float theGroup, string theCvar, string theValue, string theText, string theTooltip)
Definition: radiobutton.qc:3
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition: slider.qc:10
void XonoticGameCrosshairSettingsTab_fill(entity me)
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition: checkbox.qc:3
void XonoticGameCrosshairSettingsTab_showNotify(entity me)
entity makeXonoticCrosshairPicker()
entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar)
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
entity makeXonoticGameCrosshairSettingsTab()