From 9e1a202408ccfbae275cd0a2d154e1cd74d2c973 Mon Sep 17 00:00:00 2001 From: StA Date: Tue, 19 Dec 2023 11:57:22 +0300 Subject: [PATCH] rainbow is son of the bitch+button fixes --- src/engine/client/client.cpp | 2 +- src/game/client/components/menus_ingame.cpp | 21 +++++++++++++++++-- src/game/client/components/menus_settings.cpp | 2 +- src/game/client/components/parser.cpp | 1 - src/game/client/components/players.cpp | 9 +++++--- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 54f7b9d26..e5b2f74ce 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -462,7 +462,7 @@ void CClient::Connect(const char *pAddress, const char *pPassword) str_copy(m_aConnectAddressStr, pAddress); char aMsg[512]; - str_format(aMsg, sizeof(aMsg), "connecting to '%s'", m_aConnectAddressStr); + str_format(aMsg, sizeof(aMsg), "Joining... '%s'", m_aConnectAddressStr); m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "client", aMsg, gs_ClientNetworkPrintColor); ServerInfoRequest(); diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index 8962a73a0..e439c6744 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -956,15 +956,32 @@ void CMenus::RenderStats(CUIRect MainView) MP2.Draw(vec4(1, 1, 1, 0.25f), IGraphics::CORNER_B, 2.0f); char Welcome [128]; - if (strcmp(Client()->PlayerName(), "-StormAx") == 0) + const char *names[] = { + "meloƞ", "-StormAx", "我叫芙焦", "Mʎɹ シ", "Cheeru", "Mónik" + }; + + for + (int i = 0; i < sizeof(names) / sizeof(names[0]); i++) { + if (strcmp(Client()->PlayerName(), names[i]) == 0) + { + break; + } ColorRGBA col = color_cast(ColorHSVA(round_to_int(LocalTime() * 15.f) % 255 /255.f, 1.f, 1.f)); TextRender()->TextColor(col); } + static CStatsPlayer s_StatsPlayer; + str_format(Welcome, sizeof(Welcome), " Welcome Back, %s", Client()->PlayerName()); UI()->DoLabel(&WB, Welcome, 40.0f, TEXTALIGN_ML); - return TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); + TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f); + + + + str_format(Welcome, sizeof(Welcome), " Current points: %s", s_StatsPlayer.Points); + UI()->DoLabel(&CP, Welcome, 40.0f, TEXTALIGN_ML); + } else if(s_StatsPage == 1) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index fb880a1e0..0a248075a 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -3481,7 +3481,7 @@ void CMenus::RenderSettingsStA(CUIRect MainView) g_Config.m_ClAutoVerify ^= 1; Left.HSplitTop(20.0f, &Button, &Left); - if(DoButton_CheckBox(&g_Config.m_ClAutoVerify, Localize("Display skin name in nameplates"), g_Config.m_ClAutoVerify, &Button)) + if(DoButton_CheckBox(&g_Config.m_ClShowSkinName, Localize("Display skin name in nameplates"), g_Config.m_ClShowSkinName, &Button)) g_Config.m_ClShowSkinName ^= 1; } diff --git a/src/game/client/components/parser.cpp b/src/game/client/components/parser.cpp index 8cd2cdeea..d577fe3d3 100644 --- a/src/game/client/components/parser.cpp +++ b/src/game/client/components/parser.cpp @@ -6,7 +6,6 @@ CStats::CStats() = default; - void CStats::FetchPlayer(CStatsPlayer *pStatsDest, const char *pPlayer) { char aUrl_DDStats[256]; diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index c742d0713..2846c79d6 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -474,9 +474,11 @@ void CPlayers::RenderPlayer( } // rainbow + bool IsRainbowBody = g_Config.m_ClRainbow, IsRainbowFeet = g_Config.m_ClRainbow; - g_Config.m_ClRainbow = Local == 1; + g_Config.m_ClRainbow = Local; + if(g_Config.m_ClRainbow == 1) { IsRainbowBody = true; @@ -484,10 +486,11 @@ void CPlayers::RenderPlayer( } else { - IsRainbowBody = false; - IsRainbowFeet = false; + IsRainbowBody = 0; + IsRainbowFeet = 0; } + // draw gun { static vec2 s_aGunPositions[MAX_CLIENTS];