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