]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_settings_game_weapons.qc
Header police
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_game_weapons.qc
1 #include "dialog_settings_game_weapons.qh"
2 #ifndef DIALOG_SETTINGS_GAME_WEAPONS_H
3 #define DIALOG_SETTINGS_GAME_WEAPONS_H
4 #include "tab.qc"
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());
17 #endif
18
19 #ifdef IMPLEMENTATION
20 void XonoticGameWeaponsSettingsTab_showNotify(entity me)
21 {
22         loadAllCvars(me);
23 }
24 entity makeXonoticGameWeaponsSettingsTab()
25 {
26         entity me;
27         me = NEW(XonoticGameWeaponsSettingsTab);
28         me.configureDialog(me);
29         return me;
30 }
31
32 void XonoticGameWeaponsSettingsTab_fill(entity me)
33 {
34         entity e;
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;
41
42         me.TR(me);
43                 me.TDempty(me, 0.25);
44                 me.TD(me, 1, 2.5, e = makeXonoticHeaderLabel(_("Weapon Priority List (* = mutator weapon)")));
45         me.TR(me);
46                 me.TDempty(me, 0.25);
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;
58
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")));
62         me.TR(me);
63                 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_weaponimpulsemode", _("Cycle through only usable weapon selections")));
64                         e.applyButton = weaponsApplyButton;
65         me.TR(me);
66         me.TR(me);
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;
70         me.TR(me);
71                 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_unpress_attack_on_weapon_switch", _("Release attack buttons when you switch weapons")));
72         me.TR(me);
73         me.TR(me);
74                 me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "r_drawviewmodel", _("Draw 1st person weapon model"),
75                         _("Draw the weapon model")));
76         me.TR(me);
77                 me.TDempty(me, 0.2);
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);
87         me.TR(me);
88         me.TR(me);
89                 me.TDempty(me, 0.2);
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);
93         me.TR(me);
94                 me.TDempty(me, 0.2);
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);
99 }
100 #endif