]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_settings_game_crosshair.c
Add view tab
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_game_crosshair.c
1 #ifdef INTERFACE
2 CLASS(XonoticGameCrosshairSettingsTab) EXTENDS(XonoticTab)
3         //METHOD(XonoticGameCrosshairSettingsTab, toString, string(entity))
4         METHOD(XonoticGameCrosshairSettingsTab, fill, void(entity))
5         METHOD(XonoticGameCrosshairSettingsTab, showNotify, void(entity))
6         ATTRIB(XonoticGameCrosshairSettingsTab, title, string, _("Crosshair"))
7         ATTRIB(XonoticGameCrosshairSettingsTab, intendedWidth, float, 0.9)
8         ATTRIB(XonoticGameCrosshairSettingsTab, rows, float, 15)
9         ATTRIB(XonoticGameCrosshairSettingsTab, columns, float, 6.2)
10 ENDCLASS(XonoticGameCrosshairSettingsTab)
11 entity makeXonoticGameCrosshairSettingsTab();
12 #endif
13
14 #ifdef IMPLEMENTATION
15 void XonoticGameCrosshairSettingsTab_showNotify(entity me)
16 {
17         loadAllCvars(me);
18 }
19 entity makeXonoticGameCrosshairSettingsTab()
20 {
21         entity me;
22         me = spawnXonoticGameCrosshairSettingsTab();
23         me.configureDialog(me);
24         return me;
25 }
26
27 void XonoticGameCrosshairSettingsTab_fill(entity me)
28 {
29         entity e;
30         
31         me.TR(me);
32                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
33                 setDependent(e, "crosshair_enabled", 1, 2);
34         me.TR(me);
35                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Dot size:")));
36                         setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
37                 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
38                         setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
39         me.TR(me);
40                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Dot alpha:")));
41                         setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
42                 me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha"));
43                         setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
44         me.TR(me);
45                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Dot color:")));
46                         setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
47                 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color")));
48                         setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
49         me.TR(me);
50                 me.TDempty(me, 0.1);
51                 me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "1", _("Custom")));
52                         setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2);
53                 me.TD(me, 2, 2, e = makeXonoticColorpickerString("crosshair_dot_color", "crosshair_dot_color"));
54                         setDependentAND3(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2, "crosshair_dot_color_custom", 1, 1);
55         me.TR(me);
56         me.TR(me);
57         me.TR(me);
58                 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Crosshair animations:")));
59         /*me.TR(me);
60                 me.TDempty(me, 0.2);
61                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
62                         setDependent(e, "crosshair_enabled", 1, 2);
63         me.TR(me);
64                 me.TDempty(me, 0.2);
65                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_ring", _("Use rings to indicate weapon status")));
66                         makeMulti(e, "crosshair_ring_reload");
67                         setDependent(e, "crosshair_enabled", 1, 2);
68         me.TR(me);
69         me.TR(me);
70                 me.TDempty(me, 0.2);
71                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Hit testing:")));
72                 me.TD(me, 1, 2, e = makeXonoticTextSlider("crosshair_hittest"));
73                         e.addValue(e, ZCTX(_("HTTST^Disabled")), "0");
74                         e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1");
75                         e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25");
76                         e.configureXonoticTextSliderValues(e);
77                         setDependent(e, "crosshair_enabled", 1, 2);
78         me.TR(me);
79                 me.TDempty(me, 0.2);
80                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed")));
81                         setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
82         me.TR(me);
83         me.TR(me);
84                 me.TDempty(me, 0.2);
85                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate when hitting an enemy")));
86                         setDependent(e, "crosshair_enabled", 1, 2);
87         me.TR(me);
88                 me.TDempty(me, 0.2);
89                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate when picking up an item")));
90                         setDependent(e, "crosshair_enabled", 1, 2);
91                         
92         me.TR(me);
93                         
94         me.gotoRC(me, me.rows - 1, 0);
95                 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
96                         e.onClick = Dialog_Close;
97                         e.onClickEntity = me;*/
98 }
99 #endif