Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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"
9#include "checkbox.qh"
10
16{
18 me.configureDialog(me);
19 return me;
20}
21
23{
24 entity e;
25
26 me.TR(me);
27 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Crosshair")));
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);
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.2);
40 me.TD(me, 3, 2, e = makeXonoticCrosshairPicker());
41 setDependentNOT(e, "crosshair_alpha", 0);
42 setDependentAND(e, "crosshair_per_weapon", 0, 0);
43 setDependentAND(e, "crosshair_enabled", 1, 2);
44 me.TD(me, 3, 0.8, e = makeXonoticCrosshairPreview());
45 setDependentNOT(e, "crosshair_alpha", 0);
46 setDependentAND(e, "crosshair_per_weapon", 0, 0);
47 setDependentAND(e, "crosshair_enabled", 1, 2);
48 me.TR(me);
49 me.TR(me);
50 me.TR(me);
51 me.TDempty(me, 0.2);
52 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
53 setDependentNOT(e, "crosshair_alpha", 0);
54 setDependentAND(e, "crosshair_enabled", 1, 2);
55 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size"));
56 setDependentNOT(e, "crosshair_alpha", 0);
57 setDependentAND(e, "crosshair_enabled", 1, 2);
58 me.TR(me);
59 me.TDempty(me, 0.2);
60 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Opacity:")));
61 setDependent(e, "crosshair_enabled", 1, 2);
62 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_alpha"));
63 e.formatString = "%";
64 setDependent(e, "crosshair_enabled", 1, 2);
65 me.TR(me);
66 me.TDempty(me, 0.2);
67 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color:")));
68 setDependentNOT(e, "crosshair_alpha", 0);
69 setDependentAND(e, "crosshair_enabled", 1, 2);
70 me.TD(me, 1, 1.8/2, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon")));
71 setDependentNOT(e, "crosshair_alpha", 0);
72 setDependentAND(e, "crosshair_enabled", 1, 2);
73 me.TD(me, 1, 1.8/2, e = makeXonoticRadioButton(5, "crosshair_color_special", "2", _("By health")));
74 setDependentNOT(e, "crosshair_alpha", 0);
75 setDependentAND(e, "crosshair_enabled", 1, 2);
76 me.TR(me);
77 me.TDempty(me, 0.2);
78 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(5, "crosshair_color_special", "0", _("Custom")));
79 setDependentNOT(e, "crosshair_alpha", 0);
80 setDependentAND(e, "crosshair_enabled", 1, 2);
81 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
82 setDependentNOT(e, "crosshair_alpha", 0);
83 setDependentAND(e, "crosshair_color_special", 0, 0);
84 setDependentAND(e, "crosshair_enabled", 1, 2);
85 me.TR(me);
86 me.TR(me);
87 me.TR(me);
88 me.TDempty(me, 0.2);
89 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "crosshair_ring", _("Use rings to indicate weapon status"), "-"));
90 makeMulti(e, "crosshair_ring_reload");
91 setDependent(e, "crosshair_enabled", 1, 2);
92 me.TR(me);
93 me.TDempty(me, 0.4);
94 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
95 setDependentNOT(e, "crosshair_ring_alpha", 0);
96 setDependentAND(e, "crosshair_ring", 1, 1);
97 setDependentAND(e, "crosshair_enabled", 1, 2);
98 me.TD(me, 1, 1.6, e = makeXonoticSlider(1.5, 4, 0.25, "crosshair_ring_size"));
99 setDependentNOT(e, "crosshair_ring_alpha", 0);
100 setDependentAND(e, "crosshair_ring", 1, 1);
101 setDependentAND(e, "crosshair_enabled", 1, 2);
102 me.TR(me);
103 me.TDempty(me, 0.4);
104 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Opacity:")));
105 setDependent(e, "crosshair_ring", 1, 1);
106 setDependentAND(e, "crosshair_enabled", 1, 2);
107 me.TD(me, 1, 1.6, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
108 e.formatString = "%";
109 setDependent(e, "crosshair_ring", 1, 1);
110 setDependentAND(e, "crosshair_enabled", 1, 2);
111
112 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
113 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
114 setDependent(e, "crosshair_enabled", 1, 2);
115 me.TR(me);
116 me.TDempty(me, 0.2);
117 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
118 setDependentNOT(e, "crosshair_dot_alpha", 0);
119 setDependentAND(e, "crosshair_dot", 1, 1);
120 setDependentAND(e, "crosshair_enabled", 1, 2);
121 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
122 setDependentNOT(e, "crosshair_dot_alpha", 0);
123 setDependentAND(e, "crosshair_dot", 1, 1);
124 setDependentAND(e, "crosshair_enabled", 1, 2);
125 me.TR(me);
126 me.TDempty(me, 0.2);
127 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Opacity:")));
128 setDependent(e, "crosshair_dot", 1, 1);
129 setDependentAND(e, "crosshair_enabled", 1, 2);
130 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
131 e.formatString = "%";
132 setDependent(e, "crosshair_dot", 1, 1);
133 setDependentAND(e, "crosshair_enabled", 1, 2);
134 me.TR(me);
135 me.TDempty(me, 0.2);
136 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color:")));
137 setDependentNOT(e, "crosshair_dot_alpha", 0);
138 setDependentAND(e, "crosshair_dot", 1, 1);
139 setDependentAND(e, "crosshair_enabled", 1, 2);
140 me.TD(me, 1, 1.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal color")));
141 setDependentNOT(e, "crosshair_dot_alpha", 0);
142 setDependentAND(e, "crosshair_dot", 1, 1);
143 setDependentAND(e, "crosshair_enabled", 1, 2);
144 me.TR(me);
145 me.TDempty(me, 0.4);
146 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
147 setDependent(e, "crosshair_dot", 1, 1);
148 setDependentAND(e, "crosshair_enabled", 1, 2);
149 me.TD(me, 2, 1.8, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
150 setDependent(e, "crosshair_dot", 1, 1);
151 setDependentAND(e, "crosshair_enabled", 1, 2);
152 setDependentAND(e, "crosshair_dot_color_custom", 1, 1);
153 me.TR(me);
154 me.TR(me);
155 me.TR(me);
156 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
157 setDependent(e, "crosshair_enabled", 1, 2);
158 me.TR(me);
159 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_hittest", _("Perform hit tests for the crosshair")));
160 setDependent(e, "crosshair_enabled", 1, 2);
161 me.TR(me);
162 me.TDempty(me, 0.2);
163 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_hittest_blur_wall", _("Blur if obstructed by an obstacle")));
164 setDependentNOT(e, "crosshair_hittest", 0);
165 setDependentAND(e, "crosshair_enabled", 1, 2);
166 me.TR(me);
167 me.TDempty(me, 0.2);
168 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_hittest_blur_teammate", _("Blur if obstructed by a teammate")));
169 setDependentNOT(e, "crosshair_hittest", 0);
170 setDependentAND(e, "crosshair_enabled", 1, 2);
171 me.TR(me);
172 me.TDempty(me, 0.2);
173 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(1.25, 1, "crosshair_hittest", _("Shrink if obstructed by a teammate")));
174 setDependentNOT(e, "crosshair_hittest", 0);
175 setDependentAND(e, "crosshair_enabled", 1, 2);
176 me.TR(me);
177 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy")));
178 setDependent(e, "crosshair_enabled", 1, 2);
179 me.TR(me);
180 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item")));
181 setDependent(e, "crosshair_enabled", 1, 2);
182}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar)
entity makeXonoticCrosshairPicker()
entity makeXonoticCrosshairPreview()
entity makeXonoticGameCrosshairSettingsTab()
void XonoticGameCrosshairSettingsTab_showNotify(entity me)
void XonoticGameCrosshairSettingsTab_fill(entity me)
void loadAllCvars(entity root)
Definition util.qc:53
void setDependentAND(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:213
void makeMulti(entity e, string otherCvars)
Definition util.qc:92
void setDependentNOT(entity e, string theCvarName, float theCvarValue)
Definition util.qc:192
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:180
string string_null
Definition nil.qh:9
#define NEW(cname,...)
Definition oo.qh:117
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticHeaderLabel(string theText)
Definition textlabel.qc:9
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition checkbox.qc:3
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition checkbox.qc:28
entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
Definition checkbox.qc:39
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
Definition radiobutton.qc:9
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:9