Hook collision line alpha

This commit is contained in:
Tater 2022-03-30 20:15:27 -05:00
parent ebb092211a
commit 3a197aa3da
3 changed files with 11 additions and 1 deletions

View file

@ -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(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(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(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(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.") 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.")

View file

@ -2319,11 +2319,19 @@ void CMenus::RenderSettingsHUD(CUIRect MainView)
CUIRect Button, Label; CUIRect Button, Label;
MainView.HSplitTop(5.0f, &Button, &MainView); MainView.HSplitTop(5.0f, &Button, &MainView);
MainView.HSplitTop(20.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); 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); 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(5.0f, 0x0, &MainView);
MainView.HSplitTop(25.0f, &SectionTwo, &MainView); MainView.HSplitTop(25.0f, &SectionTwo, &MainView);

View file

@ -90,6 +90,7 @@ void CPlayers::RenderHookCollLine(
bool Local = m_pClient->m_Snap.m_LocalClientID == ClientID; bool Local = m_pClient->m_Snap.m_LocalClientID == ClientID;
bool OtherTeam = m_pClient->IsOtherTeam(ClientID); bool OtherTeam = m_pClient->IsOtherTeam(ClientID);
float Alpha = (OtherTeam || ClientID < 0) ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f; float Alpha = (OtherTeam || ClientID < 0) ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f;
Alpha *= (float)g_Config.m_ClHookCollAlpha / 100;
float IntraTick = Intra; float IntraTick = Intra;
if(ClientID >= 0) if(ClientID >= 0)