1 #include "dialog_settings_game_weapons.qh"
2 #ifndef DIALOG_SETTINGS_GAME_WEAPONS_H
3 #define DIALOG_SETTINGS_GAME_WEAPONS_H
5 CLASS(XonoticGameWeaponsSettingsTab, XonoticTab)
6 METHOD(XonoticGameWeaponsSettingsTab, fill, void(entity));
7 METHOD(XonoticGameWeaponsSettingsTab, showNotify, void(entity));
8 ATTRIB(XonoticGameWeaponsSettingsTab, title, string, _("Weapons"))
9 ATTRIB(XonoticGameWeaponsSettingsTab, intendedWidth, float, 0.9)
10 ATTRIB(XonoticGameWeaponsSettingsTab, rows, float, 15.5)
11 ATTRIB(XonoticGameWeaponsSettingsTab, columns, float, 6)
12 ATTRIB(XonoticGameWeaponsSettingsTab, weaponsList, entity, NULL)
13 ENDCLASS(XonoticGameWeaponsSettingsTab)
14 entity makeXonoticGameWeaponsSettingsTab();
15 #include "../gamesettings.qh"
16 REGISTER_SETTINGS(Weapons, makeXonoticGameWeaponsSettingsTab());
20 void XonoticGameWeaponsSettingsTab_showNotify(entity me)
24 entity makeXonoticGameWeaponsSettingsTab()
27 me = NEW(XonoticGameWeaponsSettingsTab);
28 me.configureDialog(me);
32 void XonoticGameWeaponsSettingsTab_fill(entity me)
35 entity weaponsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
36 "sendcvar cl_autoswitch;"
37 "sendcvar cl_weaponpriority;"
38 "sendcvar cl_weaponimpulsemode;"
39 , COMMANDBUTTON_APPLY);
40 weaponsApplyButton.disableOnClick = true;
44 me.TD(me, 1, 2.5, e = makeXonoticHeaderLabel(_("Weapon Priority List (* = mutator weapon)")));
47 me.TD(me, 9, 2.5, e = me.weaponsList = makeXonoticWeaponsList());
48 e.applyButton = weaponsApplyButton;
49 me.gotoRC(me, 10, 0.25);
50 me.TD(me, 1, 1.25, e = makeXonoticButton(_("Up"), '0 0 0'));
51 e.onClick = WeaponsList_MoveUp_Click;
52 e.onClickEntity = me.weaponsList;
53 e.applyButton = weaponsApplyButton;
54 me.TD(me, 1, 1.25, e = makeXonoticButton(_("Down"), '0 0 0'));
55 e.onClick = WeaponsList_MoveDown_Click;
56 e.onClickEntity = me.weaponsList;
57 e.applyButton = weaponsApplyButton;
59 me.gotoRC(me, 0, 3); me.setFirstColumn(me, me.currentColumn);
60 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling"),
61 _("Make use of the list above when cycling through weapons with the mouse wheel")));
63 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_weaponimpulsemode", _("Cycle through only usable weapon selections")));
64 e.applyButton = weaponsApplyButton;
67 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_autoswitch", _("Auto switch weapons on pickup"),
68 _("Automatically switch to newly picked up weapons if they are better than what you are carrying")));
69 e.applyButton = weaponsApplyButton;
71 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_unpress_attack_on_weapon_switch", _("Release attack buttons when you switch weapons")));
74 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "r_drawviewmodel", _("Draw 1st person weapon model"),
75 _("Draw the weapon model")));
78 me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "cl_gunalign", "4", _("Left align"),
79 _("Position of the weapon model; requires reconnect")));
80 setDependent(e, "r_drawviewmodel", 1, 1);
81 me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "cl_gunalign", "1", _("Center"),
82 _("Position of the weapon model; requires reconnect")));
83 setDependent(e, "r_drawviewmodel", 1, 1);
84 me.TD(me, 1, 1.0, e = makeXonoticRadioButton_T(1, "cl_gunalign", "3", _("Right align"),
85 _("Position of the weapon model; requires reconnect")));
86 setDependent(e, "r_drawviewmodel", 1, 1);
90 me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "cl_followmodel", _("Gun model swaying"), "-"));
91 makeMulti(e, "cl_leanmodel");
92 setDependent(e, "r_drawviewmodel", 1, 1);
95 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_bobmodel", _("Gun model bobbing")));
96 setDependent(e, "r_drawviewmodel", 1, 1);
97 me.gotoRC(me, me.rows - 1, 0); me.setFirstColumn(me, me.currentColumn);
98 me.TD(me, 1, me.columns, weaponsApplyButton);