1 #ifndef DIALOG_SETTINGS_GAME_CROSSHAIR_H
2 #define DIALOG_SETTINGS_GAME_CROSSHAIR_H
4 CLASS(XonoticGameCrosshairSettingsTab, XonoticTab)
5 //METHOD(XonoticGameCrosshairSettingsTab, toString, string(entity))
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, 13)
11 ATTRIB(XonoticGameCrosshairSettingsTab, columns, float, 6.2)
12 ENDCLASS(XonoticGameCrosshairSettingsTab)
13 entity makeXonoticGameCrosshairSettingsTab();
17 void XonoticGameCrosshairSettingsTab_showNotify(entity me)
21 entity makeXonoticGameCrosshairSettingsTab()
24 me = NEW(XonoticGameCrosshairSettingsTab);
25 me.configureDialog(me);
29 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 for(i = 31; i <= 42; ++i) {
46 me.TDNoMargin(me, 1, 2 / 12, e = makeXonoticCrosshairButton(4, i), '1 1 0');
47 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
49 // show a larger preview of the selected crosshair
51 me.TDNoMargin(me, 3, 0.8, e = makeXonoticCrosshairButton(7, -1), '1 1 0'); // crosshair -1 makes this a preview
52 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
55 for(i = 43; i <= 54; ++i) {
56 me.TDNoMargin(me, 1, 2 / 12, e = makeXonoticCrosshairButton(4, i), '1 1 0');
57 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
61 for(i = 55; i <= 66; ++i) {
62 me.TDNoMargin(me, 1, 2 / 12, e = makeXonoticCrosshairButton(4, i), '1 1 0');
63 setDependentAND(e, "crosshair_per_weapon", 0, 0, "crosshair_enabled", 1, 2);
67 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair size:")));
68 setDependent(e, "crosshair_enabled", 1, 2);
69 me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size"));
70 setDependent(e, "crosshair_enabled", 1, 2);
73 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair alpha:")));
74 setDependent(e, "crosshair_enabled", 1, 2);
75 me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
76 setDependent(e, "crosshair_enabled", 1, 2);
79 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair color:")));
80 setDependent(e, "crosshair_enabled", 1, 2);
81 me.TD(me, 1, 0.9, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon")));
82 setDependent(e, "crosshair_enabled", 1, 2);
83 me.TD(me, 1, 1, e = makeXonoticRadioButton(5, "crosshair_color_special", "2", _("By health")));
84 setDependent(e, "crosshair_enabled", 1, 2);
87 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(5, "crosshair_color_special", "0", _("Custom")));
88 setDependent(e, "crosshair_enabled", 1, 2);
89 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
90 setDependentAND(e, "crosshair_color_special", 0, 0, "crosshair_enabled", 1, 2);
95 me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_ring", _("Use rings to indicate weapon status")));
96 makeMulti(e, "crosshair_ring_reload");
97 setDependent(e, "crosshair_enabled", 1, 2);
99 // me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Ring size:")));
100 // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
101 // me.TD(me, 1, 2, e = makeXonoticSlider(2, 4, 0.1, "crosshair_ring_size"));
102 // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
105 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Ring alpha:")));
106 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
107 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha"));
108 setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2);
110 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
111 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
112 setDependent(e, "crosshair_enabled", 1, 2);
115 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot size:")));
116 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
117 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
118 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
121 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot alpha:")));
122 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
123 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
124 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
127 me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot color:")));
128 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
129 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color")));
130 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
133 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
134 setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
135 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
136 setDependentAND3(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2, "crosshair_dot_color_custom", 1, 1);
140 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
141 setDependent(e, "crosshair_enabled", 1, 2);
143 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed")));
144 setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
146 me.TD(me, 1, 3, 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);
155 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit testing:")));
156 me.TD(me, 1, 2, e = makeXonoticTextSlider("crosshair_hittest"));
157 e.addValue(e, ZCTX(_("HTTST^Disabled")), "0");
158 e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1");
159 e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25");
160 e.configureXonoticTextSliderValues(e);
161 setDependent(e, "crosshair_enabled", 1, 2);*/
165 me.gotoRC(me, me.rows - 1, 0);
166 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
167 e.onClick = Dialog_Close;
168 e.onClickEntity = me;*/