1 #include "dialog_settings_input.qh"
3 #include "dialog_settings_input_userbind.qh"
5 #include "slider_resolution.qh"
6 #include "../item/checkbox.qh"
7 #include "keybinder.qh"
8 #include "textlabel.qh"
11 #include "checkbox.qh"
13 entity makeXonoticInputSettingsTab()
16 me = NEW(XonoticInputSettingsTab);
17 me.configureDialog(me);
21 void CheckBox_Click_Redisplay(entity me, entity checkbox)
23 CheckBox_Click(me, checkbox);
24 cmd("\ndefer 0.2 \"togglemenu 1\"\n");
27 void XonoticInputSettingsTab_fill(entity me)
30 entity kb = makeXonoticKeyBinder();
33 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Key Bindings")));
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;
41 me.TD(me, 1, 1, e = makeXonoticButton(_("Edit..."), '0 0 0'));
42 e.onClick = KeyBinder_Bind_Edit;
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;
52 me.TD(me, 1, 3, e = makeXonoticButton(_("Reset all"), '0 0 0'));
53 e.onClick = KeyBinder_Bind_Reset_All;
56 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
57 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Mouse")));
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")));
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")));
66 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(1.022, "m_pitch", _("Invert aiming"),
67 _("Invert mouse movement on the Y-axis")));
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;
74 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "m_accelerate", _("Enable built in mouse acceleration")));
76 if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE)
78 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "vid_dgamouse", _("Disable system mouse acceleration"),
79 _("Make use of DGA mouse input")));
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")));
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
91 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
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")));
96 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_movement_track_canjump", _("Automatically repeat jumping if holding jump")));
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);
107 if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
109 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joy_enable", _("Use joystick input")));
110 setDependent(e, "joy_detected", 1, 10000000);
112 else if(cvar_type("joystick") & CVAR_TYPEFLAG_ENGINE)
114 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joystick", _("Use joystick input")));
115 setDependent(e, "joy_detected", 1, 10000000);
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