Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_settings_game_crosshair.qc File Reference
#include "dialog_settings_game_crosshair.qh"
#include "radiobutton.qh"
#include "crosshairpicker.qh"
#include "crosshairpreview.qh"
#include "textlabel.qh"
#include "slider.qh"
#include "colorpicker_string.qh"
#include "checkbox.qh"
Include dependency graph for dialog_settings_game_crosshair.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

entity makeXonoticGameCrosshairSettingsTab ()
void XonoticGameCrosshairSettingsTab_fill (entity me)
void XonoticGameCrosshairSettingsTab_showNotify (entity me)

Function Documentation

◆ makeXonoticGameCrosshairSettingsTab()

entity makeXonoticGameCrosshairSettingsTab ( )

Definition at line 15 of file dialog_settings_game_crosshair.qc.

16{
17 entity me;
19 me.configureDialog(me);
20 return me;
21}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

◆ XonoticGameCrosshairSettingsTab_fill()

void XonoticGameCrosshairSettingsTab_fill ( entity me)

Definition at line 23 of file dialog_settings_game_crosshair.qc.

24{
25 entity e;
26
27 me.TR(me);
28 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Crosshair")));
29 // crosshair_enabled: 0 = no crosshair options, 1 = no crosshair selection, but everything else enabled, 2 = all crosshair options enabled
30 // FIXME: In the future, perhaps make one global crosshair_type cvar which has 0 for disabled, 1 for custom, 2 for per weapon, etc?
31 me.TR(me);
32 me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "0", _("No crosshair")));
33 //me.TR(me);
34 me.TD(me, 1, 1, e = makeXonoticRadioButton_T(3, "crosshair_per_weapon", string_null, _("Per weapon"),
35 _("Set a different crosshair for each weapon, good if you play without weapon models")));
36 makeMulti(e, "crosshair_enabled");
37 //me.TR(me);
38 me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "2", _("Custom")));
39 me.TR(me);
40 me.TDempty(me, 0.2);
41 me.TD(me, 3, 2, e = makeXonoticCrosshairPicker());
42 setDependentNOT(e, "crosshair_alpha", 0);
43 setDependentAND(e, "crosshair_per_weapon", 0, 0);
44 setDependentAND(e, "crosshair_enabled", 1, 2);
45 me.TD(me, 3, 0.8, e = makeXonoticCrosshairPreview());
46 setDependentNOT(e, "crosshair_alpha", 0);
47 setDependentAND(e, "crosshair_per_weapon", 0, 0);
48 setDependentAND(e, "crosshair_enabled", 1, 2);
49 me.TR(me);
50 me.TR(me);
51 me.TR(me);
52 me.TDempty(me, 0.2);
53 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
54 setDependentNOT(e, "crosshair_alpha", 0);
55 setDependentAND(e, "crosshair_enabled", 1, 2);
56 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size"));
57 setDependentNOT(e, "crosshair_alpha", 0);
58 setDependentAND(e, "crosshair_enabled", 1, 2);
59 me.TR(me);
60 me.TDempty(me, 0.2);
61 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Opacity:")));
62 setDependent(e, "crosshair_enabled", 1, 2);
63 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_alpha"));
64 e.formatString = "%";
65 setDependent(e, "crosshair_enabled", 1, 2);
66 me.TR(me);
67 me.TDempty(me, 0.2);
68 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color:")));
69 setDependentNOT(e, "crosshair_alpha", 0);
70 setDependentAND(e, "crosshair_enabled", 1, 2);
71 me.TD(me, 1, 1.8/2, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon")));
72 setDependentNOT(e, "crosshair_alpha", 0);
73 setDependentAND(e, "crosshair_enabled", 1, 2);
74 me.TD(me, 1, 1.8/2, e = makeXonoticRadioButton(5, "crosshair_color_special", "2", _("By health")));
75 setDependentNOT(e, "crosshair_alpha", 0);
76 setDependentAND(e, "crosshair_enabled", 1, 2);
77 me.TR(me);
78 me.TDempty(me, 0.2);
79 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(5, "crosshair_color_special", "0", _("Custom")));
80 setDependentNOT(e, "crosshair_alpha", 0);
81 setDependentAND(e, "crosshair_enabled", 1, 2);
82 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
83 setDependentNOT(e, "crosshair_alpha", 0);
84 setDependentAND(e, "crosshair_color_special", 0, 0);
85 setDependentAND(e, "crosshair_enabled", 1, 2);
86 me.TR(me);
87 me.TR(me);
88 me.TR(me);
89 me.TDempty(me, 0.2);
90 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "crosshair_ring", _("Use rings to indicate weapon status"), "-"));
91 makeMulti(e, "crosshair_ring_reload");
92 setDependent(e, "crosshair_enabled", 1, 2);
93 me.TR(me);
94 me.TDempty(me, 0.4);
95 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
96 setDependentNOT(e, "crosshair_ring_alpha", 0);
97 setDependentAND(e, "crosshair_ring", 1, 1);
98 setDependentAND(e, "crosshair_enabled", 1, 2);
99 me.TD(me, 1, 1.6, e = makeXonoticSlider(1.5, 4, 0.25, "crosshair_ring_size"));
100 setDependentNOT(e, "crosshair_ring_alpha", 0);
101 setDependentAND(e, "crosshair_ring", 1, 1);
102 setDependentAND(e, "crosshair_enabled", 1, 2);
103 me.TR(me);
104 me.TDempty(me, 0.4);
105 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Opacity:")));
106 setDependent(e, "crosshair_ring", 1, 1);
107 setDependentAND(e, "crosshair_enabled", 1, 2);
108 me.TD(me, 1, 1.6, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
109 e.formatString = "%";
110 setDependent(e, "crosshair_ring", 1, 1);
111 setDependentAND(e, "crosshair_enabled", 1, 2);
112
113 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
114 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
115 setDependent(e, "crosshair_enabled", 1, 2);
116 me.TR(me);
117 me.TDempty(me, 0.2);
118 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
119 setDependentNOT(e, "crosshair_dot_alpha", 0);
120 setDependentAND(e, "crosshair_dot", 1, 1);
121 setDependentAND(e, "crosshair_enabled", 1, 2);
122 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
123 setDependentNOT(e, "crosshair_dot_alpha", 0);
124 setDependentAND(e, "crosshair_dot", 1, 1);
125 setDependentAND(e, "crosshair_enabled", 1, 2);
126 me.TR(me);
127 me.TDempty(me, 0.2);
128 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Opacity:")));
129 setDependent(e, "crosshair_dot", 1, 1);
130 setDependentAND(e, "crosshair_enabled", 1, 2);
131 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
132 e.formatString = "%";
133 setDependent(e, "crosshair_dot", 1, 1);
134 setDependentAND(e, "crosshair_enabled", 1, 2);
135 me.TR(me);
136 me.TDempty(me, 0.2);
137 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color:")));
138 setDependentNOT(e, "crosshair_dot_alpha", 0);
139 setDependentAND(e, "crosshair_dot", 1, 1);
140 setDependentAND(e, "crosshair_enabled", 1, 2);
141 me.TD(me, 1, 1.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal color")));
142 setDependentNOT(e, "crosshair_dot_alpha", 0);
143 setDependentAND(e, "crosshair_dot", 1, 1);
144 setDependentAND(e, "crosshair_enabled", 1, 2);
145 me.TR(me);
146 me.TDempty(me, 0.4);
147 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
148 setDependent(e, "crosshair_dot", 1, 1);
149 setDependentAND(e, "crosshair_enabled", 1, 2);
150 me.TD(me, 2, 1.8, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
151 setDependent(e, "crosshair_dot", 1, 1);
152 setDependentAND(e, "crosshair_enabled", 1, 2);
153 setDependentAND(e, "crosshair_dot_color_custom", 1, 1);
154 me.TR(me);
155 me.TR(me);
156 me.TR(me);
157 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
158 setDependent(e, "crosshair_enabled", 1, 2);
159 me.TR(me);
160 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_hittest", _("Perform hit tests for the crosshair")));
161 setDependent(e, "crosshair_enabled", 1, 2);
162 me.TR(me);
163 me.TDempty(me, 0.2);
164 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_hittest_blur_wall", _("Blur if obstructed by an obstacle")));
165 setDependentNOT(e, "crosshair_hittest", 0);
166 setDependentAND(e, "crosshair_enabled", 1, 2);
167 me.TR(me);
168 me.TDempty(me, 0.2);
169 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_hittest_blur_teammate", _("Blur if obstructed by a teammate")));
170 setDependentNOT(e, "crosshair_hittest", 0);
171 setDependentAND(e, "crosshair_enabled", 1, 2);
172 me.TR(me);
173 me.TDempty(me, 0.2);
174 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(1.25, 1, "crosshair_hittest", _("Shrink if obstructed by a teammate")));
175 setDependentNOT(e, "crosshair_hittest", 0);
176 setDependentAND(e, "crosshair_enabled", 1, 2);
177 me.TR(me);
178 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy")));
179 setDependent(e, "crosshair_enabled", 1, 2);
180 me.TR(me);
181 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item")));
182 setDependent(e, "crosshair_enabled", 1, 2);
183}
entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar)
entity makeXonoticCrosshairPicker()
entity makeXonoticCrosshairPreview()
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
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticHeaderLabel(string theText)
Definition textlabel.qc:10
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:40
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
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

References entity(), makeMulti(), makeXonoticCheckBox(), makeXonoticCheckBox_T(), makeXonoticCheckBoxEx(), makeXonoticColorpickerString(), makeXonoticCrosshairPicker(), makeXonoticCrosshairPreview(), makeXonoticHeaderLabel(), makeXonoticRadioButton(), makeXonoticRadioButton_T(), makeXonoticSlider(), makeXonoticTextLabel(), setDependent(), setDependentAND(), setDependentNOT(), and string_null.

◆ XonoticGameCrosshairSettingsTab_showNotify()

void XonoticGameCrosshairSettingsTab_showNotify ( entity me)

Definition at line 11 of file dialog_settings_game_crosshair.qc.

12{
13 loadAllCvars(me);
14}
void loadAllCvars(entity root)
Definition util.qc:53

References entity(), and loadAllCvars().