diff --git a/r5dev/gameui/IBrowser.cpp b/r5dev/gameui/IBrowser.cpp index 971f6972..0e10ab84 100644 --- a/r5dev/gameui/IBrowser.cpp +++ b/r5dev/gameui/IBrowser.cpp @@ -40,10 +40,19 @@ History: // Purpose: //----------------------------------------------------------------------------- CBrowser::CBrowser(void) + : m_pszBrowserLabel("Server Browser") + , m_bActivate(false) + , m_bInitialized(false) + , m_bReclaimFocus(false) + , m_bQueryListNonRecursive(false) + , m_flFadeAlpha(0.f) + , m_HostRequestMessageColor(1.00f, 1.00f, 1.00f, 1.00f) + , m_ivHiddenServerMessageColor(0.00f, 1.00f, 0.00f, 1.00f) + , m_Style(ImGuiStyle_t::NONE) { memset(m_szServerAddressBuffer, '\0', sizeof(m_szServerAddressBuffer)); + memset(m_szServerEncKeyBuffer, '\0', sizeof(m_szServerEncKeyBuffer)); - m_pszBrowserTitle = "Server Browser"; m_rLockedIconBlob = GetModuleResource(IDB_PNG2); } @@ -52,7 +61,6 @@ CBrowser::CBrowser(void) //----------------------------------------------------------------------------- CBrowser::~CBrowser(void) { - //delete r5net; } //----------------------------------------------------------------------------- @@ -554,10 +562,7 @@ void CBrowser::HostPanel(void) void CBrowser::UpdateHostingStatus(void) { #ifndef CLIENT_DLL - if (!g_pHostState || !g_pCVar) - { - return; - } + assert(g_pHostState && g_pCVar); std::lock_guard l(g_pServerListManager->m_Mutex); g_pServerListManager->m_HostingStatus = g_pServer->IsActive() ? EHostStatus_t::HOSTING : EHostStatus_t::NOT_HOSTING; // Are we hosting a server? diff --git a/r5dev/gameui/IBrowser.h b/r5dev/gameui/IBrowser.h index 917c3de8..d6949194 100644 --- a/r5dev/gameui/IBrowser.h +++ b/r5dev/gameui/IBrowser.h @@ -36,21 +36,20 @@ public: void SetHostName(const char* pszHostName); virtual void SetStyleVar(void); - - const char* m_pszBrowserTitle = nullptr; - bool m_bActivate = false; + const char* m_pszBrowserLabel; + bool m_bActivate; private: - bool m_bInitialized = false; - bool m_bQueryListNonRecursive = false; // When set, refreshes the server list once the next frame. - char m_szServerAddressBuffer[256] = { '\0' }; - char m_szServerEncKeyBuffer[30] = { '\0' }; - float m_flFadeAlpha = 0.f; + bool m_bInitialized; + bool m_bReclaimFocus; + bool m_bQueryListNonRecursive; // When set, refreshes the server list once the next frame. + char m_szServerAddressBuffer[256]; + char m_szServerEncKeyBuffer[30]; + float m_flFadeAlpha; - ImGuiStyle_t m_Style = ImGuiStyle_t::NONE; - ID3D11ShaderResourceView* m_idLockedIcon = nullptr; - MODULERESOURCE m_rLockedIconBlob; - mutable std::mutex m_Mutex; + ID3D11ShaderResourceView* m_idLockedIcon; + MODULERESOURCE m_rLockedIconBlob; + mutable std::mutex m_Mutex; //////////////////// // Server List // @@ -64,14 +63,16 @@ private: //////////////////// string m_svHostRequestMessage; string m_svHostToken; - ImVec4 m_HostRequestMessageColor = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); + ImVec4 m_HostRequestMessageColor; //////////////////// // Private Server // //////////////////// string m_svHiddenServerToken; string m_svHiddenServerRequestMessage; - ImVec4 m_ivHiddenServerMessageColor = ImVec4(0.00f, 1.00f, 0.00f, 1.00f); + ImVec4 m_ivHiddenServerMessageColor; + + ImGuiStyle_t m_Style; }; extern CBrowser* g_pBrowser;