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(3, "crosshair_per_weapon", string_null, _("Per weapon")));
40 makeMulti(e, "crosshair_enabled");
42 me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "2", _("Custom")));
45 me.TD(me, 3, 2, e = makeXonoticCrosshairPicker());
46 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
47 me.TD(me, 3, 0.9, e = makeXonoticCrosshairPreview());
48 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
53 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair size:")));
54 setDependent(e, "crosshair_enabled", 1, 2);
55 me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size"));
56 setDependent(e, "crosshair_enabled", 1, 2);
59 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair alpha:")));
60 setDependent(e, "crosshair_enabled", 1, 2);
61 me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
62 setDependent(e, "crosshair_enabled", 1, 2);
65 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair color:")));
66 setDependent(e, "crosshair_enabled", 1, 2);
67 me.TD(me, 1, 0.9, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon")));
68 setDependent(e, "crosshair_enabled", 1, 2);
69 me.TD(me, 1, 1, e = makeXonoticRadioButton(5, "crosshair_color_special", "2", _("By health")));
70 setDependent(e, "crosshair_enabled", 1, 2);
73 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(5, "crosshair_color_special", "0", _("Custom")));
74 setDependent(e, "crosshair_enabled", 1, 2);
75 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
76 setDependentAND(e, "crosshair_color_special", 0, 0, "crosshair_enabled", 1, 2);
81 me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_ring", _("Use rings to indicate weapon status")));
82 makeMulti(e, "crosshair_ring_reload");
83 setDependent(e, "crosshair_enabled", 1, 2);
85 // me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Ring size:")));
86 // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
87 // me.TD(me, 1, 2, e = makeXonoticSlider(2, 4, 0.1, "crosshair_ring_size"));
88 // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
91 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Ring alpha:")));
92 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
93 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
94 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
96 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
97 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
98 setDependent(e, "crosshair_enabled", 1, 2);
101 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot size:")));
102 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
103 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
104 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
107 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot alpha:")));
108 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
109 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
110 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
113 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot color:")));
114 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
115 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color")));
116 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
119 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
120 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
121 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
122 setDependentAND3(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2, "crosshair_dot_color_custom", 1, 1);
126 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
127 setDependent(e, "crosshair_enabled", 1, 2);
129 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed")));
130 setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
132 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(1.25, 0, "crosshair_hittest_scale", _("Enlarge crosshair if targeting an enemy")));
133 setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
135 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy")));
136 setDependent(e, "crosshair_enabled", 1, 2);
138 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item")));
139 setDependent(e, "crosshair_enabled", 1, 2);
141 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit testing:")));
142 me.TD(me, 1, 2, e = makeXonoticTextSlider("crosshair_hittest"));
143 e.addValue(e, ZCTX(_("HTTST^Disabled")), "0");
144 e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1");
145 e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25");
146 e.configureXonoticTextSliderValues(e);
147 setDependent(e, "crosshair_enabled", 1, 2);*/
151 me.gotoRC(me, me.rows - 1, 0);
152 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
153 e.onClick = Dialog_Close;
154 e.onClickEntity = me;*/