From 7cfadf63c8d89175a0842f0fdb4323693a8586cf Mon Sep 17 00:00:00 2001 From: Tater Date: Wed, 24 Apr 2024 21:33:35 -0500 Subject: [PATCH] Fix ddnet changes --- src/engine/client/client.cpp | 12 +- src/engine/client/client.h | 2 +- src/engine/shared/config.cpp | 12 +- src/engine/shared/config.h | 4 +- src/engine/shared/config_variables.h | 1 - src/game/client/components/bindwheel.cpp | 10 +- src/game/client/components/hud.cpp | 24 +-- src/game/client/components/menus_browser.cpp | 4 +- src/game/client/components/menus_settings.cpp | 192 ++++++++++-------- src/game/client/components/nameplates.cpp | 8 +- .../client/components/player_indicator.cpp | 12 +- src/game/client/components/players.cpp | 100 ++++----- src/game/client/components/players.h | 2 +- src/game/client/components/rainbow.cpp | 2 +- src/game/client/components/spectator.cpp | 4 +- src/game/client/components/verify.cpp | 12 +- src/game/client/components/voting.cpp | 2 +- src/game/client/gameclient.cpp | 22 +- src/game/client/gameclient.h | 6 +- src/game/client/render_map.cpp | 8 +- src/game/tater_variables.h | 2 - 21 files changed, 233 insertions(+), 208 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index d5659a82e21..b94cfcf53f5 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -401,8 +401,8 @@ void CClient::EnterGame(int Conn) if(State() == IClient::STATE_DEMOPLAYBACK) return; - m_CodeRunAfterJoin[Conn] = false; - m_CodeRunAfterJoinConsole[Conn] = false; + m_aCodeRunAfterJoin[Conn] = false; + m_aCodeRunAfterJoinConsole[Conn] = false; // now we will wait for two snapshots // to finish the connection @@ -1896,10 +1896,10 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy) int64_t TimeLeft = (TickStart - Now) * 1000 / time_freq(); m_aGameTime[Conn].Update(&m_GametimeMarginGraph, (GameTick - 1) * time_freq() / GameTickSpeed(), TimeLeft, CSmoothTime::ADJUSTDIRECTION_DOWN); } - if(g_Config.m_ClRunOnJoinConsole && m_aReceivedSnapshots[Conn] > g_Config.m_ClRunOnJoinDelay && !m_CodeRunAfterJoinConsole[Conn]) + if(g_Config.m_ClRunOnJoinConsole && m_aReceivedSnapshots[Conn] > g_Config.m_ClRunOnJoinDelay && !m_aCodeRunAfterJoinConsole[Conn]) { m_pConsole->ExecuteLine(g_Config.m_ClRunOnJoin); - m_CodeRunAfterJoinConsole[Conn] = true; + m_aCodeRunAfterJoinConsole[Conn] = true; } if(m_aReceivedSnapshots[Conn] > GameTickSpeed() && !m_aCodeRunAfterJoin[Conn]) @@ -1911,7 +1911,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy) char aBufTO[256]; str_format(aBufTO, sizeof(aBufTO), "/timeout %s", m_aTimeoutCodes[Conn]); TOMsgp.m_pMessage = aBufTO; - CMsgPacker PackerTO(TOMsgp.ms_MsgID, false); + CMsgPacker PackerTO(TOMsgp.ms_MsgId, false); TOMsgp.Pack(&PackerTO); SendMsg(Conn, &PackerTO, MSGFLAG_VITAL); @@ -1967,7 +1967,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy) if(g_Config.m_ClRunOnJoin[0] || g_Config.m_ClDummyDefaultEyes || g_Config.m_ClPlayerDefaultEyes) SendMsg(Conn, &PackerTimeout, MSGFLAG_VITAL); } - m_CodeRunAfterJoin[Conn] = true; + m_aCodeRunAfterJoin[Conn] = true; } // ack snapshot diff --git a/src/engine/client/client.h b/src/engine/client/client.h index 22d766f6c13..2fdf8995579 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -132,7 +132,7 @@ class CClient : public IClient, public CDemoPlayer::IListener char m_aTimeoutCodes[NUM_DUMMIES][32] = {"", ""}; bool m_aCodeRunAfterJoin[NUM_DUMMIES] = {false, false}; - bool m_CodeRunAfterJoinConsole[NUM_DUMMIES] = {false, false}; + bool m_aCodeRunAfterJoinConsole[NUM_DUMMIES] = {false, false}; bool m_GenerateTimeoutSeed = true; char m_aCmdConnect[256] = ""; diff --git a/src/engine/shared/config.cpp b/src/engine/shared/config.cpp index d8ac046e69c..7b3c5970687 100644 --- a/src/engine/shared/config.cpp +++ b/src/engine/shared/config.cpp @@ -272,7 +272,6 @@ CConfigManager::CConfigManager() m_pConsole = nullptr; m_pStorage = nullptr; m_ConfigFile = 0; - m_NumTCallbacks = 0; m_Failed = false; } @@ -476,8 +475,10 @@ bool CConfigManager::TSave() #undef MACRO_CONFIG_COL #undef MACRO_CONFIG_STR - for(int i = 0; i < m_NumTCallbacks; i++) - m_aTCallbacks[i].m_pfnFunc(this, m_aTCallbacks[i].m_pUserData); + for(const auto &Callback : m_vTCallbacks) + { + Callback.m_pfnFunc(this, Callback.m_pUserData); + } if(io_sync(m_ConfigFile) != 0) @@ -513,10 +514,7 @@ void CConfigManager::RegisterCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) void CConfigManager::RegisterTCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) { - dbg_assert(m_NumTCallbacks < MAX_CALLBACKS, "too many tater config callbacks"); - m_aTCallbacks[m_NumTCallbacks].m_pfnFunc = pfnFunc; - m_aTCallbacks[m_NumTCallbacks].m_pUserData = pUserData; - m_NumTCallbacks++; + m_vTCallbacks.emplace_back(pfnFunc, pUserData); } diff --git a/src/engine/shared/config.h b/src/engine/shared/config.h index bd4bb560fb0..a53a45d9a10 100644 --- a/src/engine/shared/config.h +++ b/src/engine/shared/config.h @@ -19,6 +19,7 @@ #define AUTOEXEC_CLIENT_FILE "autoexec_client.cfg" #define AUTOEXEC_SERVER_FILE "autoexec_server.cfg" #define TCONFIG_FILE "settings_tclient.cfg" +#define MAX_CALLBACKS 64; class CConfig { @@ -201,6 +202,7 @@ class CConfigManager : public IConfigManager } }; std::vector m_vCallbacks; + std::vector m_vTCallbacks; std::vector m_vpAllVariables; std::vector m_vpGameVariables; @@ -211,8 +213,6 @@ class CConfigManager : public IConfigManager static void Con_Toggle(IConsole::IResult *pResult, void *pUserData); static void Con_ToggleStroke(IConsole::IResult *pResult, void *pUserData); - CCallback m_aTCallbacks[MAX_CALLBACKS]; - int m_NumTCallbacks; public: CConfigManager(); diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 35aca524bc2..03479e563fe 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -67,7 +67,6 @@ MACRO_CONFIG_INT(ClShowChatFriends, cl_show_chat_friends, 0, 0, 1, CFGFLAG_CLIEN 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/bindwheel.cpp b/src/game/client/components/bindwheel.cpp index bbc9fa05ebe..8df01c7bdf5 100644 --- a/src/game/client/components/bindwheel.cpp +++ b/src/game/client/components/bindwheel.cpp @@ -53,6 +53,7 @@ void CBindWheel::ConchainBindwheel(IConsole::IResult *pResult, void *pUserData, pThis->updateBinds(bindpos, description, command); } } + void CBindWheel::OnConsoleInit() { IConfigManager *pConfigManager = Kernel()->RequestInterface(); @@ -96,7 +97,7 @@ bool CBindWheel::OnCursorMove(float x, float y, IInput::ECursorType CursorType) return false; } - UI()->ConvertMouseMove(&x, &y, CursorType); + Ui()->ConvertMouseMove(&x, &y, CursorType); m_SelectorMouse += vec2(x, y); return true; } @@ -131,9 +132,9 @@ void CBindWheel::OnRender() if(length(m_SelectorMouse) > 110.0f) m_SelectedBind = (int)(SelectedAngle / (2 * pi) * NUM_BINDWHEEL); - CUIRect Screen = *UI()->Screen(); + CUIRect Screen = *Ui()->Screen(); - UI()->MapScreen(); + Ui()->MapScreen(); Graphics()->BlendNormal(); @@ -218,4 +219,5 @@ void CBindWheel::ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserD pConfigManager->WriteLine(aBuf); } -} \ No newline at end of file +} + diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index 234f7d13781..0ddaefb6cd6 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -562,17 +562,17 @@ void CHud::RenderTextInfo() char aBuf[64]; float yOff = 3; - int PlayerId = m_pClient->m_Snap.m_LocalClientID; + int PlayerId = m_pClient->m_Snap.m_LocalClientId; if(m_pClient->m_Snap.m_SpecInfo.m_Active) - PlayerId = m_pClient->m_Snap.m_SpecInfo.m_SpectatorID; + PlayerId = m_pClient->m_Snap.m_SpecInfo.m_SpectatorId; - if(g_Config.m_ClShowhudDDRace && m_pClient->m_Snap.m_aCharacters[PlayerId].m_HasExtendedData && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) + if(g_Config.m_ClShowhudDDRace && m_pClient->m_Snap.m_aCharacters[PlayerId].m_HasExtendedData && m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW) yOff += 50; - else if(g_Config.m_ClShowhudHealthAmmo && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) + else if(g_Config.m_ClShowhudHealthAmmo && m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW) yOff += 27; vec2 Pos; - if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) + if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorId == SPEC_FREEVIEW) Pos = vec2(GameClient()->m_Controls.m_aMousePos[g_Config.m_ClDummy].x, GameClient()->m_Controls.m_aMousePos[g_Config.m_ClDummy].y); else Pos = m_pClient->m_aClients[PlayerId].m_RenderPos; @@ -583,7 +583,7 @@ void CHud::RenderTextInfo() yOff += TextHeight; str_format(aBuf, sizeof(aBuf), "Y: %.2f", Pos.y / 32.0f); TextRender()->Text(4, yOff, FontSize, aBuf, -1.0f); - if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) + if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW) { yOff += TextHeight; str_format(aBuf, sizeof(aBuf), "Angle: %d", m_pClient->m_aClients[PlayerId].m_RenderCur.m_Angle); @@ -605,9 +605,9 @@ void CHud::RenderTextInfo() { int NumInTeam = 0; int NumFrozen = 0; - int LocalTeamID = m_pClient->m_Snap.m_SpecInfo.m_Active == 1 && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != -1 ? - m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID) : - m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientID); + int LocalTeamID = m_pClient->m_Snap.m_SpecInfo.m_Active == 1 && m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != -1 ? + m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorId) : + m_pClient->m_Teams.Team(m_pClient->m_Snap.m_LocalClientId); for(int i = 0; i < MAX_CLIENTS; i++) { @@ -643,7 +643,7 @@ void CHud::RenderTextInfo() if(g_Config.m_ClShowFrozenText > 0) TextRender()->Text(m_Width / 2 - TextRender()->TextWidth(10, aBuf, -1, -1.0f) / 2, 12, 10, aBuf, -1.0f); - //str_format(aBuf, sizeof(aBuf), "%d", m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_PrevPredicted.m_FreezeEnd); + //str_format(aBuf, sizeof(aBuf), "%d", m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientId].m_PrevPredicted.m_FreezeEnd); //str_format(aBuf, sizeof(aBuf), "%d", g_Config.m_ClWhatsMyPing); //TextRender()->Text(0, m_Width / 2 - TextRender()->TextWidth(0, 10, aBuf, -1, -1.0f) / 2, 20, 10, aBuf, -1.0f); @@ -773,14 +773,14 @@ void CHud::RenderTeambalanceWarning() void CHud::RenderCursor() { - if((!m_pClient->m_Snap.m_pLocalCharacter && !(g_Config.m_ClRenderCursorSpec && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)) || Client()->State() == IClient::STATE_DEMOPLAYBACK) + if((!m_pClient->m_Snap.m_pLocalCharacter && !(g_Config.m_ClRenderCursorSpec && m_pClient->m_Snap.m_SpecInfo.m_SpectatorId == SPEC_FREEVIEW)) || Client()->State() == IClient::STATE_DEMOPLAYBACK) return; int CurWeapon = 1; RenderTools()->MapScreenToInterface(m_pClient->m_Camera.m_Center.x, m_pClient->m_Camera.m_Center.y); // render cursor - if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) + if(m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW) CurWeapon = m_pClient->m_Snap.m_pLocalCharacter->m_Weapon % NUM_WEAPONS; Graphics()->SetColor(1.f, 1.f, 1.f, 1.f); Graphics()->TextureSet(m_pClient->m_GameSkin.m_aSpriteWeaponCursors[CurWeapon]); diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 7929ead31ca..3d70bd00048 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -566,7 +566,7 @@ void CMenus::RenderServerbrowserStatusBox(CUIRect StatusBox, bool WasListboxItem str_format(aBuf, sizeof(aBuf), Localize("%d of %d servers"), ServerBrowser()->NumSortedServers(), ServerBrowser()->NumServers()); else str_format(aBuf, sizeof(aBuf), Localize("%d of %d server"), ServerBrowser()->NumSortedServers(), ServerBrowser()->NumServers()); - UI()->DoLabel(&ServersOnline, aBuf, 12.0f, TEXTALIGN_MR); + Ui()->DoLabel(&ServersOnline, aBuf, 12.0f, TEXTALIGN_MR); int NumPlayers = 0; for(int i = 0; i < ServerBrowser()->NumSortedServers(); i++) @@ -576,7 +576,7 @@ void CMenus::RenderServerbrowserStatusBox(CUIRect StatusBox, bool WasListboxItem str_format(aBuf, sizeof(aBuf), Localize("%d players"), NumPlayers); else str_format(aBuf, sizeof(aBuf), Localize("%d player"), NumPlayers); - UI()->DoLabel(&PlayersOnline, aBuf, 12.0f, TEXTALIGN_MR); + Ui()->DoLabel(&PlayersOnline, aBuf, 12.0f, TEXTALIGN_MR); } // address info diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index ee34022a79b..907c9d525f5 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -643,13 +643,19 @@ void CMenus::RenderSettingsTee(CUIRect MainView) } } } + CUIRect RandomColorsButton; // Player skin area CUIRect CustomColorsButton, RandomSkinButton; YourSkin.HSplitTop(20.0f, &Label, &YourSkin); YourSkin.HSplitBottom(20.0f, &YourSkin, &CustomColorsButton); + CustomColorsButton.VSplitRight(30.0f, &CustomColorsButton, &RandomSkinButton); - CustomColorsButton.VSplitRight(20.0f, &CustomColorsButton, nullptr); + CustomColorsButton.VSplitRight(3.0f, &CustomColorsButton, 0); + + CustomColorsButton.VSplitRight(110.0f, &CustomColorsButton, &RandomColorsButton); + + CustomColorsButton.VSplitRight(5.0f, &CustomColorsButton, nullptr); YourSkin.VSplitLeft(65.0f, &YourSkin, &Button); Button.VSplitLeft(5.0f, nullptr, &Button); Button.HMargin((Button.h - 20.0f) / 2.0f, &Button); @@ -710,6 +716,29 @@ void CMenus::RenderSettingsTee(CUIRect MainView) TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); GameClient()->m_Tooltips.DoToolTip(&s_RandomSkinButton, &RandomSkinButton, Localize("Create a random skin")); + static CButtonContainer s_RandomizeColors; + if(*pUseCustomColor) + { + //RandomColorsButton.VSplitLeft(120.0f, &RandomColorsButton, 0); + if(DoButton_Menu(&s_RandomizeColors, "Random Colors", 0, &RandomColorsButton, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0, 0, 0, 0.5f))) + { + if(m_Dummy) + { + g_Config.m_ClDummyColorBody = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false); + g_Config.m_ClDummyColorFeet = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false); + } + else + { + g_Config.m_ClPlayerColorBody = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false); + g_Config.m_ClPlayerColorFeet = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false); + } + SetNeedSendInfo(); + } + } + MainView.HSplitTop(5.0f, 0, &MainView); + MainView.HSplitTop(82.5f, &Label, &MainView); + + // Custom colors button if(DoButton_CheckBox(pUseCustomColor, Localize("Custom colors"), *pUseCustomColor, &CustomColorsButton)) { @@ -2111,12 +2140,12 @@ void CMenus::RenderSettings(CUIRect MainView) } else if(g_Config.m_UiSettingsPage == SETTINGS_TCLIENT) { - m_pBackground->ChangePosition(13); + GameClient()->m_MenuBackground.ChangePosition(13); RenderSettingsTClient(MainView); } else if(g_Config.m_UiSettingsPage == SETTINGS_PROFILES) { - m_pBackground->ChangePosition(14); + GameClient()->m_MenuBackground.ChangePosition(14); RenderSettingsProfiles(MainView); } else @@ -2562,9 +2591,6 @@ void CMenus::RenderSettingsAppearance(CUIRect MainView) DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClShowhudScore, Localize("Show score"), &g_Config.m_ClShowhudScore, &LeftView, LineSize); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClShowLocalTimeAlways, Localize("Show local time always"), &g_Config.m_ClShowLocalTimeAlways, &LeftView, LineSize); - // Settings of the HUD element for votes - DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClShowVotesAfterVoting, Localize("Show votes window after voting"), &g_Config.m_ClShowVotesAfterVoting, &LeftView, LineSize); - // ***** DDRace HUD ***** // RightView.HSplitTop(HeadlineHeight, &Label, &RightView); Ui()->DoLabel(&Label, Localize("DDRace HUD"), HeadlineFontSize, TEXTALIGN_ML); @@ -3214,7 +3240,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) MainView.VSplitLeft(MainView.w * 0.5, &MainView, &Column); MainView.HSplitTop(30.0f, &Section, &MainView); - UI()->DoLabel(&Section, ("Frozen Tee Display"), 20.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, ("Frozen Tee Display"), 20.0f, TEXTALIGN_LEFT); MainView.VSplitLeft(5.0f, 0x0, &MainView); MainView.HSplitTop(5.0f, 0x0, &MainView); @@ -3229,8 +3255,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(140.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i", "Max Rows", g_Config.m_ClFrozenMaxRows); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClFrozenMaxRows = (int)(UI()->DoScrollbarH(&g_Config.m_ClFrozenMaxRows, &Button, (g_Config.m_ClFrozenMaxRows - 1) / 5.0f) * 5.0f) + 1; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClFrozenMaxRows = (int)(Ui()->DoScrollbarH(&g_Config.m_ClFrozenMaxRows, &Button, (g_Config.m_ClFrozenMaxRows - 1) / 5.0f) * 5.0f) + 1; } { CUIRect Button, Label; @@ -3238,8 +3264,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(140.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i", "Tee Size", g_Config.m_ClFrozenHudTeeSize); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClFrozenHudTeeSize = (int)(UI()->DoScrollbarH(&g_Config.m_ClFrozenHudTeeSize, &Button, (g_Config.m_ClFrozenHudTeeSize - 8) / 19.0f) * 19.0f) + 8; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClFrozenHudTeeSize = (int)(Ui()->DoScrollbarH(&g_Config.m_ClFrozenHudTeeSize, &Button, (g_Config.m_ClFrozenHudTeeSize - 8) / 19.0f) * 19.0f) + 8; } { @@ -3265,7 +3291,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) // ***** MISCELLANEOUS ***** // MainView.VSplitLeft(-5.0f, 0x0, &MainView); MainView.HSplitTop(30.0f, &Section, &MainView); - UI()->DoLabel(&Section, ("Miscellaneous"), 20.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, ("Miscellaneous"), 20.0f, TEXTALIGN_LEFT); MainView.VSplitLeft(5.0f, 0x0, &MainView); MainView.HSplitTop(5.0f, 0x0, &MainView); @@ -3277,8 +3303,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(150.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %ims", "Delay", g_Config.m_ClRunOnJoinDelay * 20); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - int Delay = (int)(UI()->DoScrollbarH(&g_Config.m_ClRunOnJoinDelay, &Button, (g_Config.m_ClRunOnJoinDelay - 7) / 93.0f) * 93.0f) + 7; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + int Delay = (int)(Ui()->DoScrollbarH(&g_Config.m_ClRunOnJoinDelay, &Button, (g_Config.m_ClRunOnJoinDelay - 7) / 93.0f) * 93.0f) + 7; if(Delay < 100 || g_Config.m_ClRunOnJoinDelay <= 100) { g_Config.m_ClRunOnJoinDelay = Delay; @@ -3295,7 +3321,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) FeetBox.VSplitMid(&FeetBox, 0); static CLineInput s_WhiteFeet(g_Config.m_ClWhiteFeetSkin, sizeof(g_Config.m_ClWhiteFeetSkin)); s_WhiteFeet.SetEmptyText("x_ninja"); - UI()->DoEditBox(&s_WhiteFeet, &FeetBox, 12.0f); + Ui()->DoEditBox(&s_WhiteFeet, &FeetBox, 12.0f); } DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClMiniDebug, ("Show Position and angle (Mini debug)"), &g_Config.m_ClMiniDebug, &MainView, LineMargin); @@ -3313,7 +3339,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) static CLineInput s_LastInput(g_Config.m_ClNotifyWhenLastText, sizeof(g_Config.m_ClNotifyWhenLastText)); s_LastInput.SetEmptyText(Localize("Last!")); - UI()->DoEditBox(&s_LastInput, &Button, 12.0f); + Ui()->DoEditBox(&s_LastInput, &Button, 12.0f); MainView.HSplitTop(20.0f, &Section, &MainView); DoLine_ColorPicker(&NotifyWhenLastTextID, 22.0f, 150.0f, 14.0f, &Section, ("Notification Color"), &g_Config.m_ClNotifyWhenLastColor, ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f), false); } @@ -3341,8 +3367,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) // Button.VSplitLeft(150.0f, &Label, &Button); // char aBuf[64]; // str_format(aBuf, sizeof(aBuf), "%s: %i ", "Hook Line Width", g_Config.m_ClHookCollSize); - // UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - // g_Config.m_ClHookCollSize = (int)(UI()->DoScrollbarH(&g_Config.m_ClHookCollSize, &Button, g_Config.m_ClHookCollSize / 20.0f) * 20.0f); + // Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + // g_Config.m_ClHookCollSize = (int)(Ui()->DoScrollbarH(&g_Config.m_ClHookCollSize, &Button, g_Config.m_ClHookCollSize / 20.0f) * 20.0f); //} MainView.HSplitTop(10.0f, 0x0, &MainView); @@ -3352,7 +3378,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) MainView = Column; MainView.HSplitTop(30.0f, &Section, &MainView); - UI()->DoLabel(&Section, Localize("Tile Outlines"), 20.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, Localize("Tile Outlines"), 20.0f, TEXTALIGN_LEFT); MainView.VSplitLeft(5.0f, 0x0, &MainView); MainView.HSplitTop(5.0f, 0x0, &MainView); @@ -3370,8 +3396,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(150.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i ", "Outline Width", g_Config.m_ClOutlineWidth); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClOutlineWidth = (int)(UI()->DoScrollbarH(&g_Config.m_ClOutlineWidth, &Button, (g_Config.m_ClOutlineWidth - 1) / 15.0f) * 15.0f) + 1; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClOutlineWidth = (int)(Ui()->DoScrollbarH(&g_Config.m_ClOutlineWidth, &Button, (g_Config.m_ClOutlineWidth - 1) / 15.0f) * 15.0f) + 1; } { CUIRect Button, Label; @@ -3380,8 +3406,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(150.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i ", "Outline Alpha", g_Config.m_ClOutlineAlpha); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClOutlineAlpha = (int)(UI()->DoScrollbarH(&g_Config.m_ClOutlineAlpha, &Button, (g_Config.m_ClOutlineAlpha) / 100.0f) * 100.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClOutlineAlpha = (int)(Ui()->DoScrollbarH(&g_Config.m_ClOutlineAlpha, &Button, (g_Config.m_ClOutlineAlpha) / 100.0f) * 100.0f); } { CUIRect Button, Label; @@ -3390,8 +3416,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(185.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i ", "Outline Alpha (walls)", g_Config.m_ClOutlineAlphaSolid); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClOutlineAlphaSolid = (int)(UI()->DoScrollbarH(&g_Config.m_ClOutlineAlphaSolid, &Button, (g_Config.m_ClOutlineAlphaSolid) / 100.0f) * 100.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClOutlineAlphaSolid = (int)(Ui()->DoScrollbarH(&g_Config.m_ClOutlineAlphaSolid, &Button, (g_Config.m_ClOutlineAlphaSolid) / 100.0f) * 100.0f); } static CButtonContainer OutlineColorFreezeID, OutlineColorSolidID, OutlineColorTeleID, OutlineColorUnfreezeID; @@ -3399,16 +3425,16 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) MainView.VSplitLeft(-5.0f, 0x0, &MainView); MainView.HSplitTop(25.0f, &Section, &MainView); - DoLine_ColorPicker(&OutlineColorFreezeID, 25.0f, 240.0f, 14.0f, &Section, ("Freeze Outline Color"), &g_Config.m_ClOutlineColorFreeze, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); + DoLine_ColorPicker(&OutlineColorFreezeID, 25.0f, 13.0f, 5.0f, &Section, ("Freeze Outline Color"), &g_Config.m_ClOutlineColorFreeze, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); MainView.HSplitTop(25.0f, &Section, &MainView); - DoLine_ColorPicker(&OutlineColorSolidID, 25.0f, 240.0f, 14.0f, &Section, ("Walls Outline Color"), &g_Config.m_ClOutlineColorSolid, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); + DoLine_ColorPicker(&OutlineColorSolidID, 25.0f, 13.0f, 5.0f, &Section, ("Walls Outline Color"), &g_Config.m_ClOutlineColorSolid, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); MainView.HSplitTop(25.0f, &Section, &MainView); - DoLine_ColorPicker(&OutlineColorTeleID, 25.0f, 240.0f, 14.0f, &Section, ("Teleporter Outline Color"), &g_Config.m_ClOutlineColorTele, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); + DoLine_ColorPicker(&OutlineColorTeleID, 25.0f, 13.0f, 5.0f, &Section, ("Teleporter Outline Color"), &g_Config.m_ClOutlineColorTele, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); MainView.HSplitTop(25.0f, &Section, &MainView); - DoLine_ColorPicker(&OutlineColorUnfreezeID, 25.0f, 240.0f, 14.0f, &Section, ("Unfreeze Outline Color"), &g_Config.m_ClOutlineColorUnfreeze, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); + DoLine_ColorPicker(&OutlineColorUnfreezeID, 25.0f, 13.0f, 5.0f, &Section, ("Unfreeze Outline Color"), &g_Config.m_ClOutlineColorUnfreeze, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); { CUIRect Button; @@ -3417,7 +3443,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) ExtMenu.VSplitRight(130.0f, 0, &ExtMenu); ExtMenu.HSplitBottom(25.0f, &ExtMenu, &Button); static CButtonContainer s_DiscordButton; - if(DoButton_Menu(&s_DiscordButton, Localize("Discord"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_DiscordButton, Localize("Discord"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f))) { if(!open_link("https://discord.gg/fBvhH93Bt6")) { @@ -3433,7 +3459,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) MainView.VSplitLeft(MainView.w * 0.5, &MainView, &Column); MainView.HSplitTop(30.0f, &Section, &MainView); - UI()->DoLabel(&Section, ("Player Indicator"), 20.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, ("Player Indicator"), 20.0f, TEXTALIGN_LEFT); MainView.VSplitLeft(5.0f, 0x0, &MainView); MainView.HSplitTop(5.0f, 0x0, &MainView); @@ -3450,13 +3476,13 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) MainView.VSplitLeft(-5.0f, 0x0, &MainView); MainView.HSplitTop(25.0f, &Section, &MainView); - DoLine_ColorPicker(&IndicatorAliveColorID, 25.0f, 200.0f, 14.0f, &Section, ("Indicator alive color"), &g_Config.m_ClIndicatorAlive, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); + DoLine_ColorPicker(&IndicatorAliveColorID, 25.0f, 13.0f, 5.0f, &Section, ("Indicator alive color"), &g_Config.m_ClIndicatorAlive, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); MainView.HSplitTop(25.0f, &Section, &MainView); - DoLine_ColorPicker(&IndicatorDeadColorID, 25.0f, 200.0f, 14.0f, &Section, ("Indicator dead color"), &g_Config.m_ClIndicatorFreeze, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); + DoLine_ColorPicker(&IndicatorDeadColorID, 25.0f, 13.0f, 5.0f, &Section, ("Indicator dead color"), &g_Config.m_ClIndicatorFreeze, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); MainView.HSplitTop(25.0f, &Section, &MainView); - DoLine_ColorPicker(&IndicatorSavedColorID, 25.0f, 200.0f, 14.0f, &Section, ("Indicator save color"), &g_Config.m_ClIndicatorSaved, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); + DoLine_ColorPicker(&IndicatorSavedColorID, 25.0f, 13.0f, 5.0f, &Section, ("Indicator save color"), &g_Config.m_ClIndicatorSaved, ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f), false); { CUIRect Button, Label; @@ -3465,8 +3491,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(150.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i ", "Indicator size", g_Config.m_ClIndicatorRadius); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClIndicatorRadius = (int)(UI()->DoScrollbarH(&g_Config.m_ClIndicatorRadius, &Button, (g_Config.m_ClIndicatorRadius - 1) / 15.0f) * 15.0f) + 1; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClIndicatorRadius = (int)(Ui()->DoScrollbarH(&g_Config.m_ClIndicatorRadius, &Button, (g_Config.m_ClIndicatorRadius - 1) / 15.0f) * 15.0f) + 1; } { CUIRect Button, Label; @@ -3475,8 +3501,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(150.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i ", "Indicator opacity", g_Config.m_ClIndicatorOpacity); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClIndicatorOpacity = (int)(UI()->DoScrollbarH(&g_Config.m_ClIndicatorOpacity, &Button, (g_Config.m_ClIndicatorOpacity) / 100.0f) * 100.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClIndicatorOpacity = (int)(Ui()->DoScrollbarH(&g_Config.m_ClIndicatorOpacity, &Button, (g_Config.m_ClIndicatorOpacity) / 100.0f) * 100.0f); } { CUIRect Button, Label; @@ -3487,8 +3513,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) str_format(aBuf, sizeof(aBuf), "%s: %i ", "Indicator offset", g_Config.m_ClIndicatorOffset); if(g_Config.m_ClIndicatorVariableDistance) str_format(aBuf, sizeof(aBuf), "%s: %i ", "Min offset", g_Config.m_ClIndicatorOffset); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClIndicatorOffset = (int)(UI()->DoScrollbarH(&g_Config.m_ClIndicatorOffset, &Button, (g_Config.m_ClIndicatorOffset - 16) / 184.0f) * 184.0f) + 16; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClIndicatorOffset = (int)(Ui()->DoScrollbarH(&g_Config.m_ClIndicatorOffset, &Button, (g_Config.m_ClIndicatorOffset - 16) / 184.0f) * 184.0f) + 16; } if(g_Config.m_ClIndicatorVariableDistance) { @@ -3498,8 +3524,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(150.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i ", "Max offset", g_Config.m_ClIndicatorOffsetMax); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClIndicatorOffsetMax = (int)(UI()->DoScrollbarH(&g_Config.m_ClIndicatorOffsetMax, &Button, (g_Config.m_ClIndicatorOffsetMax - 16) / 184.0f) * 184.0f) + 16; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClIndicatorOffsetMax = (int)(Ui()->DoScrollbarH(&g_Config.m_ClIndicatorOffsetMax, &Button, (g_Config.m_ClIndicatorOffsetMax - 16) / 184.0f) * 184.0f) + 16; } if(g_Config.m_ClIndicatorVariableDistance) { @@ -3509,9 +3535,9 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(150.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i ", "Max distance", g_Config.m_ClIndicatorMaxDistance); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); int NewValue = (g_Config.m_ClIndicatorMaxDistance) / 50.0f; - NewValue = (int)(UI()->DoScrollbarH(&g_Config.m_ClIndicatorMaxDistance, &Button, (NewValue - 10) / 130.0f) * 130.0f) + 10; + NewValue = (int)(Ui()->DoScrollbarH(&g_Config.m_ClIndicatorMaxDistance, &Button, (NewValue - 10) / 130.0f) * 130.0f) + 10; g_Config.m_ClIndicatorMaxDistance = NewValue * 50; } @@ -3520,7 +3546,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) MainView = Column; MainView.HSplitTop(30.0f, &Section, &MainView); - UI()->DoLabel(&Section, Localize("Miscellaneous 2.0"), 20.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, Localize("Miscellaneous 2.0"), 20.0f, TEXTALIGN_LEFT); MainView.VSplitLeft(5.0f, 0x0, &MainView); MainView.HSplitTop(5.0f, 0x0, &MainView); @@ -3531,7 +3557,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) static std::vector s_DropDownNames = {Localize("Rainbow"), Localize("Pulse"), Localize("Black")}; - static CUI::SDropDownState s_RainbowDropDownState; + static CUi::SDropDownState s_RainbowDropDownState; static CScrollRegion s_RainbowDropDownScrollRegion; s_RainbowDropDownState.m_SelectionPopupContext.m_pScrollRegion = &s_RainbowDropDownScrollRegion; @@ -3542,7 +3568,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) CUIRect DropDownRect; MainView.HSplitTop(20.0f, &DropDownRect, &MainView); - const int NewRainbowMode = UI()->DoDropDown(&DropDownRect, OldSelected, s_DropDownNames.data(), s_DropDownNames.size(), s_RainbowDropDownState); + const int NewRainbowMode = Ui()->DoDropDown(&DropDownRect, OldSelected, s_DropDownNames.data(), s_DropDownNames.size(), s_RainbowDropDownState); if(OldSelected != NewRainbowMode) { @@ -3555,7 +3581,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) MainView.HSplitTop(10.0f, 0, &MainView); MainView.HSplitTop(30.0f, &Section, &MainView); - UI()->DoLabel(&Section, ("Anti Latency Tools"), 20.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, ("Anti Latency Tools"), 20.0f, TEXTALIGN_LEFT); MainView.VSplitLeft(15.0f, 0, &MainView); MainView.HSplitTop(5.0f, 0, &MainView); @@ -3565,8 +3591,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(165.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %ims", "Prediction Margin", g_Config.m_ClPredictionMargin); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - int PredictionMargin = (int)(UI()->DoScrollbarH(&g_Config.m_ClPredictionMargin, &Button, (g_Config.m_ClPredictionMargin - 10) / 15.0f) * 15.0f) + 10; + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + int PredictionMargin = (int)(Ui()->DoScrollbarH(&g_Config.m_ClPredictionMargin, &Button, (g_Config.m_ClPredictionMargin - 10) / 15.0f) * 15.0f) + 10; if((PredictionMargin < 25 || g_Config.m_ClPredictionMargin <= 25) && g_Config.m_ClPredictionMargin >= 10) { g_Config.m_ClPredictionMargin = PredictionMargin; @@ -3580,8 +3606,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(115.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %ims", "Delay", g_Config.m_ClUnfreezeLagDelayTicks * 20); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClUnfreezeLagDelayTicks = (int)(UI()->DoScrollbarH(&g_Config.m_ClUnfreezeLagDelayTicks, &Button, (g_Config.m_ClUnfreezeLagDelayTicks) / 200.0f) * 200.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClUnfreezeLagDelayTicks = (int)(Ui()->DoScrollbarH(&g_Config.m_ClUnfreezeLagDelayTicks, &Button, (g_Config.m_ClUnfreezeLagDelayTicks) / 200.0f) * 200.0f); } if(g_Config.m_ClRemoveAnti) { @@ -3590,8 +3616,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(200.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %ims", "Amount", g_Config.m_ClUnfreezeLagTicks * 20); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClUnfreezeLagTicks = (int)(UI()->DoScrollbarH(&g_Config.m_ClUnfreezeLagTicks, &Button, (g_Config.m_ClUnfreezeLagTicks) / 15.0f) * 15.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClUnfreezeLagTicks = (int)(Ui()->DoScrollbarH(&g_Config.m_ClUnfreezeLagTicks, &Button, (g_Config.m_ClUnfreezeLagTicks) / 15.0f) * 15.0f); } if(g_Config.m_ClRemoveAnti) { @@ -3607,14 +3633,14 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(125.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %ims", "Frozen Margin", g_Config.m_ClPredMarginInFreezeAmount); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClPredMarginInFreezeAmount = (int)(UI()->DoScrollbarH(&g_Config.m_ClPredMarginInFreezeAmount, &Button, (g_Config.m_ClPredMarginInFreezeAmount) / 100.0f) * 100.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClPredMarginInFreezeAmount = (int)(Ui()->DoScrollbarH(&g_Config.m_ClPredMarginInFreezeAmount, &Button, (g_Config.m_ClPredMarginInFreezeAmount) / 100.0f) * 100.0f); } //MainView.HSplitTop(10.0f, 0, &MainView); MainView.HSplitTop(30.0f, &Section, &MainView); - UI()->DoLabel(&Section, ("Ghost Tools"), 18, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, ("Ghost Tools"), 18, TEXTALIGN_LEFT); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClShowOthersGhosts, ("Show unpredicted ghosts for other players"), &g_Config.m_ClShowOthersGhosts, &MainView, LineMargin); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClSwapGhosts, ("Swap ghosts and normal players"), &g_Config.m_ClSwapGhosts, &MainView, LineMargin); @@ -3624,8 +3650,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(200.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i%%", "Predicted Alpha", g_Config.m_ClPredGhostsAlpha); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClPredGhostsAlpha = (int)(UI()->DoScrollbarH(&g_Config.m_ClPredGhostsAlpha, &Button, (g_Config.m_ClPredGhostsAlpha) / 50.0f) * 50.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClPredGhostsAlpha = (int)(Ui()->DoScrollbarH(&g_Config.m_ClPredGhostsAlpha, &Button, (g_Config.m_ClPredGhostsAlpha) / 50.0f) * 50.0f); } { CUIRect Button, Label; @@ -3633,8 +3659,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitLeft(200.0f, &Label, &Button); char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s: %i%%", "Unpredicted Alpha", g_Config.m_ClUnpredGhostsAlpha); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); - g_Config.m_ClUnpredGhostsAlpha = (int)(UI()->DoScrollbarH(&g_Config.m_ClUnpredGhostsAlpha, &Button, (g_Config.m_ClUnpredGhostsAlpha) / 100.0f) * 100.0f); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + g_Config.m_ClUnpredGhostsAlpha = (int)(Ui()->DoScrollbarH(&g_Config.m_ClUnpredGhostsAlpha, &Button, (g_Config.m_ClUnpredGhostsAlpha) / 100.0f) * 100.0f); } DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClHideFrozenGhosts, ("Hide ghosts of frozen players"), &g_Config.m_ClHideFrozenGhosts, &MainView, LineMargin); DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClRenderGhostAsCircle, ("Render ghosts as circles"), &g_Config.m_ClRenderGhostAsCircle, &MainView, LineMargin); @@ -3665,7 +3691,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s:", Localize((const char *)Key.m_pName)); - UI()->DoLabel(&KeyLabel, aBuf, 20.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&KeyLabel, aBuf, 20.0f, TEXTALIGN_LEFT); int OldId = Key.m_KeyId, OldModifierCombination = Key.m_ModifierCombination, NewModifierCombination; int NewId = DoKeyReader((void *)&Key.m_pName, &Button, OldId, OldModifierCombination, &NewModifierCombination); if(NewId != OldId || NewModifierCombination != OldModifierCombination) @@ -3681,7 +3707,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) if(s_CurCustomTab == TCLIENT_TAB_BINDWHEEL) { - CUIRect Screen = *UI()->Screen(); + CUIRect Screen = *Ui()->Screen(); MainView.VSplitLeft(MainView.w * 0.5, &MainView, &Column); CUIRect LeftColumn = MainView; MainView.HSplitTop(30.0f, &Section, &MainView); @@ -3751,12 +3777,12 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) buttons[i].VSplitLeft(150.0f, &buttons[i], 0); char aBuf[MAX_BINDWHEEL_CMD]; str_format(aBuf, sizeof(aBuf), "%s %d:", Localize("Description"), i + 1); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); s_BindWheelDesc[i].SetBuffer(GameClient()->m_Bindwheel.m_BindWheelList[i].description, sizeof(GameClient()->m_Bindwheel.m_BindWheelList[i].description)); s_BindWheelDesc[i].SetEmptyText(Localize("Description")); - UI()->DoEditBox(&s_BindWheelDesc[i], &buttons[i], 14.0f); + Ui()->DoEditBox(&s_BindWheelDesc[i], &buttons[i], 14.0f); // Command MainView.HSplitTop(5.0f, 0, &MainView); @@ -3764,12 +3790,12 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) buttons[i].VSplitLeft(80.0f, &Label, &buttons[i]); buttons[i].VSplitLeft(150.0f, &buttons[i], 0); str_format(aBuf, sizeof(aBuf), "%s %d:", Localize("Command"), i + 1); - UI()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Label, aBuf, 14.0f, TEXTALIGN_LEFT); s_BindWheelCmd[i].SetBuffer(GameClient()->m_Bindwheel.m_BindWheelList[i].command, sizeof(GameClient()->m_Bindwheel.m_BindWheelList[i].command)); s_BindWheelCmd[i].SetEmptyText(Localize("Command")); - UI()->DoEditBox(&s_BindWheelCmd[i], &buttons[i], 14.0f); + Ui()->DoEditBox(&s_BindWheelCmd[i], &buttons[i], 14.0f); } // Do Settings Key @@ -3800,7 +3826,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) char aBuf[64]; str_format(aBuf, sizeof(aBuf), "%s:", Localize((const char *)Key.m_pName)); - UI()->DoLabel(&KeyLabel, aBuf, 13.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&KeyLabel, aBuf, 13.0f, TEXTALIGN_LEFT); int OldId = Key.m_KeyId, OldModifierCombination = Key.m_ModifierCombination, NewModifierCombination; int NewId = DoKeyReader((void *)&Key.m_pName, &Button, OldId, OldModifierCombination, &NewModifierCombination); if(NewId != OldId || NewModifierCombination != OldModifierCombination) @@ -3860,7 +3886,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) MainView.HSplitTop(10.0f, &Label, &MainView); char aTempBuf[256]; str_format(aTempBuf, sizeof(aTempBuf), "%s:", Localize("Your profile")); - UI()->DoLabel(&Label, aTempBuf, 14.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Label, aTempBuf, 14.0f, TEXTALIGN_LEFT); MainView.HSplitTop(50.0f, &Label, &MainView); Label.VSplitLeft(250.0f, &Label, &LabelMid); @@ -3882,15 +3908,15 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) Label.HSplitTop(25.0f, &Section, &Label); str_format(aTempBuf, sizeof(aTempBuf), ("Name: %s"), aName); - UI()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); Label.HSplitTop(20.0f, &Section, &Label); str_format(aTempBuf, sizeof(aTempBuf), ("Clan: %s"), aClan); - UI()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); Label.HSplitTop(20.0f, &Section, &Label); str_format(aTempBuf, sizeof(aTempBuf), ("Skin: %s"), pSkinName); - UI()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); FlagRect.VSplitRight(50, 0, &FlagRect); FlagRect.HSplitBottom(25, 0, &FlagRect); @@ -3912,7 +3938,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) MainView.HSplitTop(20.0f, 0, &MainView); MainView.HSplitTop(10.0f, &Label, &MainView); str_format(aTempBuf, sizeof(aTempBuf), "%s:", ("After Load")); - UI()->DoLabel(&Label, aTempBuf, 14.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Label, aTempBuf, 14.0f, TEXTALIGN_LEFT); MainView.HSplitTop(50.0f, &Label, &MainView); Label.VSplitLeft(250.0f, &Label, 0); @@ -3947,15 +3973,15 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) Label.HSplitTop(25.0f, &Section, &Label); str_format(aTempBuf, sizeof(aTempBuf), ("Name: %s"), aName); - UI()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); Label.HSplitTop(20.0f, &Section, &Label); str_format(aTempBuf, sizeof(aTempBuf), ("Clan: %s"), aClan); - UI()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); Label.HSplitTop(20.0f, &Section, &Label); str_format(aTempBuf, sizeof(aTempBuf), ("Skin: %s"), (doSkin && strlen(LoadProfile.SkinName) != 0) ? LoadProfile.SkinName : pSkinName); - UI()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); + Ui()->DoLabel(&Section, aTempBuf, 15.0f, TEXTALIGN_LEFT); FlagRect.VSplitRight(50, 0, &FlagRect); FlagRect.HSplitBottom(25, 0, &FlagRect); @@ -4008,7 +4034,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) LabelRight.HSplitTop(30.0f, &Button, &LabelRight); static CButtonContainer s_LoadButton; - if(DoButton_Menu(&s_LoadButton, Localize("Load"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_LoadButton, Localize("Load"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f))) { if(SelectedProfile != -1 && SelectedProfile < (int)GameClient()->m_SkinProfiles.m_Profiles.size()) { @@ -4056,7 +4082,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) LabelRight.HSplitTop(30.0f, &Button, &LabelRight); static CButtonContainer s_SaveButton; - if(DoButton_Menu(&s_SaveButton, Localize("Save"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_SaveButton, Localize("Save"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f))) { GameClient()->m_SkinProfiles.AddProfile( doColors ? *pColorBody : -1, @@ -4078,7 +4104,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) { LabelRight.HSplitTop(28.0f, &Button, &LabelRight); static CButtonContainer s_DeleteButton; - if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f))) { if(SelectedProfile != -1 && SelectedProfile < (int)GameClient()->m_SkinProfiles.m_Profiles.size()) { @@ -4090,7 +4116,7 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) LabelRight.HSplitTop(28.0f, &Button, &LabelRight); static CButtonContainer s_OverrideButton; - if(DoButton_Menu(&s_OverrideButton, Localize("Override"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f))) + if(DoButton_Menu(&s_OverrideButton, Localize("Override"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f))) { if(SelectedProfile != -1 && SelectedProfile < (int)GameClient()->m_SkinProfiles.m_Profiles.size()) { @@ -4199,14 +4225,14 @@ void CMenus::RenderSettingsProfiles(CUIRect MainView) if(strlen(CurrentProfile.Name) == 0 && strlen(CurrentProfile.Clan) == 0) { PlayerRect = Item.m_Rect; - UI()->DoLabel(&PlayerRect, CurrentProfile.SkinName, 12.0f, TEXTALIGN_LEFT, Props); + Ui()->DoLabel(&PlayerRect, CurrentProfile.SkinName, 12.0f, TEXTALIGN_LEFT, Props); } else { - UI()->DoLabel(&PlayerRect, CurrentProfile.Name, 12.0f, TEXTALIGN_LEFT, Props); + Ui()->DoLabel(&PlayerRect, CurrentProfile.Name, 12.0f, TEXTALIGN_LEFT, Props); Item.m_Rect.HSplitTop(20.0f, 0, &Item.m_Rect); Props.m_MaxWidth = Item.m_Rect.w; - UI()->DoLabel(&ClanRect, CurrentProfile.Clan, 12.0f, TEXTALIGN_LEFT, Props); + Ui()->DoLabel(&ClanRect, CurrentProfile.Clan, 12.0f, TEXTALIGN_LEFT, Props); } } } diff --git a/src/game/client/components/nameplates.cpp b/src/game/client/components/nameplates.cpp index d0a73f6fdb2..07097da9c1f 100644 --- a/src/game/client/components/nameplates.cpp +++ b/src/game/client/components/nameplates.cpp @@ -180,13 +180,13 @@ void CNamePlates::RenderNameplatePos(vec2 Position, const CNetObj_PlayerInfo *pP { Graphics()->TextureClear(); Graphics()->QuadsBegin(); - rgb = color_cast(ColorHSLA((300.0f - clamp(m_pClient->m_Snap.m_apPlayerInfos[ClientID]->m_Latency, 0, 300)) / 1000.0f, 1.0f, 0.5f, 0.8f)); + rgb = color_cast(ColorHSLA((300.0f - clamp(m_pClient->m_Snap.m_apPlayerInfos[ClientId]->m_Latency, 0, 300)) / 1000.0f, 1.0f, 0.5f, 0.8f)); Graphics()->SetColor(rgb); float CircleSize = 7.0f; Graphics()->DrawCircle(Position.x - tw / 2.0f - CircleSize, YOffset + FontSize / 2.0f + 1.4f, CircleSize, 24); Graphics()->QuadsEnd(); } - TextRender()->RenderTextContainer(m_aNamePlates[ClientID].m_NameTextContainerIndex, TColor, TOutlineColor, Position.x - tw / 2.0f, YOffset); + TextRender()->RenderTextContainer(m_aNamePlates[ClientId].m_NameTextContainerIndex, TColor, TOutlineColor, Position.x - tw / 2.0f, YOffset); } if(g_Config.m_ClNameplatesClan) @@ -200,13 +200,13 @@ void CNamePlates::RenderNameplatePos(vec2 Position, const CNetObj_PlayerInfo *pP { YOffset -= FontSizeClan; char aBuf[128]; - str_format(aBuf, sizeof(aBuf), "%s", m_pClient->m_aClients[pPlayerInfo->m_ClientID].m_aSkinName); + str_format(aBuf, sizeof(aBuf), "%s", m_pClient->m_aClients[pPlayerInfo->m_ClientId].m_aSkinName); float XOffset = TextRender()->TextWidth(FontSize, aBuf, -1, -1.0f) / 2.0f; TextRender()->TextColor(rgb); TextRender()->Text(Position.x - XOffset, YOffset, FontSize, aBuf, -1.0f); } - if(g_Config.m_ClNameplatesFriendMark && m_pClient->m_aClients[ClientID].m_Friend) + if(g_Config.m_ClNameplatesFriendMark && m_pClient->m_aClients[ClientId].m_Friend) { YOffset -= FontSize; char aFriendMark[] = "♥"; diff --git a/src/game/client/components/player_indicator.cpp b/src/game/client/components/player_indicator.cpp index 4833bf99ade..4bde9d09f06 100644 --- a/src/game/client/components/player_indicator.cpp +++ b/src/game/client/components/player_indicator.cpp @@ -23,14 +23,14 @@ float DistanceBetweenTwoPoints(vec2 src, vec2 dst) void CPlayerIndicator::OnRender() { // Don't render if we can't find our own tee - if(m_pClient->m_Snap.m_LocalClientID == -1 || !m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalClientID].m_Active) + if(m_pClient->m_Snap.m_LocalClientId == -1 || !m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_LocalClientId].m_Active) return; // Don't render if not race gamemode or in demo if(!GameClient()->m_GameInfo.m_Race || Client()->State() == IClient::STATE_DEMOPLAYBACK) return; - vec2 Position = m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_RenderPos; + vec2 Position = m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientId].m_RenderPos; if (g_Config.m_ClPlayerIndicator != 1) return; @@ -39,24 +39,24 @@ void CPlayerIndicator::OnRender() 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)) + 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) { - if(!m_pClient->m_Snap.m_apPlayerInfos[i] || i == m_pClient->m_Snap.m_LocalClientID) + 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_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) diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 9d30029a0e9..8bd89e7bff7 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -157,12 +157,12 @@ void CPlayers::RenderHookCollLine( Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick); // draw hook collision line { - OtherTeam = m_pClient->IsOtherTeam(ClientID); - Alpha = (OtherTeam || ClientID < 0) ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f; + OtherTeam = m_pClient->IsOtherTeam(ClientId); + Alpha = (OtherTeam || ClientId < 0) ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f; IntraTick = Intra; - if(ClientID >= 0) - IntraTick = m_pClient->m_aClients[ClientID].m_IsPredicted ? Client()->PredIntraGameTick(g_Config.m_ClDummy) : Client()->IntraGameTick(g_Config.m_ClDummy); + if(ClientId >= 0) + IntraTick = m_pClient->m_aClients[ClientId].m_IsPredicted ? Client()->PredIntraGameTick(g_Config.m_ClDummy) : Client()->IntraGameTick(g_Config.m_ClDummy); if(Local && Client()->State() != IClient::STATE_DEMOPLAYBACK) { @@ -173,7 +173,7 @@ void CPlayers::RenderHookCollLine( { float AngleIntraTick = IntraTick; // using unpredicted angle when rendering other players in-game - if(ClientID >= 0) + if(ClientId >= 0) AngleIntraTick = Client()->IntraGameTick(g_Config.m_ClDummy); // If the player moves their weapon through top, then change // the end angle by 2*Pi, so that the mix function will use the @@ -187,8 +187,8 @@ void CPlayers::RenderHookCollLine( } vec2 Direction = direction(Angle); - if(in_range(ClientID, MAX_CLIENTS - 1)) - Position = m_pClient->m_aClients[ClientID].m_RenderPos; + if(in_range(ClientId, MAX_CLIENTS - 1)) + Position = m_pClient->m_aClients[ClientId].m_RenderPos; else Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick); @@ -358,7 +358,7 @@ void CPlayers::RenderHook( if(in_range(pPlayerChar->m_HookedPlayer, MAX_CLIENTS - 1)) { HookPos = m_pClient->m_aClients[pPlayerChar->m_HookedPlayer].m_RenderPos; - if(g_Config.m_ClSwapGhosts && Client()->State() != IClient::STATE_DEMOPLAYBACK && m_pClient->m_Snap.m_LocalClientID == ClientID) + if(g_Config.m_ClSwapGhosts && Client()->State() != IClient::STATE_DEMOPLAYBACK && m_pClient->m_Snap.m_LocalClientId == ClientId) { HookPos = GameClient()->GetSmoothPos(pPlayerChar->m_HookedPlayer); } @@ -412,13 +412,13 @@ void CPlayers::RenderPlayer( CTeeRenderInfo RenderInfo = *pRenderInfo; - 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; + 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; bool Spec = m_pClient->m_Snap.m_SpecInfo.m_Active; float Alpha = 1.0f; - if(OtherTeam || ClientID < 0) + if(OtherTeam || ClientId < 0) Alpha = g_Config.m_ClShowOthersAlpha / 100.0f; else if(g_Config.m_ClShowOthersGhosts && !Local && !Spec) Alpha = g_Config.m_ClPredGhostsAlpha / 100.0f; @@ -426,7 +426,7 @@ void CPlayers::RenderPlayer( if(!OtherTeam && g_Config.m_ClShowOthersGhosts && !Local && g_Config.m_ClUnpredOthersInFreeze && g_Config.m_ClAmIFrozen && !Spec) Alpha = 1.0f; - if(ClientID == -2) // ghost + if(ClientId == -2) // ghost Alpha = g_Config.m_ClRaceGhostAlpha / 100.0f; // set size @@ -474,10 +474,10 @@ void CPlayers::RenderPlayer( Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick); if(g_Config.m_ClSwapGhosts && g_Config.m_ClShowOthersGhosts && !Local && Client()->State() != IClient::STATE_DEMOPLAYBACK) - if(ClientID >= 0) + if(ClientId >= 0) Position = mix( - vec2(m_pClient->m_Snap.m_aCharacters[ClientID].m_Prev.m_X, m_pClient->m_Snap.m_aCharacters[ClientID].m_Prev.m_Y), - vec2(m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur.m_X, m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur.m_Y), + vec2(m_pClient->m_Snap.m_aCharacters[ClientId].m_Prev.m_X, m_pClient->m_Snap.m_aCharacters[ClientId].m_Prev.m_Y), + vec2(m_pClient->m_Snap.m_aCharacters[ClientId].m_Cur.m_X, m_pClient->m_Snap.m_aCharacters[ClientId].m_Cur.m_Y), Client()->IntraGameTick(g_Config.m_ClDummy)); vec2 Vel = mix(vec2(Prev.m_VelX / 256.0f, Prev.m_VelY / 256.0f), vec2(Player.m_VelX / 256.0f, Player.m_VelY / 256.0f), IntraTick); @@ -826,7 +826,7 @@ void CPlayers::RenderPlayerGhost( const CNetObj_Character *pPrevChar, const CNetObj_Character *pPlayerChar, const CTeeRenderInfo *pRenderInfo, - int ClientID, + int ClientId, float Intra) { CNetObj_Character Prev; @@ -836,13 +836,13 @@ void CPlayers::RenderPlayerGhost( CTeeRenderInfo RenderInfo = *pRenderInfo; - bool Local = m_pClient->m_Snap.m_LocalClientID == ClientID; - bool OtherTeam = m_pClient->IsOtherTeam(ClientID); + bool Local = m_pClient->m_Snap.m_LocalClientId == ClientId; + bool OtherTeam = m_pClient->IsOtherTeam(ClientId); float Alpha = 1.0f; - bool FrozenSwappingHide = (m_pClient->m_aClients[ClientID].m_FreezeEnd > 0) && g_Config.m_ClHideFrozenGhosts && g_Config.m_ClSwapGhosts; + bool FrozenSwappingHide = (m_pClient->m_aClients[ClientId].m_FreezeEnd > 0) && g_Config.m_ClHideFrozenGhosts && g_Config.m_ClSwapGhosts; - if(OtherTeam || ClientID < 0) + if(OtherTeam || ClientId < 0) Alpha = g_Config.m_ClShowOthersAlpha / 100.0f; else Alpha = g_Config.m_ClUnpredGhostsAlpha / 100.0f; @@ -855,8 +855,8 @@ void CPlayers::RenderPlayerGhost( RenderInfo.m_Size = 64.0f; float IntraTick = Intra; - if(ClientID >= 0) - IntraTick = m_pClient->m_aClients[ClientID].m_IsPredicted ? Client()->PredIntraGameTick(g_Config.m_ClDummy) : Client()->IntraGameTick(g_Config.m_ClDummy); + if(ClientId >= 0) + IntraTick = m_pClient->m_aClients[ClientId].m_IsPredicted ? Client()->PredIntraGameTick(g_Config.m_ClDummy) : Client()->IntraGameTick(g_Config.m_ClDummy); static float s_LastGameTickTime = Client()->GameTickTime(g_Config.m_ClDummy); static float s_LastPredIntraTick = Client()->PredIntraGameTick(g_Config.m_ClDummy); @@ -869,7 +869,7 @@ void CPlayers::RenderPlayerGhost( bool PredictLocalWeapons = false; float AttackTime = (Client()->PrevGameTick(g_Config.m_ClDummy) - Player.m_AttackTick) / (float)SERVER_TICK_SPEED + Client()->GameTickTime(g_Config.m_ClDummy); float LastAttackTime = (Client()->PrevGameTick(g_Config.m_ClDummy) - Player.m_AttackTick) / (float)SERVER_TICK_SPEED + s_LastGameTickTime; - if(ClientID >= 0 && m_pClient->m_aClients[ClientID].m_IsPredictedLocal && m_pClient->AntiPingGunfire()) + if(ClientId >= 0 && m_pClient->m_aClients[ClientId].m_IsPredictedLocal && m_pClient->AntiPingGunfire()) { PredictLocalWeapons = true; AttackTime = (Client()->PredIntraGameTick(g_Config.m_ClDummy) + (Client()->PredGameTick(g_Config.m_ClDummy) - 1 - Player.m_AttackTick)) / (float)SERVER_TICK_SPEED; @@ -885,26 +885,26 @@ void CPlayers::RenderPlayerGhost( } else { - Angle = GetPlayerTargetAngle(&Prev, &Player, ClientID, IntraTick); + Angle = GetPlayerTargetAngle(&Prev, &Player, ClientId, IntraTick); } vec2 Direction = direction(Angle); vec2 Position; - if(in_range(ClientID, MAX_CLIENTS - 1)) - Position = m_pClient->m_aClients[ClientID].m_RenderPos; + if(in_range(ClientId, MAX_CLIENTS - 1)) + Position = m_pClient->m_aClients[ClientId].m_RenderPos; else Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick); if(g_Config.m_ClSwapGhosts) { - Position = GameClient()->GetSmoothPos(ClientID); + Position = GameClient()->GetSmoothPos(ClientId); } else { - if(ClientID >= 0) + if(ClientId >= 0) Position = mix( - vec2(m_pClient->m_Snap.m_aCharacters[ClientID].m_Prev.m_X, m_pClient->m_Snap.m_aCharacters[ClientID].m_Prev.m_Y), - vec2(m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur.m_X, m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur.m_Y), + vec2(m_pClient->m_Snap.m_aCharacters[ClientId].m_Prev.m_X, m_pClient->m_Snap.m_aCharacters[ClientId].m_Prev.m_Y), + vec2(m_pClient->m_Snap.m_aCharacters[ClientId].m_Cur.m_X, m_pClient->m_Snap.m_aCharacters[ClientId].m_Cur.m_Y), Client()->IntraGameTick(g_Config.m_ClDummy)); } @@ -930,7 +930,7 @@ void CPlayers::RenderPlayerGhost( bool InAir = !Collision()->CheckPoint(Player.m_X, Player.m_Y + 16); bool Running = Player.m_VelX >= 5000 || Player.m_VelX <= -5000; bool WantOtherDir = (Player.m_Direction == -1 && Vel.x > 0) || (Player.m_Direction == 1 && Vel.x < 0); - bool Inactive = m_pClient->m_aClients[ClientID].m_Afk || m_pClient->m_aClients[ClientID].m_Paused; + bool Inactive = m_pClient->m_aClients[ClientId].m_Afk || m_pClient->m_aClients[ClientId].m_Paused; // evaluate animation float WalkTime = std::fmod(Position.x, 100.0f) / 100.0f; @@ -994,7 +994,7 @@ void CPlayers::RenderPlayerGhost( Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); Graphics()->QuadsSetRotation(State.GetAttach()->m_Angle * pi * 2 + Angle); - if(ClientID < 0) + if(ClientId < 0) Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.5f); // normal weapons @@ -1077,7 +1077,7 @@ void CPlayers::RenderPlayerGhost( if(PredictLocalWeapons) Dir = vec2(pPlayerChar->m_X, pPlayerChar->m_Y) - vec2(pPrevChar->m_X, pPrevChar->m_Y); else - Dir = vec2(m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur.m_X, m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur.m_Y) - vec2(m_pClient->m_Snap.m_aCharacters[ClientID].m_Prev.m_X, m_pClient->m_Snap.m_aCharacters[ClientID].m_Prev.m_Y); + Dir = vec2(m_pClient->m_Snap.m_aCharacters[ClientId].m_Cur.m_X, m_pClient->m_Snap.m_aCharacters[ClientId].m_Cur.m_Y) - vec2(m_pClient->m_Snap.m_aCharacters[ClientId].m_Prev.m_X, m_pClient->m_Snap.m_aCharacters[ClientId].m_Prev.m_Y); float HadOkenAngle = 0; if(absolute(Dir.x) > 0.0001f || absolute(Dir.y) > 0.0001f) { @@ -1182,7 +1182,7 @@ void CPlayers::RenderPlayerGhost( } int QuadOffsetToEmoticon = NUM_WEAPONS * 2 + 2 + 2; - if((Player.m_PlayerFlags & PLAYERFLAG_CHATTING) && !m_pClient->m_aClients[ClientID].m_Afk) + if((Player.m_PlayerFlags & PLAYERFLAG_CHATTING) && !m_pClient->m_aClients[ClientId].m_Afk) { int CurEmoticon = (SPRITE_DOTDOT - SPRITE_OOP); Graphics()->TextureSet(GameClient()->m_EmoticonsSkin.m_aSpriteEmoticons[CurEmoticon]); @@ -1194,10 +1194,10 @@ void CPlayers::RenderPlayerGhost( Graphics()->QuadsSetRotation(0); } - if(ClientID < 0) + if(ClientId < 0) return; - if(g_Config.m_ClAfkEmote && m_pClient->m_aClients[ClientID].m_Afk && !(Client()->DummyConnected() && ClientID == m_pClient->m_aLocalIDs[!g_Config.m_ClDummy])) + if(g_Config.m_ClAfkEmote && m_pClient->m_aClients[ClientId].m_Afk && !(Client()->DummyConnected() && ClientId == m_pClient->m_aLocalIds[!g_Config.m_ClDummy])) { int CurEmoticon = (SPRITE_ZZZ - SPRITE_OOP); Graphics()->TextureSet(GameClient()->m_EmoticonsSkin.m_aSpriteEmoticons[CurEmoticon]); @@ -1209,9 +1209,9 @@ void CPlayers::RenderPlayerGhost( Graphics()->QuadsSetRotation(0); } - if(g_Config.m_ClShowEmotes && !m_pClient->m_aClients[ClientID].m_EmoticonIgnore && m_pClient->m_aClients[ClientID].m_EmoticonStartTick != -1) + if(g_Config.m_ClShowEmotes && !m_pClient->m_aClients[ClientId].m_EmoticonIgnore && m_pClient->m_aClients[ClientId].m_EmoticonStartTick != -1) { - float SinceStart = (Client()->GameTick(g_Config.m_ClDummy) - m_pClient->m_aClients[ClientID].m_EmoticonStartTick) + (Client()->IntraGameTickSincePrev(g_Config.m_ClDummy) - m_pClient->m_aClients[ClientID].m_EmoticonStartFraction); + float SinceStart = (Client()->GameTick(g_Config.m_ClDummy) - m_pClient->m_aClients[ClientId].m_EmoticonStartTick) + (Client()->IntraGameTickSincePrev(g_Config.m_ClDummy) - m_pClient->m_aClients[ClientId].m_EmoticonStartFraction); float FromEnd = (2 * Client()->GameTickSpeed()) - SinceStart; if(0 <= SinceStart && FromEnd > 0) @@ -1235,8 +1235,8 @@ void CPlayers::RenderPlayerGhost( Graphics()->SetColor(1.0f, 1.0f, 1.0f, a * Alpha); // client_datas::emoticon is an offset from the first emoticon - int QuadOffset = QuadOffsetToEmoticon + m_pClient->m_aClients[ClientID].m_Emoticon; - Graphics()->TextureSet(GameClient()->m_EmoticonsSkin.m_aSpriteEmoticons[m_pClient->m_aClients[ClientID].m_Emoticon]); + int QuadOffset = QuadOffsetToEmoticon + m_pClient->m_aClients[ClientId].m_Emoticon; + Graphics()->TextureSet(GameClient()->m_EmoticonsSkin.m_aSpriteEmoticons[m_pClient->m_aClients[ClientId].m_Emoticon]); Graphics()->RenderQuadContainerAsSprite(m_WeaponEmoteQuadContainerIndex, QuadOffset, Position.x, Position.y - 23.f - 32.f * h, 1.f, (64.f * h) / 64.f); Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); @@ -1244,7 +1244,7 @@ void CPlayers::RenderPlayerGhost( } } } -inline bool CPlayers::IsPlayerInfoAvailable(int ClientID) const +inline bool CPlayers::IsPlayerInfoAvailable(int ClientId) const { const void *pPrevInfo = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_PLAYERINFO, ClientId); const void *pInfo = Client()->SnapFindItem(IClient::SNAP_CURRENT, NETOBJTYPE_PLAYERINFO, ClientId); @@ -1274,7 +1274,7 @@ void CPlayers::OnRender() const CGameClient::CSnapState::CCharacterInfo &CharacterInfo = m_pClient->m_Snap.m_aCharacters[i]; const bool Frozen = CharacterInfo.m_HasExtendedData && CharacterInfo.m_ExtendedData.m_FreezeEnd != 0; - if(((CharacterInfo.m_Cur.m_Weapon == WEAPON_NINJA || Frozen) && g_Config.m_ClShowNinja) || (g_Config.m_ClAmIFrozen && g_Config.m_ClFreezeUpdateFix && m_pClient->m_Snap.m_LocalClientID == i && g_Config.m_ClShowNinja) || (Frozen && !m_pClient->m_GameInfo.m_NoSkinChangeForFrozen && g_Config.m_ClShowNinja)) + if(((CharacterInfo.m_Cur.m_Weapon == WEAPON_NINJA || Frozen) && g_Config.m_ClShowNinja) || (g_Config.m_ClAmIFrozen && g_Config.m_ClFreezeUpdateFix && m_pClient->m_Snap.m_LocalClientId == i && g_Config.m_ClShowNinja) || (Frozen && !m_pClient->m_GameInfo.m_NoSkinChangeForFrozen && g_Config.m_ClShowNinja)) { // change the skin for the player to the ninja const auto *pSkin = m_pClient->m_Skins.FindOrNullptr("x_ninja"); @@ -1332,11 +1332,11 @@ void CPlayers::OnRender() } // render spectating players - for(int ClientID = 0; ClientID < MAX_CLIENTS; ClientID++) + for(int ClientId = 0; ClientId < MAX_CLIENTS; ClientId++) { - auto &m_aClient = m_pClient->m_aClients[ClientID]; + auto &m_aClient = m_pClient->m_aClients[ClientId]; - if(!IsPlayerInfoAvailable(ClientID)) + if(!IsPlayerInfoAvailable(ClientId)) { continue; } @@ -1367,7 +1367,7 @@ void CPlayers::OnRender() continue; } - bool Frozen = (m_pClient->m_aClients[ClientID].m_FreezeEnd > 0) && g_Config.m_ClHideFrozenGhosts; + bool Frozen = (m_pClient->m_aClients[ClientId].m_FreezeEnd > 0) && g_Config.m_ClHideFrozenGhosts; bool RenderGhost = true; bool RenderRegular = true; if(g_Config.m_ClHideFrozenGhosts && Frozen && g_Config.m_ClShowOthersGhosts) @@ -1387,11 +1387,11 @@ void CPlayers::OnRender() //If we are frozen and hiding frozen ghosts and not swapping render only the regular player 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); + 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); + 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/players.h b/src/game/client/components/players.h index 3a3958ad953..2e167748ded 100644 --- a/src/game/client/components/players.h +++ b/src/game/client/components/players.h @@ -22,7 +22,7 @@ class CPlayers : public CComponent const CNetObj_Character *pPrevChar, const CNetObj_Character *pPlayerChar, const CTeeRenderInfo *pRenderInfo, - int ClientID, + int ClientId, float Intra = 0.f); void RenderHook( diff --git a/src/game/client/components/rainbow.cpp b/src/game/client/components/rainbow.cpp index 0e9d1f87eef..36a8130f821 100644 --- a/src/game/client/components/rainbow.cpp +++ b/src/game/client/components/rainbow.cpp @@ -65,7 +65,7 @@ void CRainbow::OnRender() for (int i = 0; i < MAX_CLIENTS; i++) { // check if local player - bool Local = m_pClient->m_Snap.m_LocalClientID == i; + bool Local = m_pClient->m_Snap.m_LocalClientId == i; CTeeRenderInfo *RenderInfo = &m_pClient->m_aClients[i].m_RenderInfo; // check if rainbow is enabled diff --git a/src/game/client/components/spectator.cpp b/src/game/client/components/spectator.cpp index 40c3955f513..346e11b90cf 100644 --- a/src/game/client/components/spectator.cpp +++ b/src/game/client/components/spectator.cpp @@ -466,9 +466,9 @@ void CSpectator::OnRender() } char aBuf[256] = {}; if (g_Config.m_ClSpecmenuID) { - str_format(aBuf, sizeof(aBuf), "%d: ", m_pClient->m_Snap.m_apInfoByDDTeamName[i]->m_ClientID); + str_format(aBuf, sizeof(aBuf), "%d: ", m_pClient->m_Snap.m_apInfoByDDTeamName[i]->m_ClientId); } - str_append(aBuf, m_pClient->m_aClients[m_pClient->m_Snap.m_apInfoByDDTeamName[i]->m_ClientID].m_aName, sizeof(aBuf)); + str_append(aBuf, m_pClient->m_aClients[m_pClient->m_Snap.m_apInfoByDDTeamName[i]->m_ClientId].m_aName, sizeof(aBuf)); TextRender()->Text(Width / 2.0f + x + 50.0f, Height / 2.0f + y + BoxMove + (LineHeight - FontSize) / 2.f, FontSize, aBuf, 220.0f); if(GameClient()->m_MultiViewActivated) diff --git a/src/game/client/components/verify.cpp b/src/game/client/components/verify.cpp index 54a75af35d9..41fe426efec 100644 --- a/src/game/client/components/verify.cpp +++ b/src/game/client/components/verify.cpp @@ -21,13 +21,15 @@ void CVerify::OnRender() if(verified) return; - CTimeout Timeout{10000, 0, 8000, 10}; auto StartTime = time_get_nanoseconds(); - CHttpRequest *pGet = HttpGet("https://ger10.ddnet.org/").release(); - pGet->Timeout(Timeout); - IEngine::RunJobBlocking(pGet); + std::shared_ptr pGet = HttpGet("https://ger10.ddnet.org/"); + pGet->Timeout(CTimeout{10000, 0, 500, 10}); + pGet->IpResolve(IPRESOLVE::V4); + + Http()->Run(pGet); + auto Time = std::chrono::duration_cast(time_get_nanoseconds() - StartTime); - if(pGet->State() != HTTP_DONE) + if(pGet->State() != EHttpState::DONE) { dbg_msg("verify", "Failed to verify client"); tries++; diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 9fc0bd78ca7..e59c86bc5c3 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -321,7 +321,7 @@ void CVoting::OnMessage(int MsgType, void *pRawMsg) void CVoting::Render() { - if((!g_Config.m_ClShowVotesAfterVoting && !m_pClient->m_Scoreboard.Active() && TakenChoice()) || !IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK) + if((!m_pClient->m_Scoreboard.Active() && TakenChoice()) || !IsVoting() || Client()->State() == IClient::STATE_DEMOPLAYBACK) return; const int Seconds = SecondsLeft(); if(Seconds < 0) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index d0fb975bdc4..e4fed7da841 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -2725,10 +2725,10 @@ void CGameClient::UpdateRenderedCharacters() Client()->IntraGameTick(g_Config.m_ClDummy)); vec2 Pos = UnpredPos; - CCharacter *pChar = m_PredictedWorld.GetCharacterByID(i); + CCharacter *pChar = m_PredictedWorld.GetCharacterById(i); // TODO: @Tater remove this garbage - if(i == m_Snap.m_LocalClientID) + if(i == m_Snap.m_LocalClientId) { if(pChar && pChar->m_FreezeTime > 0) { @@ -2741,7 +2741,7 @@ void CGameClient::UpdateRenderedCharacters() } } - if(Predict() && (i == m_Snap.m_LocalClientID || (AntiPingPlayers() && !IsOtherTeam(i))) && pChar) + if(Predict() && (i == m_Snap.m_LocalClientId || (AntiPingPlayers() && !IsOtherTeam(i))) && pChar) { m_aClients[i].m_Predicted.Write(&m_aClients[i].m_RenderCur); m_aClients[i].m_PrevPredicted.Write(&m_aClients[i].m_RenderPrev); @@ -2899,22 +2899,22 @@ vec2 CGameClient::GetSmoothPos(int ClientId) return Pos; } -vec2 CGameClient::GetFreezePos(int ClientID) +vec2 CGameClient::GetFreezePos(int ClientId) { - vec2 Pos = mix(m_aClients[ClientID].m_PrevPredicted.m_Pos, m_aClients[ClientID].m_Predicted.m_Pos, Client()->PredIntraGameTick(g_Config.m_ClDummy)); + vec2 Pos = mix(m_aClients[ClientId].m_PrevPredicted.m_Pos, m_aClients[ClientId].m_Predicted.m_Pos, Client()->PredIntraGameTick(g_Config.m_ClDummy)); //int64_t Now = time_get(); - CCharacter *pChar = m_PredictedWorld.GetCharacterByID(ClientID); + CCharacter *pChar = m_PredictedWorld.GetCharacterById(ClientId); for(int i = 0; i < 2; i++) { - //int64_t Len = clamp(m_aClients[ClientID].m_SmoothLen[i], (int64_t)1, time_freq()); - //int64_t TimePassed = Now - m_aClients[ClientID].m_SmoothStart[i]; + //int64_t Len = clamp(m_aClients[ClientId].m_SmoothLen[i], (int64_t)1, time_freq()); + //int64_t TimePassed = Now - m_aClients[ClientId].m_SmoothStart[i]; float MixAmount = 0.0f; int SmoothTick; float SmoothIntra; int TicksFrozen = Client()->GameTick(g_Config.m_ClDummy) - g_Config.m_ClFreezeTick; - if(pChar && g_Config.m_ClAdjustRemovedDelay && ClientID == m_Snap.m_LocalClientID) + if(pChar && g_Config.m_ClAdjustRemovedDelay && ClientId == m_Snap.m_LocalClientId) { TicksFrozen = pChar->m_FreezeAccumulation; } @@ -2928,8 +2928,8 @@ vec2 CGameClient::GetFreezePos(int ClientID) MixAmount = 1.0f; } Client()->GetSmoothFreezeTick(&SmoothTick, &SmoothIntra, MixAmount); - if(SmoothTick > 0 && m_aClients[ClientID].m_aPredTick[(SmoothTick - 1) % 200] >= Client()->PrevGameTick(g_Config.m_ClDummy) && m_aClients[ClientID].m_aPredTick[SmoothTick % 200] <= Client()->PredGameTick(g_Config.m_ClDummy)) - Pos[i] = mix(m_aClients[ClientID].m_aPredPos[(SmoothTick - 1) % 200][i], m_aClients[ClientID].m_aPredPos[SmoothTick % 200][i], SmoothIntra); + if(SmoothTick > 0 && m_aClients[ClientId].m_aPredTick[(SmoothTick - 1) % 200] >= Client()->PrevGameTick(g_Config.m_ClDummy) && m_aClients[ClientId].m_aPredTick[SmoothTick % 200] <= Client()->PredGameTick(g_Config.m_ClDummy)) + Pos[i] = mix(m_aClients[ClientId].m_aPredPos[(SmoothTick - 1) % 200][i], m_aClients[ClientId].m_aPredPos[SmoothTick % 200][i], SmoothIntra); } return Pos; } diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 7c5d1a9d550..8c7cc8a4af8 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -739,8 +739,8 @@ class CGameClient : public IGameClient const std::vector &SnapEntities() { return m_vSnapEntities; } - vec2 GetSmoothPos(int ClientID); - vec2 GetFreezePos(int ClientID); + vec2 GetSmoothPos(int ClientId); + vec2 GetFreezePos(int ClientId); int m_MultiViewTeam; int m_MultiViewPersonalZoom; bool m_MultiViewShowHud; @@ -764,8 +764,6 @@ class CGameClient : public IGameClient int m_aLastUpdateTick[MAX_CLIENTS] = {0}; void DetectStrongHook(); - vec2 GetSmoothPos(int ClientId); - int m_PredictedDummyId; int m_IsDummySwapping; CCharOrder m_CharOrder; diff --git a/src/game/client/render_map.cpp b/src/game/client/render_map.cpp index d8eee08cdb5..2d0c9e9172c 100644 --- a/src/game/client/render_map.cpp +++ b/src/game/client/render_map.cpp @@ -667,7 +667,7 @@ void CRenderTools::RenderTilemap(CTile *pTiles, int w, int h, float Scale, Color Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderGameTileOutlines(CTile *pTiles, int w, int h, float Scale, int TileType, float Alpha) +void CRenderTools::RenderGameTileOutlines(CTile *pTiles, int w, int h, float Scale, int TileType, float Alpha) const { float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); @@ -866,7 +866,8 @@ void CRenderTools::RenderGameTileOutlines(CTile *pTiles, int w, int h, float Sca Graphics()->QuadsEnd(); Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderTeleOutlines(CTile *pTiles, CTeleTile *pTele, int w, int h, float Scale, float Alpha) + +void CRenderTools::RenderTeleOutlines(CTile *pTiles, CTeleTile *pTele, int w, int h, float Scale, float Alpha) const { float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); @@ -995,7 +996,8 @@ void CRenderTools::RenderTeleOutlines(CTile *pTiles, CTeleTile *pTele, int w, in Graphics()->QuadsEnd(); Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1); } -void CRenderTools::RenderTeleOverlay(CTeleTile *pTele, int w, int h, float Scale, float Alpha) + +void CRenderTools::RenderTeleOverlay(CTeleTile *pTele, int w, int h, float Scale, float Alpha) const { if(!g_Config.m_ClTextEntities) return; diff --git a/src/game/tater_variables.h b/src/game/tater_variables.h index 534a46c4e9d..1ee5b126034 100644 --- a/src/game/tater_variables.h +++ b/src/game/tater_variables.h @@ -114,8 +114,6 @@ MACRO_CONFIG_INT(ClApplyProfileEmote, tc_profile_emote, 1, 0, 1, CFGFLAG_CLIENT MACRO_CONFIG_INT(ClVoteAuto, tc_vote_auto, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Activate auto vote") MACRO_CONFIG_INT(ClVoteDefaultAll, tc_vote_default, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Default vote everybody (0:yes,1:no)") MACRO_CONFIG_INT(ClVoteDefaultFriend, tc_vote_default, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Default vote friends (0:yes,1:no,3:Default)") -MACRO_CONFIG_INT(ClVoteDontShow, tc_vote_show, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show only votes where your vote counts") -MACRO_CONFIG_INT(ClVoteDontShowFriends, tc_vote_show_friends, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show only votes where your vote counts exclude friends") // Auto Verify MACRO_CONFIG_INT(ClAutoVerify, tc_auto_verify, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Auto verify")