]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c
Lots of work on view settings dialog, plus re-work effects tab a bit more to match...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_multiplayer_playersetup_view.c
1 #ifdef INTERFACE
2 CLASS(XonoticViewDialog) EXTENDS(XonoticDialog)
3         METHOD(XonoticViewDialog, toString, string(entity))
4         METHOD(XonoticViewDialog, fill, void(entity))
5         METHOD(XonoticViewDialog, showNotify, void(entity))
6         ATTRIB(XonoticViewDialog, title, string, _("View settings"))
7         ATTRIB(XonoticViewDialog, color, vector, SKINCOLOR_DIALOG_VIEW)
8         ATTRIB(XonoticViewDialog, intendedWidth, float, 0.9)
9         ATTRIB(XonoticViewDialog, rows, float, 13)
10         ATTRIB(XonoticViewDialog, columns, float, 6.2) // added extra .2 for center space 
11 ENDCLASS(XonoticViewDialog)
12 #endif
13
14 #ifdef IMPLEMENTATION
15 void XonoticViewDialog_showNotify(entity me)
16 {
17         loadAllCvars(me);
18 }
19 string XonoticViewDialog_toString(entity me)
20 {
21         return "hi"; //me.weaponsList.toString(me.weaponsList);
22 }
23 void XonoticViewDialog_fill(entity me)
24 {
25         entity e, sl;
26         float i;
27         
28         me.TR(me);
29                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:")));
30                 me.TD(me, 1, 2, e = makeXonoticSlider(60, 130, 5, "fov"));
31         me.TR(me);
32         me.TR(me);
33                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Zoom:")));
34                 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_reticle"));
35                         e.addValue(e, _("Fullscreen"), "0");
36                         e.addValue(e, _("With reticle"), "1");
37                         e.configureXonoticTextSliderValues(e);
38         me.TR(me);
39                 me.TDempty(me, 0.2);
40                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Factor:")));
41                 me.TD(me, 1, 2, e = makeXonoticSlider(2, 16, 0.5, "cl_zoomfactor"));
42         me.TR(me);
43                 me.TDempty(me, 0.2);
44                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Speed:")));
45                 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_zoomspeed"));
46                         e.addValue(e, "1", "1"); // Samual: for() loop doesn't work here, even though it would make sense.
47                         e.addValue(e, "2", "2");
48                         e.addValue(e, "3", "3");
49                         e.addValue(e, "4", "4");
50                         e.addValue(e, "5", "5");
51                         e.addValue(e, "6", "6");
52                         e.addValue(e, "7", "7");
53                         e.addValue(e, "8", "8");
54                         e.addValue(e, _("Instant"), "-1");
55                         e.configureXonoticTextSliderValues(e);
56         me.TR(me);
57                 me.TDempty(me, 0.2);
58                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Sensitivity:")));
59                 me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.1, "cl_zoomsensitivity"));
60         me.TR(me);
61         me.TR(me);
62                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Velocity zoom:")));
63                 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_velocityzoom_type"));
64                         e.addValue(e, _("Disabled"), "0");
65                         e.addValue(e, _("Forward only"), "3");
66                         e.addValue(e, _("All directions"), "1");
67                         e.configureXonoticTextSliderValues(e);
68         me.TR(me);
69                 me.TDempty(me, 0.2);
70                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Speed")));
71                 me.TD(me, 1, 2, e = makeXonoticSlider(-1, 1, 0.2, "cl_velocityzoom"));
72                 setDependent(e, "cl_velocityzoom_type", 1, 3);
73         me.TR(me);
74         
75         me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
76                 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "0", _("1st person perspective")));
77                 makeMulti(e, "crosshair_hittest_showimpact");
78         me.TR(me);
79                 me.TDempty(me, 0.2);
80                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.05, 0, "cl_bobfall", _("Smooth the view when landing from a jump")));
81                 setDependent(e, "chase_active", -1, 0);
82         me.TR(me);
83                 me.TDempty(me, 0.2);
84                 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.05, 0, "cl_smoothviewheight", _("Smooth the view while crouching")));
85                 setDependent(e, "chase_active", -1, 0);
86         me.TR(me);
87         me.TR(me);
88         me.TR(me);
89                 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "chase_active", "1", _("3rd person perspective")));
90                 makeMulti(e, "crosshair_hittest_showimpact");
91         me.TR(me);
92                 me.TDempty(me, 0.2);
93                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Back distance")));
94                 setDependent(e, "chase_active", 1, 1);
95                 me.TD(me, 1, 2, e = makeXonoticSlider(10, 100, 1, "chase_back"));
96                 setDependent(e, "chase_active", 1, 1);
97         me.TR(me);
98                 me.TDempty(me, 0.2);
99                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Up distance")));
100                 setDependent(e, "chase_active", 1, 1);
101                 me.TD(me, 1, 2, e = makeXonoticSlider(10, 50, 1, "chase_up"));
102                 setDependent(e, "chase_active", 1, 1);
103         me.TR(me);
104         me.TR(me);
105                 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_clippedspectating", _("Allow passing through walls while spectating")));
106                 
107         me.gotoRC(me, me.rows - 1, 0);
108                 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
109                         e.onClick = Dialog_Close;
110                         e.onClickEntity = me;
111 }
112 #endif