1 #include "dialog_settings_input.qh"
2 #ifndef DIALOG_SETTINGS_INPUT_H
3 #define DIALOG_SETTINGS_INPUT_H
5 CLASS(XonoticInputSettingsTab, XonoticTab)
6 METHOD(XonoticInputSettingsTab, fill, void(entity));
7 ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9)
8 ATTRIB(XonoticInputSettingsTab, rows, float, 15.5)
9 ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space
10 ENDCLASS(XonoticInputSettingsTab)
11 entity makeXonoticInputSettingsTab();
15 entity makeXonoticInputSettingsTab()
18 me = NEW(XonoticInputSettingsTab);
19 me.configureDialog(me);
23 void CheckBox_Click_Redisplay(entity me, entity checkbox)
25 CheckBox_Click(me, checkbox);
26 cmd("\ndefer 0.2 \"togglemenu 1\"\n");
29 void XonoticInputSettingsTab_fill(entity me)
32 entity kb = makeXonoticKeyBinder();
35 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Key Bindings")));
37 me.TD(me, me.rows - 3, 3, kb);
38 me.gotoRC(me, me.rows - 2, 0);
39 me.TD(me, 1, 1, e = makeXonoticButton(_("Change key..."), '0 0 0'));
40 e.onClick = KeyBinder_Bind_Change;
43 me.TD(me, 1, 1, e = makeXonoticButton(_("Edit..."), '0 0 0'));
44 e.onClick = KeyBinder_Bind_Edit;
46 kb.userbindEditButton = e;
47 kb.userbindEditDialog = main.userbindEditDialog;
48 main.userbindEditDialog.keybindBox = kb;
49 me.TD(me, 1, 1, e = makeXonoticButton(_("Clear"), '0 0 0'));
50 e.onClick = KeyBinder_Bind_Clear;
54 me.TD(me, 1, 3, e = makeXonoticButton(_("Reset all"), '0 0 0'));
55 e.onClick = KeyBinder_Bind_Reset_All;
58 me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
59 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Mouse")));
61 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Sensitivity:")));
62 me.TD(me, 1, 2, e = makeXonoticSlider_T(1, 32, 0.2, "sensitivity",
63 _("Mouse speed multiplier")));
65 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "m_filter", _("Smooth aiming"),
66 _("Smoothes the mouse movement, but makes aiming slightly less responsive")));
68 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(1.022, "m_pitch", _("Invert aiming"),
69 _("Invert mouse movement on the Y-axis")));
71 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "menu_mouse_absolute", _("Use system mouse positioning"), "-"));
72 makeMulti(e, "hud_cursormode");
73 e.onClick = CheckBox_Click_Redisplay;
76 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "m_accelerate", _("Enable built in mouse acceleration")));
78 if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE)
80 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "vid_dgamouse", _("Disable system mouse acceleration"),
81 _("Make use of DGA mouse input")));
83 else if(cvar_type("apple_mouse_noaccel") & CVAR_TYPEFLAG_ENGINE)
84 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "apple_mouse_noaccel", _("Disable system mouse acceleration")));
87 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, string_null, _("Disable system mouse acceleration")));
88 e.disabled = 1; // the option is never available in this case, just there for show
93 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
95 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "con_closeontoggleconsole", _("Pressing \"enter console\" key also closes it"),
96 _("Allow the console toggling bind to also close the console")));
98 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_movement_track_canjump", _("Automatically repeat jumping if holding jump")));
101 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Jetpack on jump:")));
102 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_jetpack_jump"));
103 e.addValue(e, ZCTX(_("JPJUMP^Disabled")), "0");
104 e.addValue(e, _("Air only"), "1");
105 e.addValue(e, ZCTX(_("JPJUMP^All")), "2");
106 e.configureXonoticTextSliderValues(e);
109 if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
111 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joy_enable", _("Use joystick input")));
112 setDependent(e, "joy_detected", 1, 10000000);
114 else if(cvar_type("joystick") & CVAR_TYPEFLAG_ENGINE)
116 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joystick", _("Use joystick input")));
117 setDependent(e, "joy_detected", 1, 10000000);
121 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, string_null, _("Use joystick input")));
122 e.disabled = 1; // the option is never available in this case, just there for show