Skip to content

Commit

Permalink
status bar files
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Dec 24, 2024
1 parent 68c0577 commit 7b578b6
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2418,6 +2418,8 @@ if(CLIENT)
components/tclient/rainbow.h
components/tclient/skinprofiles.cpp
components/tclient/skinprofiles.h
components/tclient/statusbar.cpp
components/tclient/statusbar.h
components/tclient/tater.cpp
components/tclient/tater.h
components/tclient/verify.cpp
Expand Down
52 changes: 46 additions & 6 deletions src/game/client/components/tclient/menus_tclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,22 +1343,62 @@ void CMenus::RenderSettingsInfo(CUIRect MainView)
static CButtonContainer s_DiscordButton, s_WebsiteButton, s_GithubButton, s_SupportButton;
CUIRect ButtonLeft, ButtonRight;

LeftView.HSplitTop(LineSize, &Button, &LeftView);
LeftView.HSplitTop(LineSize * 2.0f, &Button, &LeftView);
Button.VSplitMid(&ButtonLeft, &ButtonRight, MarginSmall);
if(DoButton_Menu(&s_DiscordButton, Localize("Discord"), 0, &ButtonLeft, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
if(DoButtonLineSize_Menu(&s_DiscordButton, Localize("Discord"), 0, &ButtonLeft, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
Client()->ViewLink("https://discord.gg/fBvhH93Bt6");
if(DoButton_Menu(&s_WebsiteButton, Localize("Wesbite"), 0, &ButtonRight, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
if(DoButtonLineSize_Menu(&s_WebsiteButton, Localize("Wesbite"), 0, &ButtonRight, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
Client()->ViewLink("https://tclient.app/");

LeftView.HSplitTop(MarginSmall, nullptr, &LeftView);
LeftView.HSplitTop(LineSize, &Button, &LeftView);
LeftView.HSplitTop(LineSize * 2.0f, &Button, &LeftView);
Button.VSplitMid(&ButtonLeft, &ButtonRight, MarginSmall);

if(DoButton_Menu(&s_GithubButton, Localize("Github"), 0, &ButtonLeft, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
if(DoButtonLineSize_Menu(&s_GithubButton, Localize("Github"), 0, &ButtonLeft, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
Client()->ViewLink("https://github.com/sjrc6/TaterClient-ddnet");
if(DoButton_Menu(&s_SupportButton, Localize("Support"), 0, &ButtonRight, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
if(DoButtonLineSize_Menu(&s_SupportButton, Localize("Support"), 0, &ButtonRight, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
Client()->ViewLink("https://ko-fi.com/Totar");

LeftView.HSplitTop(40.0f, nullptr, &LeftView);

LeftView.HSplitTop(HeadlineHeight, &Label, &LeftView);
Ui()->DoLabel(&Label, Localize("Config Files"), HeadlineFontSize, TEXTALIGN_ML);
LeftView.HSplitTop(MarginSmall, nullptr, &LeftView);

char aBuf[128 + IO_MAX_PATH_LENGTH];
CUIRect TClientConfig, ProfilesFile, WarlistFile, ChatbindsFile;

LeftView.HSplitTop(LineSize * 2.0f, &Button, &LeftView);
Button.VSplitMid(&TClientConfig, &ProfilesFile, MarginSmall);

static CButtonContainer s_Config, s_Profiles, s_Warlist, s_Chatbinds;
if(DoButtonLineSize_Menu(&s_Config, Localize("TClient Config"), 0, &TClientConfig, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
{
Storage()->GetCompletePath(IStorage::TYPE_SAVE, TCONFIG_FILE, aBuf, sizeof(aBuf));
Client()->ViewFile(aBuf);
}
if(DoButtonLineSize_Menu(&s_Profiles, Localize("Profiles File"), 0, &ProfilesFile, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
{
Storage()->GetCompletePath(IStorage::TYPE_SAVE, PROFILES_FILE, aBuf, sizeof(aBuf));
Client()->ViewFile(aBuf);
}
LeftView.HSplitTop(MarginSmall, nullptr, &LeftView);

LeftView.HSplitTop(LineSize * 2.0f, &Button, &LeftView);
Button.VSplitMid(&WarlistFile, &ChatbindsFile, MarginSmall);

if(DoButtonLineSize_Menu(&s_Warlist, Localize("Warlist File"), 0, &WarlistFile, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
{
Storage()->GetCompletePath(IStorage::TYPE_SAVE, WARLIST_FILE, aBuf, sizeof(aBuf));
Client()->ViewFile(aBuf);
}
if(DoButtonLineSize_Menu(&s_Chatbinds, Localize("Chatbinds File"), 0, &ChatbindsFile, LineSize, false, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
{
Storage()->GetCompletePath(IStorage::TYPE_SAVE, BINDCHAT_FILE, aBuf, sizeof(aBuf));
Client()->ViewFile(aBuf);
}


// =======RIGHT VIEW========

RightView.HSplitTop(HeadlineHeight, &Label, &RightView);
Expand Down
15 changes: 15 additions & 0 deletions src/game/client/components/tclient/statusbar.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <engine/graphics.h>
#include <engine/shared/config.h>
#include <game/generated/protocol.h>

#include "../chat.h"

#include <game/client/render.h>
#include <game/client/ui.h>

#include "statusbar.h"
#include <game/client/gameclient.h>

void CStatusBar::OnInit()
{
}
15 changes: 15 additions & 0 deletions src/game/client/components/tclient/statusbar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef GAME_CLIENT_COMPONENTS_STATUSBAR_H
#define GAME_CLIENT_COMPONENTS_STATUSBAR_H
#include <game/client/component.h>

class CStatusBar : public CComponent
{

public:
CStatusBar();
virtual int Sizeof() const override { return sizeof(*this); }
virtual void OnInit() override;

};

#endif
1 change: 1 addition & 0 deletions src/game/client/gameclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ void CGameClient::OnConsoleInit()
&m_Bindchat,
&m_Bindwheel,
&m_WarList,
&m_StatusBar,
&m_InfoMessages,
&m_Chat,
&m_Broadcast,
Expand Down
2 changes: 2 additions & 0 deletions src/game/client/gameclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include "components/tclient/player_indicator.h"
#include "components/tclient/rainbow.h"
#include "components/tclient/skinprofiles.h"
#include "components/tclient/statusbar.h"
#include "components/tclient/tater.h"
#include "components/tclient/verify.h"
#include "components/tclient/warlist.h"
Expand Down Expand Up @@ -182,6 +183,7 @@ class CGameClient : public IGameClient

// TClient Components
CSkinProfiles m_SkinProfiles;
CStatusBar m_StatusBar;
CBindchat m_Bindchat;
CBindWheel m_Bindwheel;
CTater m_Tater;
Expand Down

0 comments on commit 7b578b6

Please sign in to comment.