1 #ifndef DIALOG_SETTINGS_GAME_CROSSHAIR_H
2 #define DIALOG_SETTINGS_GAME_CROSSHAIR_H
4 CLASS(XonoticGameCrosshairSettingsTab, XonoticTab)
5 METHOD(XonoticGameCrosshairSettingsTab, fill, void(entity));
6 METHOD(XonoticGameCrosshairSettingsTab, showNotify, void(entity));
7 ATTRIB(XonoticGameCrosshairSettingsTab, title, string, _("Crosshair"))
8 ATTRIB(XonoticGameCrosshairSettingsTab, intendedWidth, float, 0.9)
9 ATTRIB(XonoticGameCrosshairSettingsTab, rows, float, 13)
10 ATTRIB(XonoticGameCrosshairSettingsTab, columns, float, 6.2)
11 ENDCLASS(XonoticGameCrosshairSettingsTab)
12 entity makeXonoticGameCrosshairSettingsTab();
13 #include "../gamesettings.qh"
14 REGISTER_SETTINGS(Crosshair, makeXonoticGameCrosshairSettingsTab());
18 void XonoticGameCrosshairSettingsTab_showNotify(entity me)
22 entity makeXonoticGameCrosshairSettingsTab()
25 me = NEW(XonoticGameCrosshairSettingsTab);
26 me.configureDialog(me);
30 void XonoticGameCrosshairSettingsTab_fill(entity me)
34 // crosshair_enabled: 0 = no crosshair options, 1 = no crosshair selection, but everything else enabled, 2 = all crosshair options enabled
35 // FIXME: In the future, perhaps make one global crosshair_type cvar which has 0 for disabled, 1 for custom, 2 for per weapon, etc?
36 me.TR(me); //me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
37 me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "0", _("No crosshair")));
39 me.TD(me, 1, 1, e = makeXonoticRadioButton_T(3, "crosshair_per_weapon", string_null, _("Per weapon"),
40 _("Set a different crosshair for each weapon, good if you play without weapon models")));
41 makeMulti(e, "crosshair_enabled");
43 me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "2", _("Custom")));
46 me.TD(me, 3, 2, e = makeXonoticCrosshairPicker());
47 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
48 me.TD(me, 3, 0.9, e = makeXonoticCrosshairPreview());
49 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
54 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair size:")));
55 setDependent(e, "crosshair_enabled", 1, 2);
56 me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size"));
57 setDependent(e, "crosshair_enabled", 1, 2);
60 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair alpha:")));
61 setDependent(e, "crosshair_enabled", 1, 2);
62 me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
63 setDependent(e, "crosshair_enabled", 1, 2);
66 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair color:")));
67 setDependent(e, "crosshair_enabled", 1, 2);
68 me.TD(me, 1, 0.9, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon")));
69 setDependent(e, "crosshair_enabled", 1, 2);
70 me.TD(me, 1, 1, e = makeXonoticRadioButton(5, "crosshair_color_special", "2", _("By health")));
71 setDependent(e, "crosshair_enabled", 1, 2);
74 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(5, "crosshair_color_special", "0", _("Custom")));
75 setDependent(e, "crosshair_enabled", 1, 2);
76 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
77 setDependentAND(e, "crosshair_color_special", 0, 0, "crosshair_enabled", 1, 2);
82 me.TD(me, 1, 2.9, e = makeXonoticCheckBox_T(0, "crosshair_ring", _("Use rings to indicate weapon status"), "-"));
83 makeMulti(e, "crosshair_ring_reload");
84 setDependent(e, "crosshair_enabled", 1, 2);
86 // me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Ring size:")));
87 // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
88 // me.TD(me, 1, 2, e = makeXonoticSlider(2, 4, 0.1, "crosshair_ring_size"));
89 // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
92 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Ring alpha:")));
93 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
94 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
95 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
97 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
98 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
99 setDependent(e, "crosshair_enabled", 1, 2);
102 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot size:")));
103 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
104 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
105 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
108 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot alpha:")));
109 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
110 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
111 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
114 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot color:")));
115 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
116 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color")));
117 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
120 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
121 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
122 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
123 setDependentAND3(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2, "crosshair_dot_color_custom", 1, 1);
127 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
128 setDependent(e, "crosshair_enabled", 1, 2);
130 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed")));
131 setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
133 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(1.25, 0, "crosshair_hittest_scale", _("Enlarge crosshair if targeting an enemy")));
134 setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
136 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy")));
137 setDependent(e, "crosshair_enabled", 1, 2);
139 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item")));
140 setDependent(e, "crosshair_enabled", 1, 2);
142 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit testing:")));
143 me.TD(me, 1, 2, e = makeXonoticTextSlider_T("crosshair_hittest",
144 _("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")));
145 e.addValue(e, ZCTX(_("HTTST^Disabled")), "0");
146 e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1");
147 e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25");
148 e.configureXonoticTextSliderValues(e);
149 setDependent(e, "crosshair_enabled", 1, 2);*/
153 me.gotoRC(me, me.rows - 1, 0);
154 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
155 e.onClick = Dialog_Close;
156 e.onClickEntity = me;*/