From 3a197aa3dae24e9a411aeb4ca36dd0a2bef6e6be Mon Sep 17 00:00:00 2001 From: Tater Date: Wed, 30 Mar 2022 20:15:27 -0500 Subject: [PATCH] Hook collision line alpha --- src/engine/shared/config_variables.h | 1 + src/game/client/components/menus_settings.cpp | 10 +++++++++- src/game/client/components/players.cpp | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index a224e165b..fc9401847 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -375,6 +375,7 @@ MACRO_CONFIG_INT(ClShowNinja, cl_show_ninja, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_S MACRO_CONFIG_INT(ClShowHookCollOther, cl_show_hook_coll_other, 1, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show other players' hook collision line (2 to always show)") MACRO_CONFIG_INT(ClShowHookCollOwn, cl_show_hook_coll_own, 1, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show own players' hook collision line (2 to always show)") MACRO_CONFIG_INT(ClHookCollSize, cl_hook_coll_size, 0, 0, 20, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Size of hook collision line") +MACRO_CONFIG_INT(ClHookCollAlpha, cl_hook_coll_alpha, 100, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Alpha of hook collision line (0 invisible, 100 fully visible)") MACRO_CONFIG_COL(ClHookCollColorNoColl, cl_hook_coll_color_no_coll, 65407, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Specifies the color of a hookline that hits nothing.") MACRO_CONFIG_COL(ClHookCollColorHookableColl, cl_hook_coll_color_hookable_coll, 6401973, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Specifies the color of a hookline that hits hookable tiles.") diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index c2c42bc8a..0c0ed37e2 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -2319,11 +2319,19 @@ void CMenus::RenderSettingsHUD(CUIRect MainView) CUIRect Button, Label; MainView.HSplitTop(5.0f, &Button, &MainView); MainView.HSplitTop(20.0f, &Button, &MainView); - Button.VSplitLeft(40.0f, &Label, &Button); + Button.VSplitLeft(45.0f, &Label, &Button); UI()->DoLabelScaled(&Label, Localize("Size"), 14.0f, TEXTALIGN_LEFT); g_Config.m_ClHookCollSize = (int)(UIEx()->DoScrollbarH(&g_Config.m_ClHookCollSize, &Button, g_Config.m_ClHookCollSize / 20.0f) * 20.0f); } + { + CUIRect Button, Label; + MainView.HSplitTop(5.0f, &Button, &MainView); + MainView.HSplitTop(20.0f, &Button, &MainView); + Button.VSplitLeft(45.0f, &Label, &Button); + UI()->DoLabelScaled(&Label, Localize("Alpha"), 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClHookCollAlpha = (int)(UIEx()->DoScrollbarH(&g_Config.m_ClHookCollAlpha, &Button, g_Config.m_ClHookCollAlpha / 100.0f) * 100.0f); + } MainView.HSplitTop(5.0f, 0x0, &MainView); MainView.HSplitTop(25.0f, &SectionTwo, &MainView); diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 7b7ab2011..5fdb53ddd 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -90,6 +90,7 @@ void CPlayers::RenderHookCollLine( bool Local = m_pClient->m_Snap.m_LocalClientID == ClientID; bool OtherTeam = m_pClient->IsOtherTeam(ClientID); float Alpha = (OtherTeam || ClientID < 0) ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f; + Alpha *= (float)g_Config.m_ClHookCollAlpha / 100; float IntraTick = Intra; if(ClientID >= 0)