diff --git a/src/engine/shared/tater_variables.h b/src/engine/shared/tater_variables.h index 0913a16f8db..42809e0abdf 100644 --- a/src/engine/shared/tater_variables.h +++ b/src/engine/shared/tater_variables.h @@ -121,6 +121,9 @@ MACRO_CONFIG_INT(ClRenderCursorSpecAlpha, tc_cursor_in_spec_alpha, 100, 0, 100, MACRO_CONFIG_INT(ClRenderNameplateSpec, tc_render_nameplate_spec, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Render nameplates when spectating") +MACRO_CONFIG_INT(ClTinyTees, tc_tiny_tees, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Render tees smaller") +MACRO_CONFIG_INT(ClTinyTeesOthers, tc_tiny_tees_others, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Render other tees smaller") + //Profiles MACRO_CONFIG_INT(ClApplyProfileSkin, tc_profile_skin, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Apply skin in profiles") MACRO_CONFIG_INT(ClApplyProfileName, tc_profile_name, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Apply name in profiles") @@ -134,6 +137,9 @@ MACRO_CONFIG_INT(ClAutoVerify, tc_auto_verify, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG // Rainbow MACRO_CONFIG_INT(ClRainbow, tc_rainbow, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Turn on rainbow client side") +MACRO_CONFIG_INT(ClRainbowHook, tc_rainbow_hook, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Rainbow hook") +MACRO_CONFIG_INT(ClRainbowWeapon, tc_rainbow_weapon, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Rainbow Weapons") + MACRO_CONFIG_INT(ClRainbowOthers, tc_rainbow_others, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Turn on rainbow client side for others") MACRO_CONFIG_INT(ClRainbowMode, tc_rainbow_mode, 1, 1, 4, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Rainbow mode (1: rainbow, 2: pulse, 3: darkness, 4: random)") MACRO_CONFIG_INT(ClRainbowSpeed, tc_rainbow_speed, 100, 0, 10000, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Rainbow speed as a percentage (50 = half speed, 200 = double speed)") diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index dda8e071a85..893b3c657d0 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -96,7 +96,7 @@ void CPlayers::RenderHand6(const CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir const CSkin::SSkinTextures *pSkinTextures = pInfo->m_CustomColoredSkin ? &pInfo->m_ColorableRenderSkin : &pInfo->m_OriginalRenderSkin; - if(!(g_Config.m_ClRainbow == 1 || g_Config.m_ClRainbowOthers == 1)) + if(!g_Config.m_ClRainbow) { Graphics()->SetColor(pInfo->m_ColorBody.r, pInfo->m_ColorBody.g, pInfo->m_ColorBody.b, Alpha); } @@ -374,6 +374,7 @@ void CPlayers::RenderHook( if(Prev.m_HookState > 0 && Player.m_HookState > 0) { Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); + if(ClientId < 0) Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.5f); @@ -399,6 +400,12 @@ void CPlayers::RenderHook( // render head int QuadOffset = NUM_WEAPONS * 2 + 2; Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha); + + bool Local = m_pClient->m_Snap.m_LocalClientId == ClientId; + bool DontOthers = !g_Config.m_ClRainbowOthers && !Local; + if(g_Config.m_ClRainbow && g_Config.m_ClRainbowHook && !DontOthers) + Graphics()->SetColor(GameClient()->m_Rainbow.m_RainbowColor.WithAlpha(Alpha)); + Graphics()->RenderQuadContainerAsSprite(m_WeaponEmoteQuadContainerIndex, QuadOffset, HookPos.x, HookPos.y); // render chain @@ -419,6 +426,9 @@ void CPlayers::RenderHook( Graphics()->QuadsSetRotation(0); Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); + if(g_Config.m_ClRainbow && g_Config.m_ClRainbowHook && !DontOthers) + Graphics()->SetColor(GameClient()->m_Rainbow.m_RainbowColor.WithAlpha(Alpha)); + RenderHand(&RenderInfo, Position, normalize(HookPos - Pos), -pi / 2, vec2(20, 0), Alpha); } } @@ -442,6 +452,8 @@ void CPlayers::RenderPlayer( // float Alpha = (OtherTeam || ClientId < 0) ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f; bool Spec = m_pClient->m_Snap.m_SpecInfo.m_Active; + RenderTools()->m_LocalTeeRender = Local; // TClient + float Alpha = 1.0f; if(OtherTeam || ClientId < 0) Alpha = g_Config.m_ClShowOthersAlpha / 100.0f; @@ -603,6 +615,10 @@ void CPlayers::RenderPlayer( Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha); + bool DontOthers = !g_Config.m_ClRainbowOthers && !Local; + if(g_Config.m_ClRainbow && g_Config.m_ClRainbowWeapon && !DontOthers) + Graphics()->SetColor(GameClient()->m_Rainbow.m_RainbowColor.WithAlpha(Alpha)); + vec2 Dir = Direction; float Recoil = 0.0f; vec2 WeaponPosition; @@ -764,6 +780,9 @@ void CPlayers::RenderPlayer( Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); Graphics()->QuadsSetRotation(0); + if(g_Config.m_ClRainbow && !DontOthers) + Graphics()->SetColor(GameClient()->m_Rainbow.m_RainbowColor.WithAlpha(Alpha)); + switch(Player.m_Weapon) { case WEAPON_GUN: RenderHand(&RenderInfo, WeaponPosition, Direction, -3 * pi / 4, vec2(-15, 4), Alpha); break; @@ -788,7 +807,6 @@ void CPlayers::RenderPlayer( RenderTools()->RenderTee(&State, &Shadow, Player.m_Emote, Direction, ShadowPosition, 0.5f); // render ghost } RenderTools()->RenderTee(&State, &RenderInfo, Player.m_Emote, Direction, Position, Alpha); - float TeeAnimScale, TeeBaseSize; CRenderTools::GetRenderTeeAnimScaleAndBaseSize(&RenderInfo, TeeAnimScale, TeeBaseSize); vec2 BodyPos = Position + vec2(State.GetBody()->m_X, State.GetBody()->m_Y) * TeeAnimScale; @@ -883,6 +901,8 @@ void CPlayers::RenderPlayerGhost( bool OtherTeam = m_pClient->IsOtherTeam(ClientId); float Alpha = 1.0f; + RenderTools()->m_LocalTeeRender = Local; // TClient + bool FrozenSwappingHide = (m_pClient->m_aClients[ClientId].m_FreezeEnd > 0) && g_Config.m_ClHideFrozenGhosts && g_Config.m_ClSwapGhosts; if(OtherTeam || ClientId < 0) diff --git a/src/game/client/components/tclient/menus_tclient.cpp b/src/game/client/components/tclient/menus_tclient.cpp index b3957a5d6d4..6a3d6023c32 100644 --- a/src/game/client/components/tclient/menus_tclient.cpp +++ b/src/game/client/components/tclient/menus_tclient.cpp @@ -632,6 +632,8 @@ void CMenus::RenderSettingsTClientSettngs(CUIRect MainView) DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClFreezeStars, Localize("Freeze stars"), &g_Config.m_ClFreezeStars, &Column, LineSize); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClColorFreeze, Localize("Color frozen tee skins"), &g_Config.m_ClColorFreeze, &Column, LineSize); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClHammerRotatesWithCursor, Localize("Make hammer rotate with cursor"), &g_Config.m_ClHammerRotatesWithCursor, &Column, LineSize); + DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClTinyTees, Localize("Tiny tees"), &g_Config.m_ClTinyTees, &Column, LineSize); + DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClTinyTeesOthers, Localize("Tiny tees others"), &g_Config.m_ClTinyTeesOthers, &Column, LineSize); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClWhiteFeet, Localize("Render all custom colored feet as white feet skin"), &g_Config.m_ClWhiteFeet, &Column, LineSize); CUIRect FeetBox; Column.HSplitTop(LineSize + MarginExtraSmall, &FeetBox, &Column); @@ -948,6 +950,8 @@ void CMenus::RenderSettingsTClientSettngs(CUIRect MainView) s_RainbowDropDownState.m_SelectionPopupContext.m_pScrollRegion = &s_RainbowDropDownScrollRegion; int RainbowSelectedOld = g_Config.m_ClRainbowMode - 1; DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClRainbow, Localize("Rainbow"), &g_Config.m_ClRainbow, &Column, LineSize); + DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClRainbowWeapon, Localize("Rainbow weapons"), &g_Config.m_ClRainbowWeapon, &Column, LineSize); + DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClRainbowHook, Localize("Rainbow hook"), &g_Config.m_ClRainbowHook, &Column, LineSize); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClRainbowOthers, Localize("Rainbow others"), &g_Config.m_ClRainbowOthers, &Column, LineSize); Column.HSplitTop(MarginExtraSmall, nullptr, &Column); CUIRect DropDownRect; diff --git a/src/game/client/components/tclient/rainbow.cpp b/src/game/client/components/tclient/rainbow.cpp index 8180ff2094e..3c5adbebbf1 100644 --- a/src/game/client/components/tclient/rainbow.cpp +++ b/src/game/client/components/tclient/rainbow.cpp @@ -10,8 +10,9 @@ #include "rainbow.h" -template -T color_lerp(T a, T b, float c) { +template +T color_lerp(T a, T b, float c) +{ T result; for(size_t i = 0; i < 4; ++i) result[i] = a[i] + c * (b[i] - a[i]); @@ -20,7 +21,6 @@ T color_lerp(T a, T b, float c) { void CRainbow::OnRender() { - if(!g_Config.m_ClRainbow && !g_Config.m_ClRainbowOthers) return; if(g_Config.m_ClRainbowMode == 0) @@ -57,11 +57,12 @@ void CRainbow::OnRender() break; } + m_RainbowColor = Col; + for(int i = 0; i < MAX_CLIENTS; i++) { if(!m_pClient->m_Snap.m_aCharacters[i].m_Active) continue; - // check if local player bool Local = m_pClient->m_Snap.m_LocalClientId == i; CTeeRenderInfo *RenderInfo = &m_pClient->m_aClients[i].m_RenderInfo; diff --git a/src/game/client/components/tclient/rainbow.h b/src/game/client/components/tclient/rainbow.h index 305944e41f5..5ac3c041cf6 100644 --- a/src/game/client/components/tclient/rainbow.h +++ b/src/game/client/components/tclient/rainbow.h @@ -15,6 +15,8 @@ class CRainbow : public CComponent COLORMODE_DARKNESS, COLORMODE_RANDOM }; + + ColorRGBA m_RainbowColor = ColorRGBA(1,1,1,1); }; #endif diff --git a/src/game/client/render.cpp b/src/game/client/render.cpp index a41f81ef9a2..246da48a656 100644 --- a/src/game/client/render.cpp +++ b/src/game/client/render.cpp @@ -517,6 +517,12 @@ void CRenderTools::RenderTee6(const CAnimState *pAnim, const CTeeRenderInfo *pIn vec2 Direction = Dir; vec2 Position = Pos; + const float TinyBodyScale = 0.7f; + const float TinyFeetScale = 0.85f; + bool TinyTee = g_Config.m_ClTinyTees; + if(!m_LocalTeeRender && !g_Config.m_ClTinyTeesOthers) + TinyTee = false; + const CSkin::SSkinTextures *pSkinTextures = pInfo->m_CustomColoredSkin ? &pInfo->m_ColorableRenderSkin : &pInfo->m_OriginalRenderSkin; // first pass we draw the outline @@ -529,6 +535,13 @@ void CRenderTools::RenderTee6(const CAnimState *pAnim, const CTeeRenderInfo *pIn { float AnimScale, BaseSize; GetRenderTeeAnimScaleAndBaseSize(pInfo, AnimScale, BaseSize); + + if(TinyTee) + { + BaseSize *= TinyBodyScale; + AnimScale *= TinyBodyScale; + } + if(Filling == 1) { Graphics()->QuadsSetRotation(pAnim->GetBody()->m_Angle * pi * 2); @@ -582,12 +595,24 @@ void CRenderTools::RenderTee6(const CAnimState *pAnim, const CTeeRenderInfo *pIn } } + if(TinyTee) + { + BaseSize /= TinyBodyScale; + AnimScale /= TinyBodyScale; + } + // draw feet const CAnimKeyframe *pFoot = Filling ? pAnim->GetFrontFoot() : pAnim->GetBackFoot(); float w = BaseSize; float h = BaseSize / 2; + if(TinyTee) + { + w *= TinyFeetScale; + h *= TinyFeetScale; + } + int QuadOffset = 7; if(Dir.x < 0 && pInfo->m_FeetFlipped) { diff --git a/src/game/client/render.h b/src/game/client/render.h index 1eee0ec6f64..5f87d231a39 100644 --- a/src/game/client/render.h +++ b/src/game/client/render.h @@ -205,6 +205,8 @@ class CRenderTools class ITextRender *TextRender() const { return m_pTextRender; } class CGameClient *GameClient() const { return m_pGameClient; } + bool m_LocalTeeRender = false; // TClient + void Init(class IGraphics *pGraphics, class ITextRender *pTextRender, class CGameClient *pGameClient); void SelectSprite(int Id, int Flags = 0) const;