1 #include "dialog_settings_game_crosshair.qh"
2 #ifndef DIALOG_SETTINGS_GAME_CROSSHAIR_H
3 #define DIALOG_SETTINGS_GAME_CROSSHAIR_H
5 CLASS(XonoticGameCrosshairSettingsTab, XonoticTab)
6 METHOD(XonoticGameCrosshairSettingsTab, fill, void(entity));
7 METHOD(XonoticGameCrosshairSettingsTab, showNotify, void(entity));
8 ATTRIB(XonoticGameCrosshairSettingsTab, title, string, _("Crosshair"))
9 ATTRIB(XonoticGameCrosshairSettingsTab, intendedWidth, float, 0.9)
10 ATTRIB(XonoticGameCrosshairSettingsTab, rows, float, 15.5)
11 ATTRIB(XonoticGameCrosshairSettingsTab, columns, float, 6.2)
12 ENDCLASS(XonoticGameCrosshairSettingsTab)
13 entity makeXonoticGameCrosshairSettingsTab();
14 #include "../gamesettings.qh"
15 REGISTER_SETTINGS(Crosshair, makeXonoticGameCrosshairSettingsTab());
19 void XonoticGameCrosshairSettingsTab_showNotify(entity me)
23 entity makeXonoticGameCrosshairSettingsTab()
26 me = NEW(XonoticGameCrosshairSettingsTab);
27 me.configureDialog(me);
31 void XonoticGameCrosshairSettingsTab_fill(entity me)
35 // crosshair_enabled: 0 = no crosshair options, 1 = no crosshair selection, but everything else enabled, 2 = all crosshair options enabled
36 // FIXME: In the future, perhaps make one global crosshair_type cvar which has 0 for disabled, 1 for custom, 2 for per weapon, etc?
37 me.TR(me); //me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
38 me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "0", _("No crosshair")));
40 me.TD(me, 1, 1, e = makeXonoticRadioButton_T(3, "crosshair_per_weapon", string_null, _("Per weapon"),
41 _("Set a different crosshair for each weapon, good if you play without weapon models")));
42 makeMulti(e, "crosshair_enabled");
44 me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "2", _("Custom")));
47 me.TD(me, 3, 2, e = makeXonoticCrosshairPicker());
48 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
49 me.TD(me, 3, 0.9, e = makeXonoticCrosshairPreview());
50 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
55 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:")));
56 setDependent(e, "crosshair_enabled", 1, 2);
57 me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size"));
58 setDependent(e, "crosshair_enabled", 1, 2);
61 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Alpha:")));
62 setDependent(e, "crosshair_enabled", 1, 2);
63 me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
64 setDependent(e, "crosshair_enabled", 1, 2);
67 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color:")));
68 setDependent(e, "crosshair_enabled", 1, 2);
69 me.TD(me, 1, 0.9, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon")));
70 setDependent(e, "crosshair_enabled", 1, 2);
71 me.TD(me, 1, 1, e = makeXonoticRadioButton(5, "crosshair_color_special", "2", _("By health")));
72 setDependent(e, "crosshair_enabled", 1, 2);
75 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(5, "crosshair_color_special", "0", _("Custom")));
76 setDependent(e, "crosshair_enabled", 1, 2);
77 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
78 setDependentAND(e, "crosshair_color_special", 0, 0, "crosshair_enabled", 1, 2);
83 me.TD(me, 1, 2.9, e = makeXonoticCheckBox_T(0, "crosshair_ring", _("Use rings to indicate weapon status"), "-"));
84 makeMulti(e, "crosshair_ring_reload");
85 setDependent(e, "crosshair_enabled", 1, 2);
88 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Size:")));
89 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
90 me.TD(me, 1, 1.8, e = makeXonoticSlider(2, 4, 0.1, "crosshair_ring_size"));
91 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
94 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Alpha:")));
95 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
96 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
97 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
99 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
100 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
101 setDependent(e, "crosshair_enabled", 1, 2);
104 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Size:")));
105 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
106 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
107 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
110 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Alpha:")));
111 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
112 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
113 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
116 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Color:")));
117 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
118 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color")));
119 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
122 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
123 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
124 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
125 setDependentAND3(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2, "crosshair_dot_color_custom", 1, 1);
129 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
130 setDependent(e, "crosshair_enabled", 1, 2);
132 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit testing:")));
133 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("crosshair_hittest",
134 _("None: do not do hit tests for the crosshair; TrueAim: blur the crosshair when you would not hit the wall; Enemies: also enlarge the crosshair when you would hit an enemy")));
135 e.addValue(e, ZCTX(_("HTTST^Disabled")), "0");
136 e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1");
137 e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25");
138 e.configureXonoticTextSliderValues(e);
139 setDependent(e, "crosshair_enabled", 1, 2);
142 me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed")));
143 setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
146 me.TD(me, 1, 2.9, e = makeXonoticCheckBoxEx(1.25, 0, "crosshair_hittest_scale", _("Enlarge crosshair if targeting an enemy")));
147 setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
149 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy")));
150 setDependent(e, "crosshair_enabled", 1, 2);
152 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item")));
153 setDependent(e, "crosshair_enabled", 1, 2);