Xonotic
dialog_settings_game_weapons.qc
Go to the documentation of this file.
2 
3 #include "weaponslist.qh"
4 #include "commandbutton.qh"
5 #include "textlabel.qh"
6 #include "textslider.qh"
7 #include "checkbox.qh"
8 #include "button.qh"
9 #include "radiobutton.qh"
10 
12 {
13  loadAllCvars(me);
14 }
16 {
17  entity me;
19  me.configureDialog(me);
20  return me;
21 }
22 
24 {
25  entity e;
26  entity weaponsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
27  "sendcvar cl_weaponpriority;"
29  weaponsApplyButton.disableOnClick = true;
30 
31  me.TR(me);
32  me.TDempty(me, 0.25);
33  me.TD(me, 1, 2.5, e = makeXonoticHeaderLabel(_("Weapon Priority List (* = mutator weapon)")));
34  me.TR(me);
35  me.TDempty(me, 0.25);
36  me.TD(me, 9, 2.5, e = me.weaponsList = makeXonoticWeaponsList());
37  e.applyButton = weaponsApplyButton;
38  me.gotoRC(me, 10, 0.25);
39  me.TD(me, 1, 1.25, e = makeXonoticButton(_("Up"), '0 0 0'));
40  e.onClick = WeaponsList_MoveUp_Click;
41  e.onClickEntity = me.weaponsList;
42  e.applyButton = weaponsApplyButton;
43  me.TD(me, 1, 1.25, e = makeXonoticButton(_("Down"), '0 0 0'));
44  e.onClick = WeaponsList_MoveDown_Click;
45  e.onClickEntity = me.weaponsList;
46  e.applyButton = weaponsApplyButton;
47 
48  me.gotoRC(me, 0, 3); me.setFirstColumn(me, me.currentColumn);
49  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling"),
50  _("Make use of the list above when cycling through weapons with the mouse wheel")));
51  me.TR(me);
52  me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_weaponimpulsemode", _("Cycle through only usable weapon selections")));
53  e.sendCvars = true;
54  me.TR(me);
55  me.TR(me);
56  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_autoswitch", _("Auto switch weapons on pickup"),
57  _("Automatically switch to newly picked up weapons if they are better than what you are carrying")));
58  e.sendCvars = true;
59  me.TR(me);
60  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_unpress_attack_on_weapon_switch", _("Release attack buttons when you switch weapons")));
61  me.TR(me);
62  me.TR(me);
63  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "r_drawviewmodel", _("Draw 1st person weapon model"),
64  _("Draw the weapon model")));
65  me.TR(me);
66  me.TDempty(me, 0.2);
67  me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "cl_gunalign", "4", _("Left align"),
68  _("Position of the weapon model; requires reconnect")));
69  setDependent(e, "r_drawviewmodel", 1, 1);
70  me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "cl_gunalign", "1", _("Center"),
71  _("Position of the weapon model; requires reconnect")));
72  setDependent(e, "r_drawviewmodel", 1, 1);
73  me.TD(me, 1, 1.0, e = makeXonoticRadioButton_T(1, "cl_gunalign", "3", _("Right align"),
74  _("Position of the weapon model; requires reconnect")));
75  setDependent(e, "r_drawviewmodel", 1, 1);
76  me.TR(me);
77  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Weapon model opacity:")));
78  setDependent(e, "r_drawviewmodel", 1, 1);
79 
80  me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_viewmodel_alpha"));
81  setDependent(e, "r_drawviewmodel", 1, 1);
82  e.addValue(e, "15%", "0.15");
83  e.addValue(e, "25%", "0.25");
84  e.addValue(e, "50%", "0.5");
85  e.addValue(e, "75%", "0.75");
86  e.addValue(e, "100%", "1");
87  e.configureXonoticTextSliderValues(e);
88  me.TR(me);
89  me.TR(me);
90  me.TDempty(me, 0.2);
91  me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "cl_followmodel", _("Gun model swaying"), "-"));
92  makeMulti(e, "cl_leanmodel");
93  setDependent(e, "r_drawviewmodel", 1, 1);
94  me.TR(me);
95  me.TDempty(me, 0.2);
96  me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_bobmodel", _("Gun model bobbing")));
97  setDependent(e, "r_drawviewmodel", 1, 1);
98  me.gotoRC(me, me.rows - 1, 0); me.setFirstColumn(me, me.currentColumn);
99  me.TD(me, 1, me.columns, weaponsApplyButton);
100 }
void XonoticGameWeaponsSettingsTab_showNotify(entity me)
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticHeaderLabel(string theText)
Definition: textlabel.qc:10
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
void WeaponsList_MoveDown_Click(entity box, entity me)
Definition: weaponslist.qc:37
entity makeXonoticRadioButton_T(float theGroup, string theCvar, string theValue, string theText, string theTooltip)
Definition: radiobutton.qc:3
void XonoticGameWeaponsSettingsTab_fill(entity me)
entity makeXonoticWeaponsList()
Definition: weaponslist.qc:7
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition: checkbox.qc:3
entity makeXonoticGameWeaponsSettingsTab()
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
entity makeXonoticTextSlider(string theCvar)
Definition: textslider.qc:10
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
#define COMMANDBUTTON_APPLY
void WeaponsList_MoveUp_Click(entity box, entity me)
Definition: weaponslist.qc:29