From bc44ee795b51a8eca4f0e741a07f2ef9272c41d0 Mon Sep 17 00:00:00 2001 From: Tater Date: Wed, 18 Sep 2024 21:56:21 -0500 Subject: [PATCH] fix some stuff --- src/engine/shared/config_variables.h | 1 + src/game/client/components/controls.cpp | 6 + src/game/client/components/outlines.cpp | 8 +- .../client/components/player_indicator.cpp | 126 +++++++++--------- src/game/client/components/players.cpp | 2 - src/game/client/components/voting.cpp | 2 +- 6 files changed, 74 insertions(+), 71 deletions(-) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 99bbbf520bb..ace4f0dcc13 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -69,6 +69,7 @@ MACRO_CONFIG_INT(ClShowChatTeamMembersOnly, cl_show_chat_team_members_only, 0, 0 MACRO_CONFIG_INT(ClShowChatSystem, cl_show_chat_system, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show chat messages from the server") MACRO_CONFIG_INT(ClShowKillMessages, cl_showkillmessages, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show kill messages") MACRO_CONFIG_INT(ClShowFinishMessages, cl_show_finish_messages, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show finish messages") +MACRO_CONFIG_INT(ClShowVotesAfterVoting, cl_show_votes_after_voting, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show votes window after voting") MACRO_CONFIG_INT(ClShowLocalTimeAlways, cl_show_local_time_always, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Always show local time") MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ingame FPS counter") MACRO_CONFIG_INT(ClShowpred, cl_showpred, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ingame prediction time in milliseconds") diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index 4a944b6f87f..b544329ee6e 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -477,6 +477,12 @@ bool CControls::CheckNewInput() NewInput = true; if(m_FastInput.m_Jump != TestInput.m_Jump) NewInput = true; + if(m_FastInput.m_NextWeapon != TestInput.m_NextWeapon) + NewInput = true; + if(m_FastInput.m_PrevWeapon != TestInput.m_PrevWeapon) + NewInput = true; + if(m_FastInput.m_WantedWeapon != TestInput.m_WantedWeapon) + NewInput = true; if(g_Config.m_ClSubTickAiming) { diff --git a/src/game/client/components/outlines.cpp b/src/game/client/components/outlines.cpp index c7a54ca6024..43c90109166 100644 --- a/src/game/client/components/outlines.cpp +++ b/src/game/client/components/outlines.cpp @@ -1,14 +1,13 @@ #include #include -#include #include +#include #include #include #include #include - #include "outlines.h" void COutlines::OnRender() @@ -25,7 +24,6 @@ void COutlines::OnRender() continue; - CTile *pGameTiles = NULL; for(int l = 0; l < pGroup->m_NumLayers; l++) @@ -40,7 +38,7 @@ void COutlines::OnRender() IsTeleLayer = true; if(pLayer == (CMapItemLayer *)GameClient()->Layers()->GameLayer()) { - IsGameLayer = true; + IsGameLayer = true; } if(g_Config.m_ClOutline && IsGameLayer) @@ -87,4 +85,4 @@ void COutlines::OnRender() } } } -} \ No newline at end of file +} diff --git a/src/game/client/components/player_indicator.cpp b/src/game/client/components/player_indicator.cpp index 4bde9d09f06..0f5a2519217 100644 --- a/src/game/client/components/player_indicator.cpp +++ b/src/game/client/components/player_indicator.cpp @@ -32,84 +32,84 @@ void CPlayerIndicator::OnRender() vec2 Position = m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientId].m_RenderPos; - if (g_Config.m_ClPlayerIndicator != 1) - return; - - + if(g_Config.m_ClPlayerIndicator != 1) + return; - Graphics()->TextureClear(); - ColorRGBA col = ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f); - if(!(m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientId) == 0 && g_Config.m_ClIndicatorTeamOnly)) + Graphics()->TextureClear(); + ColorRGBA col = ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f); + if(!(m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientId) == 0 && g_Config.m_ClIndicatorTeamOnly)) + { + for(int i = 0; i < MAX_CLIENTS; ++i) { - for(int i = 0; i < MAX_CLIENTS; ++i) + if(!m_pClient->m_Snap.m_apPlayerInfos[i] || i == m_pClient->m_Snap.m_LocalClientId) + continue; + + CGameClient::CClientData OtherTee = m_pClient->m_aClients[i]; + CCharacterCore *pOtherCharacter = &m_pClient->m_aClients[i].m_Predicted; + if( + OtherTee.m_Team == m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientId].m_Team && + !OtherTee.m_Spec && + m_pClient->m_Snap.m_aCharacters[i].m_Active) { - if(!m_pClient->m_Snap.m_apPlayerInfos[i] || i == m_pClient->m_Snap.m_LocalClientId) + if(g_Config.m_ClPlayerIndicatorFreeze && !(OtherTee.m_FreezeEnd > 0 || OtherTee.m_DeepFrozen)) continue; - CGameClient::CClientData OtherTee = m_pClient->m_aClients[i]; - CCharacterCore *pOtherCharacter = &m_pClient->m_aClients[i].m_Predicted; - if( - OtherTee.m_Team == m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientId].m_Team && - !OtherTee.m_Spec && - m_pClient->m_Snap.m_aCharacters[i].m_Active) - { - if(g_Config.m_ClPlayerIndicatorFreeze && !(OtherTee.m_FreezeEnd > 0 || OtherTee.m_DeepFrozen)) - continue; - - vec2 norm = NormalizedDirection(m_pClient->m_aClients[i].m_RenderPos, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientId].m_RenderPos) * (-1); + vec2 norm = NormalizedDirection(m_pClient->m_aClients[i].m_RenderPos, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientId].m_RenderPos) * (-1); - float Offset = g_Config.m_ClIndicatorOffset; - if(g_Config.m_ClIndicatorVariableDistance) - { - Offset = mix((float)g_Config.m_ClIndicatorOffset, (float)g_Config.m_ClIndicatorOffsetMax, - std::min(DistanceBetweenTwoPoints(Position, OtherTee.m_RenderPos) / g_Config.m_ClIndicatorMaxDistance, 1.0f)); - } + float Offset = g_Config.m_ClIndicatorOffset; + if(g_Config.m_ClIndicatorVariableDistance) + { + Offset = mix((float)g_Config.m_ClIndicatorOffset, (float)g_Config.m_ClIndicatorOffsetMax, + std::min(DistanceBetweenTwoPoints(Position, OtherTee.m_RenderPos) / g_Config.m_ClIndicatorMaxDistance, 1.0f)); + } - vec2 IndicatorPos(norm.x * Offset + Position.x, norm.y * Offset + Position.y); - CTeeRenderInfo TeeInfo = OtherTee.m_RenderInfo; - float Alpha = g_Config.m_ClIndicatorOpacity / 100.0f; - if(OtherTee.m_FreezeEnd > 0 || OtherTee.m_DeepFrozen) + vec2 IndicatorPos(norm.x * Offset + Position.x, norm.y * Offset + Position.y); + CTeeRenderInfo TeeInfo = OtherTee.m_RenderInfo; + float Alpha = g_Config.m_ClIndicatorOpacity / 100.0f; + if(OtherTee.m_FreezeEnd > 0 || OtherTee.m_DeepFrozen) + { + // check if player is frozen or is getting saved + if(pOtherCharacter->m_IsInFreeze == 0) { - // check if player is frozen or is getting saved - if(pOtherCharacter->m_IsInFreeze == 0) - { - // player is on the way to get free again - col = color_cast(ColorHSLA(g_Config.m_ClIndicatorSaved)); - }else{ - // player is frozen - col = color_cast(ColorHSLA(g_Config.m_ClIndicatorFreeze)); - } - if(g_Config.m_ClIndicatorTees) - { - TeeInfo.m_ColorBody.r *= 0.4; - TeeInfo.m_ColorBody.g *= 0.4; - TeeInfo.m_ColorBody.b *= 0.4; - TeeInfo.m_ColorFeet.r *= 0.4; - TeeInfo.m_ColorFeet.g *= 0.4; - TeeInfo.m_ColorFeet.b *= 0.4; - Alpha *= 0.8; - } + // player is on the way to get free again + col = color_cast(ColorHSLA(g_Config.m_ClIndicatorSaved)); } else { - col = color_cast(ColorHSLA(g_Config.m_ClIndicatorAlive)); + // player is frozen + col = color_cast(ColorHSLA(g_Config.m_ClIndicatorFreeze)); } - col.a = Alpha; - - TeeInfo.m_Size = g_Config.m_ClIndicatorRadius * 4.f; - if(g_Config.m_ClIndicatorTees) { - RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, OtherTee.m_RenderCur.m_Emote, vec2(1.0f, 0.0f), IndicatorPos, col.a); - } - else - { - Graphics()->QuadsBegin(); - Graphics()->SetColor(col); - Graphics()->DrawCircle(IndicatorPos.x, IndicatorPos.y, g_Config.m_ClIndicatorRadius, 16); - Graphics()->QuadsEnd(); + TeeInfo.m_ColorBody.r *= 0.4; + TeeInfo.m_ColorBody.g *= 0.4; + TeeInfo.m_ColorBody.b *= 0.4; + TeeInfo.m_ColorFeet.r *= 0.4; + TeeInfo.m_ColorFeet.g *= 0.4; + TeeInfo.m_ColorFeet.b *= 0.4; + Alpha *= 0.8; } } + else + { + col = color_cast(ColorHSLA(g_Config.m_ClIndicatorAlive)); + } + col.a = Alpha; + + TeeInfo.m_Size = g_Config.m_ClIndicatorRadius * 4.f; + + if(g_Config.m_ClIndicatorTees) + { + RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, OtherTee.m_RenderCur.m_Emote, vec2(1.0f, 0.0f), IndicatorPos, col.a); + } + else + { + Graphics()->QuadsBegin(); + Graphics()->SetColor(col); + Graphics()->DrawCircle(IndicatorPos.x, IndicatorPos.y, g_Config.m_ClIndicatorRadius, 16); + Graphics()->QuadsEnd(); + } } } -} \ No newline at end of file + } +} diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 5821847aa3f..c9faec1a5bf 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -1409,8 +1409,6 @@ void CPlayers::OnRender() if(RenderGhost && g_Config.m_ClShowOthersGhosts && !Spec && Client()->State() != IClient::STATE_DEMOPLAYBACK) RenderPlayerGhost(&m_pClient->m_aClients[ClientId].m_RenderPrev, &m_pClient->m_aClients[ClientId].m_RenderCur, &aRenderInfo[ClientId], ClientId); - if(RenderRegular || Spec) - RenderPlayer(&m_pClient->m_aClients[ClientId].m_RenderPrev, &m_pClient->m_aClients[ClientId].m_RenderCur, &aRenderInfo[ClientId], ClientId); RenderPlayer(&m_pClient->m_aClients[ClientId].m_RenderPrev, &m_pClient->m_aClients[ClientId].m_RenderCur, &aRenderInfo[ClientId], ClientId); } if(RenderLastId != -1 && m_pClient->m_Snap.m_aCharacters[RenderLastId].m_Active && IsPlayerInfoAvailable(RenderLastId)) diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 86495e1ca07..8a0282fdbb0 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -338,7 +338,7 @@ void CVoting::OnMessage(int MsgType, void *pRawMsg) void CVoting::Render() { - if((!m_pClient->m_Scoreboard.Active() && TakenChoice()) || !IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK) + if((!g_Config.m_ClShowVotesAfterVoting && !m_pClient->m_Scoreboard.Active() && TakenChoice()) || !IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK) return; const int Seconds = SecondsLeft(); if(Seconds < 0)