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