Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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 "slider.qh"
7#include "mixedslider.qh"
8#include "checkbox.qh"
9#include "button.qh"
10#include "radiobutton.qh"
11
17{
18 entity me;
20 me.configureDialog(me);
21 return me;
22}
23
25{
26 entity e;
27 entity weaponsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
28 "sendcvar cl_weaponpriority"
30 weaponsApplyButton.disableOnClick = true;
31
32 me.TR(me);
33 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Weapon Priority List (* = mutator weapon)")));
34 me.TR(me);
35 me.TDempty(me, 0.2);
36 me.TD(me, 9, 2.6, e = me.weaponsList = makeXonoticWeaponsList());
37 e.applyButton = weaponsApplyButton;
38 me.gotoRC(me, 10, 0.2);
39 me.TD(me, 1, 2.6/2, 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, 2.6/2, e = makeXonoticButton(_("Down"), '0 0 0'));
45 e.onClickEntity = me.weaponsList;
46 e.applyButton = weaponsApplyButton;
47 me.TR(me);
48 me.TR(me);
49 me.TDempty(me, 0.2);
50 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling"),
51 _("Make use of the list above when cycling through weapons with the mouse wheel")));
52 me.TR(me);
53 me.TDempty(me, 0.2);
54 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "cl_weaponimpulsemode", _("Cycle through only usable weapon selections")));
55 e.sendCvars = true;
56
57 me.gotoRC(me, 0, 3); me.setFirstColumn(me, me.currentColumn);
58 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Weapon Options")));
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.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_autoswitch", _("Auto switch weapons on pickup"),
63 _("Automatically switch to newly picked up weapons if they are better than what you are carrying")));
64 e.sendCvars = true;
65 me.TR(me);
66 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Auto switch in CTS:")));
67 me.TD(me, 1, 1.8, e = makeXonoticMixedSlider("cl_autoswitch_cts"));
68 e.addText(e, _("Never"), 0);
69 e.addText(e, _("Default"), -1);
70 e.addText(e, _("Always"), 1);
71 e.configureXonoticMixedSliderValues(e);
72 e.sendCvars = true;
73
74 me.TR(me);
75 me.TR(me);
76 me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Weapon Visuals")));
77 me.TR(me);
78 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "r_drawviewmodel", _("Draw 1st person weapon model"),
79 _("Draw the weapon model")));
80 me.TR(me);
81 me.TDempty(me, 0.2);
82 me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton_T(1, "cl_gunalign", "4", _("Left align"),
83 _("Position of the weapon model; requires reconnect")));
84 setDependentNOT(e, "cl_viewmodel_alpha", 0);
85 setDependentAND(e, "r_drawviewmodel", 1, 1);
86 me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton_T(1, "cl_gunalign", "1", _("Center"),
87 _("Position of the weapon model; requires reconnect")));
88 setDependentNOT(e, "cl_viewmodel_alpha", 0);
89 setDependentAND(e, "r_drawviewmodel", 1, 1);
90 me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton_T(1, "cl_gunalign", "3", _("Right align"),
91 _("Position of the weapon model; requires reconnect")));
92 setDependentNOT(e, "cl_viewmodel_alpha", 0);
93 setDependentAND(e, "r_drawviewmodel", 1, 1);
94 me.TR(me);
95 me.TDempty(me, 0.2);
96 me.TD(me, 1, 2.8/2, e = makeXonoticCheckBox_T(0, "cl_followmodel", _("Gun model swaying"), "-"));
97 makeMulti(e, "cl_leanmodel");
98 setDependentNOT(e, "cl_viewmodel_alpha", 0);
99 setDependentAND(e, "r_drawviewmodel", 1, 1);
100 me.TD(me, 1, 2.8/2, e = makeXonoticCheckBox(0, "cl_bobmodel", _("Gun model bobbing")));
101 setDependentNOT(e, "cl_viewmodel_alpha", 0);
102 setDependentAND(e, "r_drawviewmodel", 1, 1);
103 me.TR(me);
104 me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Weapon model opacity:")));
105 setDependent(e, "r_drawviewmodel", 1, 1);
106 me.TD(me, 1, 1.8, e = makeXonoticSlider(0.05, 1, 0.05, "cl_viewmodel_alpha"));
107 e.formatString = "%";
108 setDependent(e, "r_drawviewmodel", 1, 1);
109
110 me.TR(me);
111 me.TR(me);
112 me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Apply team colors to weapon beam effects:")));
113 me.TR(me);
114 me.TDempty(me, 0.2);
115 me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_tracers_teamcolor", "0", _("Never")));
116 me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_tracers_teamcolor", "1", _("In team games")));
117 me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_tracers_teamcolor", "2", _("Always")));
118
119 me.gotoRC(me, me.rows - 1, 0); me.setFirstColumn(me, me.currentColumn);
120 me.TD(me, 1, me.columns, weaponsApplyButton);
121}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
#define COMMANDBUTTON_APPLY
entity makeXonoticGameWeaponsSettingsTab()
void XonoticGameWeaponsSettingsTab_showNotify(entity me)
void XonoticGameWeaponsSettingsTab_fill(entity me)
entity makeXonoticButton(string theText, vector theColor)
Definition button.qc:10
void loadAllCvars(entity root)
Definition util.qc:53
void setDependentAND(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:213
void makeMulti(entity e, string otherCvars)
Definition util.qc:92
void setDependentNOT(entity e, string theCvarName, float theCvarValue)
Definition util.qc:192
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
Definition util.qc:180
#define NEW(cname,...)
Definition oo.qh:117
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticHeaderLabel(string theText)
Definition textlabel.qc:10
entity makeXonoticWeaponsList()
void WeaponsList_MoveDown_Click(entity box, entity me)
void WeaponsList_MoveUp_Click(entity box, entity me)
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition checkbox.qc:3
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition checkbox.qc:28
entity makeXonoticMixedSlider(string theCvar)
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
entity makeXonoticRadioButton_T(float theGroup, string theCvar, string theValue, string theText, string theTooltip)
Definition radiobutton.qc:3
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition slider.qc:10