Xonotic
dialog_settings_input.qc
Go to the documentation of this file.
2 
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 
15 {
16  entity me;
18  me.configureDialog(me);
19  return me;
20 }
21 
23 {
24  CheckBox_Click(me, checkbox);
25  cmd("\ndefer 0.2 \"togglemenu 1\"\n");
26  //m_display();
27 }
29 {
30  entity e;
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 }
entity makeXonoticInputSettingsTab()
string string_null
Definition: nil.qh:9
void KeyBinder_Bind_Edit(entity btn, entity me)
Definition: keybinder.qc:294
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticHeaderLabel(string theText)
Definition: textlabel.qc:10
entity() spawn
void DialogOpenButton_Click(entity button, entity tab)
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
#define ZCTX(s)
Definition: i18n.qh:68
void CheckBox_Click_Redisplay(entity me, entity checkbox)
entity makeXonoticSlider_T(float theValueMin, float theValueMax, float theValueStep, string theCvar, string theTooltip)
Definition: slider.qc:3
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition: checkbox.qc:3
void CheckBox_Click(entity me, entity other)
Definition: checkbox.qc:7
void XonoticInputSettingsTab_fill(entity me)
entity makeXonoticKeyBinder()
Definition: keybinder.qc:140
float CVAR_TYPEFLAG_ENGINE
entity makeXonoticTextSlider(string theCvar)
Definition: textslider.qc:10
void KeyBinder_Bind_Clear(entity btn, entity me)
Definition: keybinder.qc:313
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
void KeyBinder_Bind_Change(entity btn, entity me)
Definition: keybinder.qc:206