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