From 31f0ca0b52c23fc560a592a4ebafdf85c8890419 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 6 Jan 2020 17:41:25 +0000 Subject: [PATCH] Merge branch Mario/weapon_opacity_menu (S merge request) --- qcsrc/client/view.qc | 2 +- qcsrc/menu/xonotic/dialog_settings_game_weapons.qc | 13 +++++++++++++ xonotic-client.cfg | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 66f80ad2c..1b1e8ebdc 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -48,7 +48,7 @@ #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOSHADOW | EF_SELECTABLE | EF_TELEPORT_BIT) float autocvar_cl_viewmodel_scale; -float autocvar_cl_viewmodel_alpha; +float autocvar_cl_viewmodel_alpha = 1; bool autocvar_cl_bobmodel; float autocvar_cl_bobmodel_speed; diff --git a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc index 8eac7301a..5c77faffb 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc @@ -3,6 +3,7 @@ #include "weaponslist.qh" #include "commandbutton.qh" #include "textlabel.qh" +#include "textslider.qh" #include "checkbox.qh" #include "button.qh" #include "radiobutton.qh" @@ -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); diff --git a/xonotic-client.cfg b/xonotic-client.cfg index fe08cabdd..6673a3807 100644 --- a/xonotic-client.cfg +++ b/xonotic-client.cfg @@ -735,7 +735,7 @@ seta cl_forcemyplayercolors 0 "set to the color value (encoding is same as _cl_c seta cl_movement_errorcompensation 1 "try to compensate for prediction errors and reduce perceived lag" seta cl_movement_intermissionrunning 0 "keep velocity after the match ends, players may appear to continue running while stationary" -seta cl_viewmodel_alpha 0 "Maximum transparency of the view model, set to 0 to disable" +seta cl_viewmodel_alpha 1 "Maximum transparency of the view model, set to 0 to disable" set debugdraw 0 set debugdraw_filter "" -- 2.39.2