From bb8b9a79339d1829f4062b45f57bffef2e5a822a Mon Sep 17 00:00:00 2001 From: Tater Date: Sun, 22 Dec 2024 17:10:26 -0600 Subject: [PATCH] Clean up conflicts --- .../client/components/tclient/bindwheel.cpp | 54 +++++++++---------- .../client/components/tclient/bindwheel.h | 4 +- .../components/tclient/menus_tclient.cpp | 17 +++--- src/game/client/gameclient.h | 2 +- 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/src/game/client/components/tclient/bindwheel.cpp b/src/game/client/components/tclient/bindwheel.cpp index 008c0e06a8c..8d844b3830a 100644 --- a/src/game/client/components/tclient/bindwheel.cpp +++ b/src/game/client/components/tclient/bindwheel.cpp @@ -12,25 +12,25 @@ #include "bindwheel.h" #include -CBindwheel::CBindwheel() +CBindWheel::CBindWheel() { OnReset(); } -void CBindwheel::ConBindwheelExecuteHover(IConsole::IResult *pResult, void *pUserData) +void CBindWheel::ConBindwheelExecuteHover(IConsole::IResult *pResult, void *pUserData) { - CBindwheel *pThis = (CBindwheel *)pUserData; + CBindWheel *pThis = (CBindWheel *)pUserData; pThis->ExecuteHoveredBind(); } -void CBindwheel::ConOpenBindwheel(IConsole::IResult *pResult, void *pUserData) +void CBindWheel::ConOpenBindwheel(IConsole::IResult *pResult, void *pUserData) { - CBindwheel *pThis = (CBindwheel *)pUserData; + CBindWheel *pThis = (CBindWheel *)pUserData; if(pThis->Client()->State() != IClient::STATE_DEMOPLAYBACK) pThis->m_Active = pResult->GetInteger(0) != 0; } -void CBindwheel::ConAddBindwheelLegacy(IConsole::IResult *pResult, void *pUserData) +void CBindWheel::ConAddBindwheelLegacy(IConsole::IResult *pResult, void *pUserData) { int BindPos = pResult->GetInteger(0); if (BindPos < 0 || BindPos >= BINDWHEEL_MAX_BINDS) @@ -39,7 +39,7 @@ void CBindwheel::ConAddBindwheelLegacy(IConsole::IResult *pResult, void *pUserDa const char *aName = pResult->GetString(1); const char *aCommand = pResult->GetString(2); - CBindwheel *pThis = static_cast(pUserData); + CBindWheel *pThis = static_cast(pUserData); while(pThis->m_vBinds.size() <= (size_t)BindPos) pThis->AddBind("EMPTY", ""); @@ -47,31 +47,31 @@ void CBindwheel::ConAddBindwheelLegacy(IConsole::IResult *pResult, void *pUserDa str_copy(pThis->m_vBinds[BindPos].m_aCommand, aCommand); } -void CBindwheel::ConAddBindwheel(IConsole::IResult *pResult, void *pUserData) +void CBindWheel::ConAddBindwheel(IConsole::IResult *pResult, void *pUserData) { const char *aName = pResult->GetString(0); const char *aCommand = pResult->GetString(1); - CBindwheel *pThis = static_cast(pUserData); + CBindWheel *pThis = static_cast(pUserData); pThis->AddBind(aName, aCommand); } -void CBindwheel::ConRemoveBindwheel(IConsole::IResult *pResult, void *pUserData) +void CBindWheel::ConRemoveBindwheel(IConsole::IResult *pResult, void *pUserData) { const char *aName = pResult->GetString(0); const char *aCommand = pResult->GetString(1); - CBindwheel *pThis = static_cast(pUserData); + CBindWheel *pThis = static_cast(pUserData); pThis->RemoveBind(aName, aCommand); } -void CBindwheel::ConRemoveAllBindwheelBinds(IConsole::IResult *pResult, void *pUserData) +void CBindWheel::ConRemoveAllBindwheelBinds(IConsole::IResult *pResult, void *pUserData) { - CBindwheel *pThis = static_cast(pUserData); + CBindWheel *pThis = static_cast(pUserData); pThis->RemoveAllBinds(); } -void CBindwheel::AddBind(const char *pName, const char *pCommand) +void CBindWheel::AddBind(const char *pName, const char *pCommand) { if((pName[0] == '\0' && pCommand[0] == '\0') || m_vBinds.size() >= BINDWHEEL_MAX_BINDS) return; @@ -82,7 +82,7 @@ void CBindwheel::AddBind(const char *pName, const char *pCommand) m_vBinds.push_back(Bind); } -void CBindwheel::RemoveBind(const char *pName, const char *pCommand) +void CBindWheel::RemoveBind(const char *pName, const char *pCommand) { CBind Bind; str_copy(Bind.m_aName, pName); @@ -92,7 +92,7 @@ void CBindwheel::RemoveBind(const char *pName, const char *pCommand) m_vBinds.erase(it); } -void CBindwheel::RemoveBind(int Index) +void CBindWheel::RemoveBind(int Index) { if(Index >= static_cast(m_vBinds.size()) || Index < 0) return; @@ -100,12 +100,12 @@ void CBindwheel::RemoveBind(int Index) m_vBinds.erase(Pos); } -void CBindwheel::RemoveAllBinds() +void CBindWheel::RemoveAllBinds() { m_vBinds.clear(); } -void CBindwheel::OnConsoleInit() +void CBindWheel::OnConsoleInit() { IConfigManager *pConfigManager = Kernel()->RequestInterface(); if(pConfigManager) @@ -120,19 +120,19 @@ void CBindwheel::OnConsoleInit() Console()->Register("delete_all_bindwheel_binds", "", CFGFLAG_CLIENT, ConRemoveAllBindwheelBinds, this, "Removes all bindwheel binds"); } -void CBindwheel::OnReset() +void CBindWheel::OnReset() { m_WasActive = false; m_Active = false; m_SelectedBind = -1; } -void CBindwheel::OnRelease() +void CBindWheel::OnRelease() { m_Active = false; } -bool CBindwheel::OnCursorMove(float x, float y, IInput::ECursorType CursorType) +bool CBindWheel::OnCursorMove(float x, float y, IInput::ECursorType CursorType) { if(!m_Active) return false; @@ -142,12 +142,12 @@ bool CBindwheel::OnCursorMove(float x, float y, IInput::ECursorType CursorType) return true; } -void CBindwheel::DrawCircle(float x, float y, float r, int Segments) +void CBindWheel::DrawCircle(float x, float y, float r, int Segments) { Graphics()->DrawCircle(x, y, r, Segments); } -void CBindwheel::OnRender() +void CBindWheel::OnRender() { if(!m_Active) { @@ -210,19 +210,19 @@ void CBindwheel::OnRender() RenderTools()->RenderCursor(m_SelectorMouse + vec2(Screen.w, Screen.h) / 2.0f, 24.0f); } -void CBindwheel::ExecuteBind(int Bind) +void CBindWheel::ExecuteBind(int Bind) { Console()->ExecuteLine(m_vBinds[Bind].m_aCommand); } -void CBindwheel::ExecuteHoveredBind() +void CBindWheel::ExecuteHoveredBind() { if(m_SelectedBind >= 0) Console()->ExecuteLine(m_vBinds[m_SelectedBind].m_aCommand); } -void CBindwheel::ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserData) +void CBindWheel::ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserData) { - CBindwheel *pThis = (CBindwheel *)pUserData; + CBindWheel *pThis = (CBindWheel *)pUserData; for(CBind &Bind : pThis->m_vBinds) { diff --git a/src/game/client/components/tclient/bindwheel.h b/src/game/client/components/tclient/bindwheel.h index db6494f0d6d..fecc0602e5e 100644 --- a/src/game/client/components/tclient/bindwheel.h +++ b/src/game/client/components/tclient/bindwheel.h @@ -10,7 +10,7 @@ enum BINDWHEEL_MAX_BINDS = 64 }; -class CBindwheel : public CComponent +class CBindWheel : public CComponent { void DrawCircle(float x, float y, float r, int Segments); @@ -44,7 +44,7 @@ class CBindwheel : public CComponent std::vector m_vBinds; - CBindwheel(); + CBindWheel(); virtual int Sizeof() const override { return sizeof(*this); } virtual void OnReset() override; diff --git a/src/game/client/components/tclient/menus_tclient.cpp b/src/game/client/components/tclient/menus_tclient.cpp index 37b587861b7..7bbd119e183 100644 --- a/src/game/client/components/tclient/menus_tclient.cpp +++ b/src/game/client/components/tclient/menus_tclient.cpp @@ -182,7 +182,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) CUIRect TabBar, Column, LeftView, RightView, Button, Label; - MainView.HSplitTop(LineSize, &TabBar, &MainView); + MainView.HSplitTop(LineSize * 1.2f, &TabBar, &MainView); const float TabWidth = TabBar.w / NUMBER_OF_TCLIENT_TABS; static CButtonContainer s_aPageTabs[NUMBER_OF_TCLIENT_TABS] = {}; const char *apTabNames[] = { @@ -681,8 +681,8 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) } else if(Ui()->MouseButtonClicked(1) && s_SelectedBindIndex >= 0 && HoveringIndex >= 0 && HoveringIndex != s_SelectedBindIndex) { - CBindwheel::CBind BindA = GameClient()->m_Bindwheel.m_vBinds[s_SelectedBindIndex]; - CBindwheel::CBind BindB = GameClient()->m_Bindwheel.m_vBinds[HoveringIndex]; + CBindWheel::CBind BindA = GameClient()->m_Bindwheel.m_vBinds[s_SelectedBindIndex]; + CBindWheel::CBind BindB = GameClient()->m_Bindwheel.m_vBinds[HoveringIndex]; str_copy(GameClient()->m_Bindwheel.m_vBinds[s_SelectedBindIndex].m_aName, BindB.m_aName); str_copy(GameClient()->m_Bindwheel.m_vBinds[s_SelectedBindIndex].m_aCommand, BindB.m_aCommand); str_copy(GameClient()->m_Bindwheel.m_vBinds[HoveringIndex].m_aName, BindA.m_aName); @@ -712,7 +712,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) else if(i == HoveringIndex) SegmentFontSize = FontSize; - const CBindwheel::CBind Bind = GameClient()->m_Bindwheel.m_vBinds[i]; + const CBindWheel::CBind Bind = GameClient()->m_Bindwheel.m_vBinds[i]; const float Angle = Theta * i; vec2 TextPos = direction(Angle); TextPos *= Radius * 0.75f; @@ -747,7 +747,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) LeftView.HSplitTop(LineSize, &Button, &LeftView); if(DoButton_Menu(&s_OverrideButton, Localize("Override Selected"), 0, &Button) && s_SelectedBindIndex >= 0) { - CBindwheel::CBind TempBind; + CBindWheel::CBind TempBind; if(str_length(s_aBindName) == 0) str_copy(TempBind.m_aName, "*"); else @@ -762,7 +762,7 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) Button.VSplitMid(&ButtonRemove, &ButtonAdd, MarginSmall); if(DoButton_Menu(&s_AddButton, Localize("Add Bind"), 0, &ButtonAdd)) { - CBindwheel::CBind TempBind; + CBindWheel::CBind TempBind; if(str_length(s_aBindName) == 0) str_copy(TempBind.m_aName, "*"); else @@ -1005,8 +1005,9 @@ void CMenus::RenderSettingsWarList(CUIRect MainView) Ui()->DoEditBox_Search(&s_EntriesFilterInput, &EntriesSearch, 14.0f, !Ui()->IsPopupOpen() && m_pClient->m_GameConsole.IsClosed()); // ======WAR ENTRY EDITING====== - - Column2.HSplitTop(HeadlineHeight, nullptr, &Column2); + Column2.HSplitTop(HeadlineHeight, &Label, &Column2); + Label.VSplitRight(25.0f, &Label, &Button); + Ui()->DoLabel(&Label, Localize("Edit Entry"), HeadlineFontSize, TEXTALIGN_ML); Column2.HSplitTop(MarginSmall, nullptr, &Column2); Column2.HSplitTop(HeadlineFontSize, &Button, &Column2); diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 2d7e5c4230e..e33ab6d66da 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -183,7 +183,7 @@ class CGameClient : public IGameClient // TClient Components CSkinProfiles m_SkinProfiles; CBindchat m_Bindchat; - CBindwheel m_Bindwheel; + CBindWheel m_Bindwheel; CTater m_Tater; CPlayerIndicator m_PlayerIndicator; COutlines m_Outlines;