X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_settings_game_weapons.qc;h=5c77faffb501ed0ca2aebf740dd8d559548b94d4;hb=e5448270eedbb55ef2ba895425862fb30a24faf5;hp=5b20e384219e5d6095933e2b225be6f48df71073;hpb=068324d293df795dbc41de75f38256b8c6c35607;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc index 5b20e3842..5c77faffb 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc @@ -1,21 +1,13 @@ -#ifndef DIALOG_SETTINGS_GAME_WEAPONS_H -#define DIALOG_SETTINGS_GAME_WEAPONS_H -#include "tab.qc" -CLASS(XonoticGameWeaponsSettingsTab, XonoticTab) - METHOD(XonoticGameWeaponsSettingsTab, fill, void(entity)); - METHOD(XonoticGameWeaponsSettingsTab, showNotify, void(entity)); - ATTRIB(XonoticGameWeaponsSettingsTab, title, string, _("Weapons")) - ATTRIB(XonoticGameWeaponsSettingsTab, intendedWidth, float, 0.9) - ATTRIB(XonoticGameWeaponsSettingsTab, rows, float, 15.5) - ATTRIB(XonoticGameWeaponsSettingsTab, columns, float, 6) - ATTRIB(XonoticGameWeaponsSettingsTab, weaponsList, entity, NULL) -ENDCLASS(XonoticGameWeaponsSettingsTab) -entity makeXonoticGameWeaponsSettingsTab(); -#include "../gamesettings.qh" -REGISTER_SETTINGS(Weapons, makeXonoticGameWeaponsSettingsTab()); -#endif +#include "dialog_settings_game_weapons.qh" + +#include "weaponslist.qh" +#include "commandbutton.qh" +#include "textlabel.qh" +#include "textslider.qh" +#include "checkbox.qh" +#include "button.qh" +#include "radiobutton.qh" -#ifdef IMPLEMENTATION void XonoticGameWeaponsSettingsTab_showNotify(entity me) { loadAllCvars(me); @@ -31,6 +23,10 @@ entity makeXonoticGameWeaponsSettingsTab() void XonoticGameWeaponsSettingsTab_fill(entity me) { entity e; + entity weaponsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', + "sendcvar cl_weaponpriority;" + , COMMANDBUTTON_APPLY); + weaponsApplyButton.disableOnClick = true; me.TR(me); me.TDempty(me, 0.25); @@ -38,23 +34,28 @@ void XonoticGameWeaponsSettingsTab_fill(entity me) me.TR(me); me.TDempty(me, 0.25); me.TD(me, 9, 2.5, e = me.weaponsList = makeXonoticWeaponsList()); + e.applyButton = weaponsApplyButton; me.gotoRC(me, 10, 0.25); me.TD(me, 1, 1.25, e = makeXonoticButton(_("Up"), '0 0 0')); e.onClick = WeaponsList_MoveUp_Click; e.onClickEntity = me.weaponsList; + e.applyButton = weaponsApplyButton; me.TD(me, 1, 1.25, e = makeXonoticButton(_("Down"), '0 0 0')); e.onClick = WeaponsList_MoveDown_Click; e.onClickEntity = me.weaponsList; + e.applyButton = weaponsApplyButton; me.gotoRC(me, 0, 3); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling"), _("Make use of the list above when cycling through weapons with the mouse wheel"))); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_weaponimpulsemode", _("Cycle through only usable weapon selections"))); + e.sendCvars = true; me.TR(me); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_autoswitch", _("Auto switch weapons on pickup"), _("Automatically switch to newly picked up weapons if they are better than what you are carrying"))); + e.sendCvars = true; me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_unpress_attack_on_weapon_switch", _("Release attack buttons when you switch weapons"))); me.TR(me); @@ -72,6 +73,18 @@ void XonoticGameWeaponsSettingsTab_fill(entity me) me.TD(me, 1, 1.0, e = makeXonoticRadioButton_T(1, "cl_gunalign", "3", _("Right align"), _("Position of the weapon model; requires reconnect"))); setDependent(e, "r_drawviewmodel", 1, 1); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Weapon model opacity:"))); + setDependent(e, "r_drawviewmodel", 1, 1); + + me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_viewmodel_alpha")); + setDependent(e, "r_drawviewmodel", 1, 1); + e.addValue(e, "15%", "0.15"); + e.addValue(e, "25%", "0.25"); + e.addValue(e, "50%", "0.5"); + e.addValue(e, "75%", "0.75"); + e.addValue(e, "100%", "1"); + e.configureXonoticTextSliderValues(e); me.TR(me); me.TR(me); me.TDempty(me, 0.2); @@ -83,7 +96,5 @@ void XonoticGameWeaponsSettingsTab_fill(entity me) me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_bobmodel", _("Gun model bobbing"))); setDependent(e, "r_drawviewmodel", 1, 1); me.gotoRC(me, me.rows - 1, 0); me.setFirstColumn(me, me.currentColumn); - me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', - "sendcvar cl_autoswitch; sendcvar cl_weaponpriority; sendcvar cl_weaponimpulsemode", COMMANDBUTTON_APPLY)); + me.TD(me, 1, me.columns, weaponsApplyButton); } -#endif