]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_settings_input.c
Merge tag 'xonotic-v0.6.0' into nyov/dedicated-startupscreen
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_input.c
1 #ifdef INTERFACE
2 CLASS(XonoticInputSettingsTab) EXTENDS(XonoticTab)
3         METHOD(XonoticInputSettingsTab, fill, void(entity))
4         ATTRIB(XonoticInputSettingsTab, title, string, _("Input"))
5         ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9)
6         ATTRIB(XonoticInputSettingsTab, rows, float, 17)
7         ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space 
8 ENDCLASS(XonoticInputSettingsTab)
9 entity makeXonoticInputSettingsTab();
10 #endif
11
12 #ifdef IMPLEMENTATION
13 entity makeXonoticInputSettingsTab()
14 {
15         entity me;
16         me = spawnXonoticInputSettingsTab();
17         me.configureDialog(me);
18         return me;
19 }
20 void XonoticInputSettingsTab_fill(entity me)
21 {
22         entity e;
23         entity kb;
24
25         me.TR(me);
26                 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Key bindings:")));
27         me.TR(me);
28                 me.TD(me, me.rows - 4, 3, kb = makeXonoticKeyBinder());
29         me.gotoRC(me, me.rows - 3, 0);
30                 me.TD(me, 1, 1, e = makeXonoticButton(_("Change key..."), '0 0 0'));
31                         e.onClick = KeyBinder_Bind_Change;
32                         e.onClickEntity = kb;
33                         kb.keyGrabButton = e;
34                 me.TD(me, 1, 1, e = makeXonoticButton(_("Edit..."), '0 0 0'));
35                         e.onClick = KeyBinder_Bind_Edit;
36                         e.onClickEntity = kb;
37                         kb.userbindEditButton = e;
38                         kb.userbindEditDialog = main.userbindEditDialog;
39                         main.userbindEditDialog.keybindBox = kb;
40                 me.TD(me, 1, 1, e = makeXonoticButton(_("Clear"), '0 0 0'));
41                         e.onClick = KeyBinder_Bind_Clear;
42                         e.onClickEntity = kb;
43
44         me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
45                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_closeontoggleconsole", _("Pressing \"enter console\" key also closes it")));
46         me.TR(me);
47                 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_movement_track_canjump", _("Automatically repeat jumping if holding jump")));
48         me.TR(me);
49         me.TR(me);
50                 if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
51                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joy_enable", _("Use joystick input")));
52                 else if(cvar_type("joystick") & CVAR_TYPEFLAG_ENGINE)
53                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joystick", _("Use joystick input")));
54                 else
55                 {
56                         me.TD(me, 1, 3, e = makeXonoticCheckBox(0, string_null, _("Use joystick input")));
57                         e.disabled = 1; // the option is never available in this case, just there for show
58                 }
59         me.TR(me);
60         me.TR(me);
61                 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Mouse:")));
62         me.TR(me);
63                 me.TDempty(me, 0.2);
64                 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Sensitivity:")));
65                 me.TD(me, 1, 2, e = makeXonoticSlider(1, 32, 0.2, "sensitivity"));
66         me.TR(me);
67                 me.TDempty(me, 0.2);
68                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "m_filter", _("Smooth aiming")));
69         me.TR(me);
70                 me.TDempty(me, 0.2);
71                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1.022, "m_pitch", _("Invert aiming")));
72         me.TR(me);
73                 me.TDempty(me, 0.2);
74                 if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE)
75                         me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "vid_dgamouse", _("Disable system mouse acceleration")));
76                 else if(cvar_type("apple_mouse_noaccel") & CVAR_TYPEFLAG_ENGINE)
77                         me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "apple_mouse_noaccel", _("Disable system mouse acceleration")));
78                 else
79                 {
80                         me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, string_null, _("Disable system mouse acceleration")));
81                         e.disabled = 1; // the option is never available in this case, just there for show
82                 }
83         me.TR(me);
84                 me.TDempty(me, 0.2);
85                 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "m_accelerate", _("Enable built in mouse acceleration")));
86                 
87         
88         me.gotoRC(me, me.rows - 1, 0);
89                 me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_movement_track_canjump", COMMANDBUTTON_APPLY));
90 }
91 #endif