mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Use highlighted tab bars in server browser
This commit is contained in:
parent
3323c3fadb
commit
838c183b10
@ -107,22 +107,7 @@ void CBrowser::Draw(void)
|
||||
|
||||
ImGui::Begin(m_pszBrowserTitle, NULL, ImGuiWindowFlags_NoScrollbar);
|
||||
{
|
||||
CompMenu();
|
||||
|
||||
switch (eCurrentSection)
|
||||
{
|
||||
case eSection::SERVER_BROWSER:
|
||||
ServerBrowserSection();
|
||||
break;
|
||||
case eSection::HOST_SERVER:
|
||||
HostServerSection();
|
||||
break;
|
||||
case eSection::SETTINGS:
|
||||
SettingsSection();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
BasePanel();
|
||||
}
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar(nVars);
|
||||
@ -153,22 +138,25 @@ void CBrowser::Think(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: draws the compmenu
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBrowser::CompMenu(void)
|
||||
void CBrowser::BasePanel(void)
|
||||
{
|
||||
ImGui::BeginTabBar("CompMenu");
|
||||
if (ImGui::TabItemButton("Server Browser"))
|
||||
if (ImGui::BeginTabItem("Server Browser"))
|
||||
{
|
||||
SetSection(eSection::SERVER_BROWSER);
|
||||
BrowserPanel();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
#ifndef CLIENT_DLL
|
||||
if (ImGui::TabItemButton("Host Server"))
|
||||
if (ImGui::BeginTabItem("Host Server"))
|
||||
{
|
||||
SetSection(eSection::HOST_SERVER);
|
||||
HostPanel();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
#endif // !CLIENT_DLL
|
||||
if (ImGui::TabItemButton("Settings"))
|
||||
if (ImGui::BeginTabItem("Settings"))
|
||||
{
|
||||
SetSection(eSection::SETTINGS);
|
||||
SettingsPanel();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
@ -176,7 +164,7 @@ void CBrowser::CompMenu(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: draws the server browser section
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBrowser::ServerBrowserSection(void)
|
||||
void CBrowser::BrowserPanel(void)
|
||||
{
|
||||
ImGui::BeginGroup();
|
||||
m_imServerBrowserFilter.Draw();
|
||||
@ -433,7 +421,7 @@ void CBrowser::HiddenServersModal(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: draws the host section
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBrowser::HostServerSection(void)
|
||||
void CBrowser::HostPanel(void)
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
static string svServerNameErr = "";
|
||||
@ -693,7 +681,7 @@ void CBrowser::ProcessCommand(const char* pszCommand)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: draws the settings section
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBrowser::SettingsSection(void)
|
||||
void CBrowser::SettingsPanel(void)
|
||||
{
|
||||
ImGui::InputTextWithHint("Hostname", "Matchmaking Server String", &m_szMatchmakingHostName);
|
||||
if (ImGui::Button("Update Hostname"))
|
||||
|
@ -5,13 +5,6 @@
|
||||
#include "networksystem/serverlisting.h"
|
||||
#include "networksystem/r5net.h"
|
||||
|
||||
enum class eSection
|
||||
{
|
||||
SERVER_BROWSER,
|
||||
HOST_SERVER,
|
||||
SETTINGS
|
||||
};
|
||||
|
||||
enum class eHostStatus
|
||||
{
|
||||
NOT_HOSTING,
|
||||
@ -37,7 +30,6 @@ public:
|
||||
// Enum Vars //
|
||||
////////////////////
|
||||
|
||||
eSection eCurrentSection = eSection::SERVER_BROWSER;
|
||||
eHostStatus eHostingStatus = eHostStatus::NOT_HOSTING;
|
||||
EServerVisibility eServerVisibility = EServerVisibility::OFFLINE;
|
||||
public:
|
||||
@ -50,9 +42,9 @@ public:
|
||||
void Draw(void);
|
||||
void Think(void);
|
||||
|
||||
void CompMenu(void);
|
||||
void BasePanel(void);
|
||||
|
||||
void ServerBrowserSection(void);
|
||||
void BrowserPanel(void);
|
||||
void RefreshServerList(void);
|
||||
void GetServerList(void);
|
||||
|
||||
@ -60,7 +52,7 @@ public:
|
||||
void ConnectToServer(const string& svServer, const string& svNetKey);
|
||||
|
||||
void HiddenServersModal(void);
|
||||
void HostServerSection(void);
|
||||
void HostPanel(void);
|
||||
|
||||
void UpdateHostingStatus(void);
|
||||
void SendHostingPostRequest(void);
|
||||
@ -68,7 +60,7 @@ public:
|
||||
void ProcessCommand(const char* pszCommand);
|
||||
void LaunchServer(void);
|
||||
|
||||
void SettingsSection(void);
|
||||
void SettingsPanel(void);
|
||||
void RegenerateEncryptionKey(void) const;
|
||||
void ChangeEncryptionKey(const std::string& svNetKey) const;
|
||||
|
||||
@ -111,11 +103,6 @@ public:
|
||||
/* Texture */
|
||||
ID3D11ShaderResourceView* m_idLockedIcon = nullptr;
|
||||
MODULERESOURCE m_rLockedIconBlob;
|
||||
|
||||
void SetSection(eSection section)
|
||||
{
|
||||
eCurrentSection = section;
|
||||
}
|
||||
};
|
||||
|
||||
extern CBrowser* g_pBrowser;
|
||||
|
Loading…
x
Reference in New Issue
Block a user