]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_settings_input.qc
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_input.qc
1 #include "dialog_settings_input.qh"
2
3 #include "dialog_settings_input_userbind.qh"
4 #include "dialog_settings_bindings_reset.qh"
5 #include "skinlist.qh"
6 #include "slider_resolution.qh"
7 #include "../item/checkbox.qh"
8 #include "keybinder.qh"
9 #include "textlabel.qh"
10 #include "button.qh"
11 #include "slider.qh"
12 #include "checkbox.qh"
13
14 entity makeXonoticInputSettingsTab()
15 {
16         entity me;
17         me = NEW(XonoticInputSettingsTab);
18         me.configureDialog(me);
19         return me;
20 }
21
22 void CheckBox_Click_Redisplay(entity me, entity checkbox)
23 {
24         CheckBox_Click(me, checkbox);
25         cmd("\ndefer 0.2 \"togglemenu 1\"\n");
26         //m_display();
27 }
28 void XonoticInputSettingsTab_fill(entity me)
29 {
30         entity e;
31         entity kb = makeXonoticKeyBinder();
32
33         me.TR(me);
34                 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Key Bindings")));
35         me.TR(me);
36                 me.TD(me, me.rows - 3, 3, kb);
37         me.gotoRC(me, me.rows - 2, 0);
38                 me.TD(me, 1, 1, e = makeXonoticButton(_("Change key..."), '0 0 0'));
39                         e.onClick = KeyBinder_Bind_Change;
40                         e.onClickEntity = kb;
41                         kb.keyGrabButton = e;
42                 me.TD(me, 1, 1, e = makeXonoticButton(_("Edit..."), '0 0 0'));
43                         e.onClick = KeyBinder_Bind_Edit;
44                         e.onClickEntity = kb;
45                         kb.userbindEditButton = e;
46                         kb.userbindEditDialog = main.userbindEditDialog;
47                         main.userbindEditDialog.keybindBox = kb;
48                 me.TD(me, 1, 1, e = makeXonoticButton(_("Clear"), '0 0 0'));
49                         e.onClick = KeyBinder_Bind_Clear;
50                         e.onClickEntity = kb;
51                         kb.clearButton = e;
52         me.TR(me);
53                 me.TD(me, 1, 3, e = makeXonoticButton(_("Reset all"), '0 0 0'));
54                         e.onClick = DialogOpenButton_Click;
55                         e.onClickEntity = main.bindingsResetDialog;
56
57         me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
58                 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Mouse")));
59         me.TR(me);
60                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Sensitivity:")));
61                 me.TD(me, 1, 2, e = makeXonoticSlider_T(1, 32, 0.2, "sensitivity",
62                         _("Mouse speed multiplier")));
63         me.TR(me);
64                 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "m_filter", _("Smooth aiming"),
65                         _("Smoothes the mouse movement, but makes aiming slightly less responsive")));
66         me.TR(me);
67                 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(1.022, "m_pitch", _("Invert aiming"),
68                         _("Invert mouse movement on the Y-axis")));
69         me.TR(me);
70                 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "menu_mouse_absolute", _("Use system mouse positioning"), "-"));
71                         makeMulti(e, "hud_cursormode");
72                         e.onClick = CheckBox_Click_Redisplay;
73                         e.onClickEntity = e;
74         me.TR(me);
75                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "m_accelerate", _("Enable built in mouse acceleration")));
76         me.TR(me);
77                 if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE)
78                 {
79                         me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "vid_dgamouse", _("Disable system mouse acceleration"),
80                                 _("Make use of DGA mouse input")));
81                 }
82                 else if(cvar_type("apple_mouse_noaccel") & CVAR_TYPEFLAG_ENGINE)
83                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "apple_mouse_noaccel", _("Disable system mouse acceleration")));
84                 else
85                 {
86                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, string_null, _("Disable system mouse acceleration")));
87                         e.disabled = 1; // the option is never available in this case, just there for show
88                 }
89
90         me.TR(me);
91         me.TR(me);
92                 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
93         me.TR(me);
94                 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "con_closeontoggleconsole", _("Pressing \"enter console\" key also closes it"),
95                         _("Allow the console toggling bind to also close the console")));
96         me.TR(me);
97                 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_movement_track_canjump", _("Automatically repeat jumping if holding jump")));
98                         e.sendCvars = true;
99         me.TR(me);
100                 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Jetpack on jump:")));
101                 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_jetpack_jump"));
102                         e.addValue(e, ZCTX(_("JPJUMP^Disabled")), "0");
103                         e.addValue(e, _("Air only"), "1");
104                         e.addValue(e, ZCTX(_("JPJUMP^All")), "2");
105                         e.configureXonoticTextSliderValues(e);
106                         e.sendCvars = true;
107         me.TR(me);
108                 if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
109                 {
110                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joy_enable", _("Use joystick input")));
111                         setDependent(e, "joy_detected", 1, 10000000);
112                 }
113                 else if(cvar_type("joystick") & CVAR_TYPEFLAG_ENGINE)
114                 {
115                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joystick", _("Use joystick input")));
116                         setDependent(e, "joy_detected", 1, 10000000);
117                 }
118                 else
119                 {
120                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, string_null, _("Use joystick input")));
121                         e.disabled = 1; // the option is never available in this case, just there for show
122                 }
123 }