Skip to content

Commit

Permalink
Clean up conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Dec 22, 2024
1 parent 462fba0 commit bb8b9a7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 38 deletions.
54 changes: 27 additions & 27 deletions src/game/client/components/tclient/bindwheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
#include "bindwheel.h"
#include <game/client/gameclient.h>

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)
Expand All @@ -39,39 +39,39 @@ void CBindwheel::ConAddBindwheelLegacy(IConsole::IResult *pResult, void *pUserDa
const char *aName = pResult->GetString(1);
const char *aCommand = pResult->GetString(2);

CBindwheel *pThis = static_cast<CBindwheel *>(pUserData);
CBindWheel *pThis = static_cast<CBindWheel *>(pUserData);
while(pThis->m_vBinds.size() <= (size_t)BindPos)
pThis->AddBind("EMPTY", "");

str_copy(pThis->m_vBinds[BindPos].m_aName, aName);
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<CBindwheel *>(pUserData);
CBindWheel *pThis = static_cast<CBindWheel *>(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<CBindwheel *>(pUserData);
CBindWheel *pThis = static_cast<CBindWheel *>(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<CBindwheel *>(pUserData);
CBindWheel *pThis = static_cast<CBindWheel *>(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;
Expand All @@ -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);
Expand All @@ -92,20 +92,20 @@ 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<int>(m_vBinds.size()) || Index < 0)
return;
auto Pos = m_vBinds.begin() + Index;
m_vBinds.erase(Pos);
}

void CBindwheel::RemoveAllBinds()
void CBindWheel::RemoveAllBinds()
{
m_vBinds.clear();
}

void CBindwheel::OnConsoleInit()
void CBindWheel::OnConsoleInit()
{
IConfigManager *pConfigManager = Kernel()->RequestInterface<IConfigManager>();
if(pConfigManager)
Expand All @@ -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;
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/tclient/bindwheel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -44,7 +44,7 @@ class CBindwheel : public CComponent

std::vector<CBind> m_vBinds;

CBindwheel();
CBindWheel();
virtual int Sizeof() const override { return sizeof(*this); }

virtual void OnReset() override;
Expand Down
17 changes: 9 additions & 8 deletions src/game/client/components/tclient/menus_tclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/game/client/gameclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bb8b9a7

Please sign in to comment.