From add5c577fff10df60afc5c7773e357f50c0a71b9 Mon Sep 17 00:00:00 2001
From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com>
Date: Fri, 24 Jun 2022 12:22:04 +0200
Subject: [PATCH] Improve ImGui theme system

-imgui_theme "modern" = Respawn theme.
-imgui_theme "legacy" = Valve theme.
No args = default theme.
---
 r5dev/gameui/IBrowser.cpp                     | 127 +--------
 r5dev/gameui/IBrowser.h                       |   4 +-
 r5dev/gameui/IConsole.cpp                     | 247 ++++++------------
 r5dev/gameui/IConsole.h                       |  10 +-
 .../thirdparty/imgui/include/imgui_utility.h  |   1 +
 r5dev/thirdparty/imgui/src/imgui_utility.cpp  | 179 +++++++++++++
 6 files changed, 273 insertions(+), 295 deletions(-)

diff --git a/r5dev/gameui/IBrowser.cpp b/r5dev/gameui/IBrowser.cpp
index 91478c0b..6031e54c 100644
--- a/r5dev/gameui/IBrowser.cpp
+++ b/r5dev/gameui/IBrowser.cpp
@@ -89,7 +89,9 @@ void CBrowser::Draw(void)
     }
 
     int nVars = 0;
-    ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha); nVars++;
+    ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha);                   nVars++;
+    ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(750, 510));        nVars++;
+
     if (!ImGui::Begin(m_pszBrowserTitle, &m_bActivate))
     {
         ImGui::End();
@@ -98,9 +100,6 @@ void CBrowser::Draw(void)
     }
     ImGui::End();
 
-    ImGui::SetNextWindowSize(ImVec2(840, 600), ImGuiCond_FirstUseEver);
-    ImGui::SetWindowPos(ImVec2(-500, 50), ImGuiCond_FirstUseEver);
-
     ImGui::Begin(m_pszBrowserTitle, NULL, ImGuiWindowFlags_NoScrollbar);
     {
         CompMenu();
@@ -189,7 +188,7 @@ void CBrowser::ServerBrowserSection(void)
     ImGui::BeginChild("##ServerBrowser_ServerList", { 0, -fFooterHeight }, true, ImGuiWindowFlags_AlwaysVerticalScrollbar);
 
     int nVars = 0;
-    if (m_bDefaultTheme)
+    if (m_bModernTheme)
     {
         ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2{ 8.f, 0.f }); nVars++;
     }
@@ -311,7 +310,7 @@ void CBrowser::ConnectToServer(const string& svIp, const string& svPort, const s
 {
     if (!svNetKey.empty())
     {
-        ChangeEncryptionKeyTo(svNetKey);
+        ChangeEncryptionKey(svNetKey);
     }
 
     stringstream ssCommand;
@@ -326,7 +325,7 @@ void CBrowser::ConnectToServer(const string& svServer, const string& svNetKey)
 {
     if (!svNetKey.empty())
     {
-        ChangeEncryptionKeyTo(svNetKey);
+        ChangeEncryptionKey(svNetKey);
     }
 
     stringstream ssCommand;
@@ -719,7 +718,7 @@ void CBrowser::RegenerateEncryptionKey(void) const
 //-----------------------------------------------------------------------------
 // Purpose: changes encryption key to specified one
 //-----------------------------------------------------------------------------
-void CBrowser::ChangeEncryptionKeyTo(const string& svNetKey) const
+void CBrowser::ChangeEncryptionKey(const string& svNetKey) const
 {
     NET_SetKey(svNetKey);
 }
@@ -729,117 +728,13 @@ void CBrowser::ChangeEncryptionKeyTo(const string& svNetKey) const
 //-----------------------------------------------------------------------------
 void CBrowser::SetStyleVar(void)
 {
-    ImGuiStyle& style                     = ImGui::GetStyle();
-    ImVec4* colors                        = style.Colors;
-
-    if (!CommandLine()->CheckParm("-imgui_default_theme"))
+    if (g_pImGuiConfig->InitStyle() == 0)
     {
-        colors[ImGuiCol_Text]                 = ImVec4(0.81f, 0.81f, 0.81f, 1.00f);
-        colors[ImGuiCol_TextDisabled]         = ImVec4(0.56f, 0.56f, 0.56f, 1.00f);
-        colors[ImGuiCol_TextSelectedBg]       = ImVec4(0.13f, 0.38f, 0.63f, 0.50f);
-        colors[ImGuiCol_WindowBg]             = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
-        colors[ImGuiCol_ChildBg]              = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
-        colors[ImGuiCol_PopupBg]              = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
-        colors[ImGuiCol_Border]               = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_BorderShadow]         = ImVec4(0.04f, 0.04f, 0.04f, 0.64f);
-        colors[ImGuiCol_FrameBg]              = ImVec4(0.13f, 0.13f, 0.13f, 1.00f);
-        colors[ImGuiCol_FrameBgHovered]       = ImVec4(0.19f, 0.19f, 0.19f, 1.00f);
-        colors[ImGuiCol_FrameBgActive]        = ImVec4(0.24f, 0.24f, 0.24f, 1.00f);
-        colors[ImGuiCol_TitleBg]              = ImVec4(0.22f, 0.22f, 0.22f, 1.00f);
-        colors[ImGuiCol_TitleBgActive]        = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
-        colors[ImGuiCol_TitleBgCollapsed]     = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
-        colors[ImGuiCol_MenuBarBg]            = ImVec4(0.22f, 0.22f, 0.22f, 1.00f);
-        colors[ImGuiCol_ScrollbarBg]          = ImVec4(0.10f, 0.10f, 0.10f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrab]        = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabActive]  = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
-        colors[ImGuiCol_CheckMark]            = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
-        colors[ImGuiCol_SliderGrab]           = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_SliderGrabActive]     = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_Button]               = ImVec4(0.35f, 0.35f, 0.35f, 1.00f);
-        colors[ImGuiCol_ButtonHovered]        = ImVec4(0.45f, 0.45f, 0.45f, 1.00f);
-        colors[ImGuiCol_ButtonActive]         = ImVec4(0.52f, 0.52f, 0.52f, 1.00f);
-        colors[ImGuiCol_Header]               = ImVec4(0.35f, 0.35f, 0.35f, 1.00f);
-        colors[ImGuiCol_HeaderHovered]        = ImVec4(0.45f, 0.45f, 0.45f, 1.00f);
-        colors[ImGuiCol_HeaderActive]         = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_Separator]            = ImVec4(0.53f, 0.53f, 0.57f, 1.00f);
-        colors[ImGuiCol_SeparatorHovered]     = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_SeparatorActive]      = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
-        colors[ImGuiCol_ResizeGrip]           = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_ResizeGripHovered]    = ImVec4(0.52f, 0.52f, 0.52f, 1.00f);
-        colors[ImGuiCol_ResizeGripActive]     = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
-        colors[ImGuiCol_Tab]                  = ImVec4(0.18f, 0.18f, 0.18f, 1.00f);
-        colors[ImGuiCol_TabHovered]           = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
-        colors[ImGuiCol_TabActive]            = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
-
-        style.WindowBorderSize  = 0.0f;
-        style.FrameBorderSize   = 1.0f;
-        style.ChildBorderSize   = 1.0f;
-        style.PopupBorderSize   = 1.0f;
-        style.TabBorderSize     = 1.0f;
-        
-        style.WindowRounding    = 4.0f;
-        style.FrameRounding     = 1.0f;
-        style.ChildRounding     = 1.0f;
-        style.PopupRounding     = 3.0f;
-        style.TabRounding       = 1.0f;
-        style.ScrollbarRounding = 1.0f;
-    }
-    else
-    {
-        colors[ImGuiCol_TextSelectedBg]         = ImVec4(0.13f, 0.38f, 0.63f, 0.50f);
-        colors[ImGuiCol_WindowBg]               = ImVec4(0.13f, 0.15f, 0.18f, 1.00f);
-        colors[ImGuiCol_ChildBg]                = ImVec4(0.00f, 0.00f, 0.00f, 0.78f);
-        colors[ImGuiCol_PopupBg]                = ImVec4(0.11f, 0.13f, 0.17f, 1.00f);
-        colors[ImGuiCol_Border]                 = ImVec4(0.61f, 0.61f, 0.61f, 0.50f);
-        colors[ImGuiCol_BorderShadow]           = ImVec4(0.04f, 0.04f, 0.04f, 0.00f);
-        colors[ImGuiCol_FrameBg]                = ImVec4(0.00f, 0.00f, 0.00f, 0.78f);
-        colors[ImGuiCol_FrameBgHovered]         = ImVec4(0.04f, 0.06f, 0.10f, 1.00f);
-        colors[ImGuiCol_FrameBgActive]          = ImVec4(0.04f, 0.07f, 0.12f, 1.00f);
-        colors[ImGuiCol_TitleBg]                = ImVec4(0.26f, 0.51f, 0.78f, 1.00f);
-        colors[ImGuiCol_TitleBgActive]          = ImVec4(0.26f, 0.51f, 0.78f, 1.00f);
-        colors[ImGuiCol_MenuBarBg]              = ImVec4(0.11f, 0.13f, 0.17f, 1.00f);
-        colors[ImGuiCol_ScrollbarBg]            = ImVec4(0.16f, 0.20f, 0.24f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrab]          = ImVec4(0.23f, 0.36f, 0.51f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabHovered]   = ImVec4(0.30f, 0.46f, 0.65f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabActive]    = ImVec4(0.31f, 0.49f, 0.69f, 1.00f);
-        colors[ImGuiCol_SliderGrab]             = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_SliderGrabActive]       = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_Button]                 = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_ButtonHovered]          = ImVec4(0.38f, 0.52f, 0.53f, 1.00f);
-        colors[ImGuiCol_ButtonActive]           = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_Header]                 = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_HeaderHovered]          = ImVec4(0.38f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_HeaderActive]           = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_Separator]              = ImVec4(0.53f, 0.53f, 0.57f, 0.00f);
-        colors[ImGuiCol_ResizeGrip]             = ImVec4(0.81f, 0.81f, 0.81f, 0.50f);
-        colors[ImGuiCol_Tab]                    = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_TabHovered]             = ImVec4(0.38f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_TabActive]              = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_TableHeaderBg]          = ImVec4(0.14f, 0.19f, 0.24f, 1.00f);
-        colors[ImGuiCol_TableBorderStrong]      = ImVec4(0.20f, 0.26f, 0.33f, 1.00f);
-        colors[ImGuiCol_TableBorderLight]       = ImVec4(0.22f, 0.29f, 0.37f, 1.00f);
-
-        style.WindowBorderSize  = 1.0f;
-        style.FrameBorderSize   = 0.0f;
-        style.ChildBorderSize   = 0.0f;
-        style.PopupBorderSize   = 1.0f;
-        style.TabBorderSize     = 1.0f;
-
-        style.WindowRounding    = 4.0f;
-        style.FrameRounding     = 1.0f;
-        style.ChildRounding     = 1.0f;
-        style.PopupRounding     = 3.0f;
-        style.TabRounding       = 1.0f;
-        style.ScrollbarRounding = 3.0f;
-
-        m_bDefaultTheme = true;
+        m_bModernTheme = true;
     }
 
-    style.ItemSpacing       = ImVec2(4, 4);
-    style.FramePadding      = ImVec2(4, 4);
-    style.WindowPadding     = ImVec2(5, 5);
-    style.WindowMinSize     = ImVec2(750, 510);
+    ImGui::SetNextWindowSize(ImVec2(840, 600), ImGuiCond_FirstUseEver);
+    ImGui::SetWindowPos(ImVec2(-500, 50), ImGuiCond_FirstUseEver);
 }
 
 CBrowser* g_pBrowser = new CBrowser();
\ No newline at end of file
diff --git a/r5dev/gameui/IBrowser.h b/r5dev/gameui/IBrowser.h
index 6cf0b444..0c2c1f6d 100644
--- a/r5dev/gameui/IBrowser.h
+++ b/r5dev/gameui/IBrowser.h
@@ -29,7 +29,7 @@ class CBrowser
 {
 private:
     bool m_bInitialized = false;
-    bool m_bDefaultTheme = false;
+    bool m_bModernTheme = false;
 public:
     ////////////////////
     //   Enum Vars    //
@@ -68,7 +68,7 @@ public:
 
     void SettingsSection(void);
     void RegenerateEncryptionKey(void) const;
-    void ChangeEncryptionKeyTo(const std::string& svNetKey) const;
+    void ChangeEncryptionKey(const std::string& svNetKey) const;
 
     void SetStyleVar(void);
 
diff --git a/r5dev/gameui/IConsole.cpp b/r5dev/gameui/IConsole.cpp
index 46a23165..32ee1c92 100644
--- a/r5dev/gameui/IConsole.cpp
+++ b/r5dev/gameui/IConsole.cpp
@@ -60,23 +60,7 @@ CConsole::~CConsole(void)
 bool CConsole::Setup(void)
 {
     SetStyleVar();
-
-    int k = 0; // Get all image resources for displaying flags.
-    for (int i = IDB_PNG3; i <= IDB_PNG18; i++)
-    {
-        m_vFlagIcons.push_back(MODULERESOURCE());
-        m_vFlagIcons[k] = GetModuleResource(i);
-
-        bool ret = LoadTextureBuffer(reinterpret_cast<unsigned char*>(m_vFlagIcons[k].m_pData), static_cast<int>(m_vFlagIcons[k].m_nSize),
-            &m_vFlagIcons[k].m_idIcon, &m_vFlagIcons[k].m_nWidth, &m_vFlagIcons[k].m_nHeight);
-        if (!ret)
-        {
-            IM_ASSERT(ret);
-            return false;
-        }
-        k++;
-    }
-    return true;
+    return LoadFlagIcons();
 }
 
 //-----------------------------------------------------------------------------
@@ -104,7 +88,7 @@ void CConsole::Draw(void)
         {
             return;
         }
-        if (m_bDefaultTheme)
+        if (m_bModernTheme)
         {
             ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 8.f, 10.f }); nVars++;
             ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha);               nVars++;
@@ -115,12 +99,9 @@ void CConsole::Draw(void)
             ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 1.0f);              nVars++;
             ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha);               nVars++;
         }
-
-        ImGui::SetNextWindowSize(ImVec2(1000, 600), ImGuiCond_FirstUseEver);
-        ImGui::SetWindowPos(ImVec2(-1000, 50), ImGuiCond_FirstUseEver);
+        ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(618, 518));        nVars++;
 
         BasePanel();
-
         ImGui::PopStyleVar(nVars);
     }
 
@@ -131,9 +112,9 @@ void CConsole::Draw(void)
         int nVars = 0;
         if (AutoComplete())
         {
-            if (m_bDefaultTheme)
+            if (m_bModernTheme)
             {
-                static ImGuiStyle& style = ImGui::GetStyle();
+                static const ImGuiStyle& style = ImGui::GetStyle();
                 m_ivSuggestWindowPos.y = m_ivSuggestWindowPos.y + style.WindowPadding.y + 1.5f;
             }
 
@@ -547,7 +528,7 @@ void CConsole::ProcessCommand(const char* pszCommand)
     std::this_thread::sleep_for(std::chrono::milliseconds(1));
 
     m_nHistoryPos = -1;
-    for (int i = static_cast<int>(m_vHistory.size()) - 1; i >= 0; i--)
+    for (ssize_t i = static_cast<ssize_t>(m_vHistory.size()) - 1; i >= 0; i--)
     {
         if (m_vHistory[i].compare(pszCommand) == 0)
         {
@@ -585,8 +566,8 @@ void CConsole::ProcessCommand(const char* pszCommand)
     }
     else if (Stricmp(pszCommand, "HISTORY") == 0)
     {
-        int nFirst = static_cast<int>(m_vHistory.size()) - 10;
-        for (int i = nFirst > 0 ? nFirst : 0; i < static_cast<int>(m_vHistory.size()); i++)
+        ssize_t nFirst = static_cast<ssize_t>(m_vHistory.size()) - 10;
+        for (ssize_t i = nFirst > 0 ? nFirst : 0; i < static_cast<ssize_t>(m_vHistory.size()); i++)
         {
             AddLog(ImVec4(0.81f, 0.81f, 0.81f, 1.00f), "%3d: %s\n", i, m_vHistory[i].c_str());
         }
@@ -595,6 +576,64 @@ void CConsole::ProcessCommand(const char* pszCommand)
     m_Logger.m_bScrollToBottom = true;
 }
 
+//-----------------------------------------------------------------------------
+// Purpose: builds the console summary
+// Input  : svConVar - 
+//-----------------------------------------------------------------------------
+void CConsole::BuildSummary(string svConVar)
+{
+    if (!svConVar.empty())
+    {
+        for (size_t i = 0; i < svConVar.size(); i++)
+        {
+            if (svConVar[i] == ' ' || svConVar[i] == ';')
+            {
+                svConVar[i] = '\0'; // Remove space or semicolon before we call 'g_pCVar->FindVar(..)'.
+            }
+        }
+
+        ConVar* pConVar = g_pCVar->FindVar(svConVar.c_str());
+        if (pConVar)
+        {
+            // Display the current and default value of ConVar if found.
+            snprintf(m_szSummary, sizeof(m_szSummary), "(\"%s\", default \"%s\")", pConVar->GetString(), pConVar->GetDefault());
+        }
+        else
+        {
+            // Display amount of history items if ConVar cannot be found.
+            snprintf(m_szSummary, sizeof(m_szSummary), "%zu history items", m_vHistory.size());
+        }
+    }
+    else // Default or empty param.
+    {
+        snprintf(m_szSummary, sizeof(m_szSummary), "%zu history items", m_vHistory.size());
+    }
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: loads flag images from resource section (must be aligned with resource.h!)
+// Output : true on success, false on failure 
+//-----------------------------------------------------------------------------
+bool CConsole::LoadFlagIcons(void)
+{
+    int k = 0; // Get all image resources for displaying flags.
+    for (int i = IDB_PNG3; i <= IDB_PNG18; i++)
+    {
+        m_vFlagIcons.push_back(MODULERESOURCE());
+        m_vFlagIcons[k] = GetModuleResource(i);
+
+        bool ret = LoadTextureBuffer(reinterpret_cast<unsigned char*>(m_vFlagIcons[k].m_pData), static_cast<int>(m_vFlagIcons[k].m_nSize),
+            &m_vFlagIcons[k].m_idIcon, &m_vFlagIcons[k].m_nWidth, &m_vFlagIcons[k].m_nHeight);
+        if (!ret)
+        {
+            IM_ASSERT(ret);
+            return false;
+        }
+        k++;
+    }
+    return true;
+}
+
 //-----------------------------------------------------------------------------
 // Purpose: returns flag image index for CommandBase (must be aligned with resource.h!)
 // Input  : nFlags - 
@@ -638,40 +677,6 @@ int CConsole::ColorCodeFlags(int nFlags) const
     }
 }
 
-//-----------------------------------------------------------------------------
-// Purpose: builds the console summary
-// Input  : svConVar - 
-//-----------------------------------------------------------------------------
-void CConsole::BuildSummary(string svConVar)
-{
-    if (!svConVar.empty())
-    {
-        for (size_t i = 0; i < svConVar.size(); i++)
-        {
-            if (svConVar[i] == ' ' || svConVar[i] == ';')
-            {
-                svConVar[i] = '\0'; // Remove space or semicolon before we call 'g_pCVar->FindVar(..)'.
-            }
-        }
-
-        ConVar* pConVar = g_pCVar->FindVar(svConVar.c_str());
-        if (pConVar)
-        {
-            // Display the current and default value of ConVar if found.
-            snprintf(m_szSummary, sizeof(m_szSummary), "(\"%s\", default \"%s\")", pConVar->GetString(), pConVar->GetDefault());
-        }
-        else
-        {
-            // Display amount of history items if ConVar cannot be found.
-            snprintf(m_szSummary, sizeof(m_szSummary), "%zu history items", m_vHistory.size());
-        }
-    }
-    else // Default or empty param.
-    {
-        snprintf(m_szSummary, sizeof(m_szSummary), "%zu history items", m_vHistory.size());
-    }
-}
-
 //-----------------------------------------------------------------------------
 // Purpose: console input box callback
 // Input  : *iData - 
@@ -708,7 +713,7 @@ int CConsole::TextEditCallback(ImGuiInputTextCallbackData* iData)
             }
             else if (iData->EventKey == ImGuiKey_DownArrow)
             {
-                if (m_nSuggestPos < static_cast<int>(m_vSuggest.size()) - 1)
+                if (m_nSuggestPos < static_cast<ssize_t>(m_vSuggest.size()) - 1)
                 {
                     m_nSuggestPos++;
                     m_bSuggestMoved = true;
@@ -722,7 +727,7 @@ int CConsole::TextEditCallback(ImGuiInputTextCallbackData* iData)
             {
                 if (m_nHistoryPos == -1)
                 {
-                    m_nHistoryPos = static_cast<int>(m_vHistory.size()) - 1;
+                    m_nHistoryPos = static_cast<ssize_t>(m_vHistory.size()) - 1;
                 }
                 else if (m_nHistoryPos > 0)
                 {
@@ -733,7 +738,7 @@ int CConsole::TextEditCallback(ImGuiInputTextCallbackData* iData)
             {
                 if (m_nHistoryPos != -1)
                 {
-                    if (++m_nHistoryPos >= static_cast<int>(m_vHistory.size()))
+                    if (++m_nHistoryPos >= static_cast<ssize_t>(m_vHistory.size()))
                     {
                         m_nHistoryPos = -1;
                     }
@@ -811,7 +816,7 @@ void CConsole::AddLog(const ImVec4& color, const char* fmt, ...) IM_FMTARGS(2)
 //-----------------------------------------------------------------------------
 void CConsole::ClearLog(void)
 {
-    m_Logger.RemoveLine(0, m_Logger.GetTotalLines() - 1);
+    m_Logger.RemoveLine(0, (m_Logger.GetTotalLines() - 1));
 }
 
 //-----------------------------------------------------------------------------
@@ -819,117 +824,13 @@ void CConsole::ClearLog(void)
 //-----------------------------------------------------------------------------
 void CConsole::SetStyleVar(void)
 {
-    ImGuiStyle& style                     = ImGui::GetStyle();
-    ImVec4* colors                        = style.Colors;
-
-    if (!CommandLine()->CheckParm("-imgui_default_theme"))
+    if (g_pImGuiConfig->InitStyle() == 0)
     {
-        colors[ImGuiCol_Text]                 = ImVec4(0.81f, 0.81f, 0.81f, 1.00f);
-        colors[ImGuiCol_TextDisabled]         = ImVec4(0.56f, 0.56f, 0.56f, 1.00f);
-        colors[ImGuiCol_TextSelectedBg]       = ImVec4(0.13f, 0.38f, 0.63f, 0.50f);
-        colors[ImGuiCol_WindowBg]             = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
-        colors[ImGuiCol_ChildBg]              = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
-        colors[ImGuiCol_PopupBg]              = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
-        colors[ImGuiCol_Border]               = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_BorderShadow]         = ImVec4(0.04f, 0.04f, 0.04f, 0.64f);
-        colors[ImGuiCol_FrameBg]              = ImVec4(0.13f, 0.13f, 0.13f, 1.00f);
-        colors[ImGuiCol_FrameBgHovered]       = ImVec4(0.19f, 0.19f, 0.19f, 1.00f);
-        colors[ImGuiCol_FrameBgActive]        = ImVec4(0.24f, 0.24f, 0.24f, 1.00f);
-        colors[ImGuiCol_TitleBg]              = ImVec4(0.22f, 0.22f, 0.22f, 1.00f);
-        colors[ImGuiCol_TitleBgActive]        = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
-        colors[ImGuiCol_TitleBgCollapsed]     = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
-        colors[ImGuiCol_MenuBarBg]            = ImVec4(0.22f, 0.22f, 0.22f, 1.00f);
-        colors[ImGuiCol_ScrollbarBg]          = ImVec4(0.10f, 0.10f, 0.10f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrab]        = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabActive]  = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
-        colors[ImGuiCol_CheckMark]            = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
-        colors[ImGuiCol_SliderGrab]           = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_SliderGrabActive]     = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_Button]               = ImVec4(0.35f, 0.35f, 0.35f, 1.00f);
-        colors[ImGuiCol_ButtonHovered]        = ImVec4(0.45f, 0.45f, 0.45f, 1.00f);
-        colors[ImGuiCol_ButtonActive]         = ImVec4(0.52f, 0.52f, 0.52f, 1.00f);
-        colors[ImGuiCol_Header]               = ImVec4(0.35f, 0.35f, 0.35f, 1.00f);
-        colors[ImGuiCol_HeaderHovered]        = ImVec4(0.45f, 0.45f, 0.45f, 1.00f);
-        colors[ImGuiCol_HeaderActive]         = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_Separator]            = ImVec4(0.53f, 0.53f, 0.57f, 1.00f);
-        colors[ImGuiCol_SeparatorHovered]     = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_SeparatorActive]      = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
-        colors[ImGuiCol_ResizeGrip]           = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
-        colors[ImGuiCol_ResizeGripHovered]    = ImVec4(0.52f, 0.52f, 0.52f, 1.00f);
-        colors[ImGuiCol_ResizeGripActive]     = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
-        colors[ImGuiCol_Tab]                  = ImVec4(0.18f, 0.18f, 0.18f, 1.00f);
-        colors[ImGuiCol_TabHovered]           = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
-        colors[ImGuiCol_TabActive]            = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
-
-        style.WindowBorderSize  = 0.0f;
-        style.FrameBorderSize   = 1.0f;
-        style.ChildBorderSize   = 1.0f;
-        style.PopupBorderSize   = 1.0f;
-        style.TabBorderSize     = 1.0f;
-
-        style.WindowRounding    = 4.0f;
-        style.FrameRounding     = 1.0f;
-        style.ChildRounding     = 1.0f;
-        style.PopupRounding     = 3.0f;
-        style.TabRounding       = 1.0f;
-        style.ScrollbarRounding = 1.0f;
-    }
-    else
-    {
-        colors[ImGuiCol_TextSelectedBg]         = ImVec4(0.13f, 0.38f, 0.63f, 0.50f);
-        colors[ImGuiCol_WindowBg]               = ImVec4(0.13f, 0.15f, 0.18f, 1.00f);
-        colors[ImGuiCol_ChildBg]                = ImVec4(0.00f, 0.00f, 0.00f, 0.78f);
-        colors[ImGuiCol_PopupBg]                = ImVec4(0.11f, 0.13f, 0.17f, 1.00f);
-        colors[ImGuiCol_Border]                 = ImVec4(0.61f, 0.61f, 0.61f, 0.50f);
-        colors[ImGuiCol_BorderShadow]           = ImVec4(0.04f, 0.04f, 0.04f, 0.00f);
-        colors[ImGuiCol_FrameBg]                = ImVec4(0.00f, 0.00f, 0.00f, 0.78f);
-        colors[ImGuiCol_FrameBgHovered]         = ImVec4(0.04f, 0.06f, 0.10f, 1.00f);
-        colors[ImGuiCol_FrameBgActive]          = ImVec4(0.04f, 0.07f, 0.12f, 1.00f);
-        colors[ImGuiCol_TitleBg]                = ImVec4(0.26f, 0.51f, 0.78f, 1.00f);
-        colors[ImGuiCol_TitleBgActive]          = ImVec4(0.26f, 0.51f, 0.78f, 1.00f);
-        colors[ImGuiCol_MenuBarBg]              = ImVec4(0.11f, 0.13f, 0.17f, 1.00f);
-        colors[ImGuiCol_ScrollbarBg]            = ImVec4(0.16f, 0.20f, 0.24f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrab]          = ImVec4(0.23f, 0.36f, 0.51f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabHovered]   = ImVec4(0.30f, 0.46f, 0.65f, 1.00f);
-        colors[ImGuiCol_ScrollbarGrabActive]    = ImVec4(0.31f, 0.49f, 0.69f, 1.00f);
-        colors[ImGuiCol_SliderGrab]             = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_SliderGrabActive]       = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_Button]                 = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_ButtonHovered]          = ImVec4(0.38f, 0.52f, 0.53f, 1.00f);
-        colors[ImGuiCol_ButtonActive]           = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_Header]                 = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_HeaderHovered]          = ImVec4(0.38f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_HeaderActive]           = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_Separator]              = ImVec4(0.53f, 0.53f, 0.57f, 0.00f);
-        colors[ImGuiCol_ResizeGrip]             = ImVec4(0.81f, 0.81f, 0.81f, 0.50f);
-        colors[ImGuiCol_Tab]                    = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
-        colors[ImGuiCol_TabHovered]             = ImVec4(0.38f, 0.53f, 0.53f, 1.00f);
-        colors[ImGuiCol_TabActive]              = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
-        colors[ImGuiCol_TableHeaderBg]          = ImVec4(0.14f, 0.19f, 0.24f, 1.00f);
-        colors[ImGuiCol_TableBorderStrong]      = ImVec4(0.20f, 0.26f, 0.33f, 1.00f);
-        colors[ImGuiCol_TableBorderLight]       = ImVec4(0.22f, 0.29f, 0.37f, 1.00f);
-
-        style.WindowBorderSize  = 1.0f;
-        style.FrameBorderSize   = 0.0f;
-        style.ChildBorderSize   = 0.0f;
-        style.PopupBorderSize   = 1.0f;
-        style.TabBorderSize     = 1.0f;
-
-        style.WindowRounding    = 4.0f;
-        style.FrameRounding     = 1.0f;
-        style.ChildRounding     = 1.0f;
-        style.PopupRounding     = 3.0f;
-        style.TabRounding       = 1.0f;
-        style.ScrollbarRounding = 3.0f;
-
-        m_bDefaultTheme = true;
+        m_bModernTheme = true;
     }
 
-    style.ItemSpacing       = ImVec2(4, 4);
-    style.FramePadding      = ImVec2(4, 4);
-    style.WindowPadding     = ImVec2(5, 5);
-    style.WindowMinSize = ImVec2(618, 518);
+    ImGui::SetNextWindowSize(ImVec2(1200, 518), ImGuiCond_FirstUseEver);
+    ImGui::SetWindowPos(ImVec2(-1000, 50), ImGuiCond_FirstUseEver);
 }
 
 CConsole* g_pConsole = new CConsole();
diff --git a/r5dev/gameui/IConsole.h b/r5dev/gameui/IConsole.h
index ee93b213..c31d3aa0 100644
--- a/r5dev/gameui/IConsole.h
+++ b/r5dev/gameui/IConsole.h
@@ -33,11 +33,11 @@ private:
 
     vector<string>                 m_vCommands;
     vector<string>                 m_vHistory;
-    int                            m_nHistoryPos      = -1;
+    ssize_t                        m_nHistoryPos      = -1;
     int                            m_nScrollBack      = 0;
     float                          m_flFadeAlpha      = 0.f;
     bool                           m_bInitialized     = false;
-    bool                           m_bDefaultTheme    = false;
+    bool                           m_bModernTheme     = false;
     bool                           m_bReclaimFocus    = false;
     bool                           m_bCopyToClipBoard = false;
 
@@ -45,7 +45,7 @@ private:
     bool                           m_bSuggestActive   = false;
     bool                           m_bSuggestMoved    = false;
     bool                           m_bSuggestUpdate   = false;
-    int                            m_nSuggestPos      = -1;
+    ssize_t                        m_nSuggestPos      = -1;
     vector<CSuggest>               m_vSuggest;
     vector<MODULERESOURCE>         m_vFlagIcons;
 
@@ -96,9 +96,11 @@ public:
 
     void FindFromPartial(void);
     void ProcessCommand(const char* pszCommand);
-    int ColorCodeFlags(int nFlags) const;
     void BuildSummary(string svConVar = "");
 
+    bool LoadFlagIcons(void);
+    int ColorCodeFlags(int nFlags) const;
+
     int TextEditCallback(ImGuiInputTextCallbackData* pData);
     static int TextEditCallbackStub(ImGuiInputTextCallbackData* pData);
 
diff --git a/r5dev/thirdparty/imgui/include/imgui_utility.h b/r5dev/thirdparty/imgui/include/imgui_utility.h
index 5bcfb824..798c2cb0 100644
--- a/r5dev/thirdparty/imgui/include/imgui_utility.h
+++ b/r5dev/thirdparty/imgui/include/imgui_utility.h
@@ -24,6 +24,7 @@ public:
 
     void Load();
     void Save();
+    int InitStyle() const;
 };
 
 extern ImGuiConfig* g_pImGuiConfig;
diff --git a/r5dev/thirdparty/imgui/src/imgui_utility.cpp b/r5dev/thirdparty/imgui/src/imgui_utility.cpp
index 827b1740..362e611c 100644
--- a/r5dev/thirdparty/imgui/src/imgui_utility.cpp
+++ b/r5dev/thirdparty/imgui/src/imgui_utility.cpp
@@ -3,6 +3,7 @@
  *-----------------------------------------------------------------------------*/
 
 #include "core/stdafx.h"
+#include "tier0/commandline.h"
 #include "thirdparty/imgui/include/imgui_utility.h"
 
 int Stricmp(const char* s1, const char* s2)
@@ -99,4 +100,182 @@ void ImGuiConfig::Save()
     outFile.close();          // Close the file handle.
 }
 
+int ImGuiConfig::InitStyle() const
+{
+    int result                            = -1;
+    ImGuiStyle& style                     = ImGui::GetStyle();
+    ImVec4* colors                        = style.Colors;
+
+    if (strcmp(CommandLine()->ParmValue("-imgui_theme", ""), "modern") == 0)
+    {
+        colors[ImGuiCol_Text]                   = ImVec4(0.81f, 0.81f, 0.81f, 1.00f);
+        colors[ImGuiCol_TextDisabled]           = ImVec4(0.56f, 0.56f, 0.56f, 1.00f);
+        colors[ImGuiCol_TextSelectedBg]         = ImVec4(0.12f, 0.37f, 0.75f, 0.50f);
+        colors[ImGuiCol_WindowBg]               = ImVec4(0.13f, 0.15f, 0.18f, 1.00f);
+        colors[ImGuiCol_ChildBg]                = ImVec4(0.00f, 0.00f, 0.00f, 0.78f);
+        colors[ImGuiCol_PopupBg]                = ImVec4(0.11f, 0.13f, 0.17f, 1.00f);
+        colors[ImGuiCol_Border]                 = ImVec4(0.61f, 0.61f, 0.61f, 0.50f);
+        colors[ImGuiCol_BorderShadow]           = ImVec4(0.04f, 0.04f, 0.04f, 0.00f);
+        colors[ImGuiCol_FrameBg]                = ImVec4(0.00f, 0.00f, 0.00f, 0.78f);
+        colors[ImGuiCol_FrameBgHovered]         = ImVec4(0.04f, 0.06f, 0.10f, 1.00f);
+        colors[ImGuiCol_FrameBgActive]          = ImVec4(0.04f, 0.07f, 0.12f, 1.00f);
+        colors[ImGuiCol_TitleBg]                = ImVec4(0.26f, 0.51f, 0.78f, 1.00f);
+        colors[ImGuiCol_TitleBgActive]          = ImVec4(0.26f, 0.51f, 0.78f, 1.00f);
+        colors[ImGuiCol_MenuBarBg]              = ImVec4(0.11f, 0.13f, 0.17f, 1.00f);
+        colors[ImGuiCol_ScrollbarBg]            = ImVec4(0.16f, 0.20f, 0.24f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrab]          = ImVec4(0.23f, 0.36f, 0.51f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrabHovered]   = ImVec4(0.30f, 0.46f, 0.65f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrabActive]    = ImVec4(0.31f, 0.49f, 0.69f, 1.00f);
+        colors[ImGuiCol_SliderGrab]             = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
+        colors[ImGuiCol_SliderGrabActive]       = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
+        colors[ImGuiCol_Button]                 = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
+        colors[ImGuiCol_ButtonHovered]          = ImVec4(0.38f, 0.52f, 0.53f, 1.00f);
+        colors[ImGuiCol_ButtonActive]           = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
+        colors[ImGuiCol_Header]                 = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
+        colors[ImGuiCol_HeaderHovered]          = ImVec4(0.38f, 0.53f, 0.53f, 1.00f);
+        colors[ImGuiCol_HeaderActive]           = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
+        colors[ImGuiCol_Separator]              = ImVec4(0.53f, 0.53f, 0.57f, 0.00f);
+        colors[ImGuiCol_ResizeGrip]             = ImVec4(0.81f, 0.81f, 0.81f, 0.50f);
+        colors[ImGuiCol_Tab]                    = ImVec4(0.31f, 0.43f, 0.43f, 1.00f);
+        colors[ImGuiCol_TabHovered]             = ImVec4(0.38f, 0.53f, 0.53f, 1.00f);
+        colors[ImGuiCol_TabActive]              = ImVec4(0.41f, 0.56f, 0.57f, 1.00f);
+        colors[ImGuiCol_TableHeaderBg]          = ImVec4(0.14f, 0.19f, 0.24f, 1.00f);
+        colors[ImGuiCol_TableBorderStrong]      = ImVec4(0.20f, 0.26f, 0.33f, 1.00f);
+        colors[ImGuiCol_TableBorderLight]       = ImVec4(0.22f, 0.29f, 0.37f, 1.00f);
+
+        style.WindowBorderSize  = 1.0f;
+        style.FrameBorderSize   = 0.0f;
+        style.ChildBorderSize   = 0.0f;
+        style.PopupBorderSize   = 1.0f;
+        style.TabBorderSize     = 1.0f;
+
+        style.WindowRounding    = 4.0f;
+        style.FrameRounding     = 1.0f;
+        style.ChildRounding     = 1.0f;
+        style.PopupRounding     = 3.0f;
+        style.TabRounding       = 1.0f;
+        style.ScrollbarRounding = 3.0f;
+
+        result = 0;
+    }
+    else if (strcmp(CommandLine()->ParmValue("-imgui_theme", ""), "legacy") == 0)
+    {
+        colors[ImGuiCol_Text]                   = ImVec4(0.81f, 0.81f, 0.81f, 1.00f);
+        colors[ImGuiCol_TextDisabled]           = ImVec4(0.56f, 0.56f, 0.56f, 1.00f);
+        colors[ImGuiCol_TextSelectedBg]         = ImVec4(0.12f, 0.37f, 0.75f, 0.50f);
+        colors[ImGuiCol_WindowBg]               = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
+        colors[ImGuiCol_ChildBg]                = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
+        colors[ImGuiCol_PopupBg]                = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
+        colors[ImGuiCol_Border]                 = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
+        colors[ImGuiCol_BorderShadow]           = ImVec4(0.04f, 0.04f, 0.04f, 0.64f);
+        colors[ImGuiCol_FrameBg]                = ImVec4(0.13f, 0.13f, 0.13f, 1.00f);
+        colors[ImGuiCol_FrameBgHovered]         = ImVec4(0.19f, 0.19f, 0.19f, 1.00f);
+        colors[ImGuiCol_FrameBgActive]          = ImVec4(0.24f, 0.24f, 0.24f, 1.00f);
+        colors[ImGuiCol_TitleBg]                = ImVec4(0.22f, 0.22f, 0.22f, 1.00f);
+        colors[ImGuiCol_TitleBgActive]          = ImVec4(0.27f, 0.27f, 0.27f, 1.00f);
+        colors[ImGuiCol_TitleBgCollapsed]       = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
+        colors[ImGuiCol_MenuBarBg]              = ImVec4(0.22f, 0.22f, 0.22f, 1.00f);
+        colors[ImGuiCol_ScrollbarBg]            = ImVec4(0.10f, 0.10f, 0.10f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrab]          = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrabHovered]   = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrabActive]    = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
+        colors[ImGuiCol_CheckMark]              = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
+        colors[ImGuiCol_SliderGrab]             = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
+        colors[ImGuiCol_SliderGrabActive]       = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
+        colors[ImGuiCol_Button]                 = ImVec4(0.35f, 0.35f, 0.35f, 1.00f);
+        colors[ImGuiCol_ButtonHovered]          = ImVec4(0.45f, 0.45f, 0.45f, 1.00f);
+        colors[ImGuiCol_ButtonActive]           = ImVec4(0.52f, 0.52f, 0.52f, 1.00f);
+        colors[ImGuiCol_Header]                 = ImVec4(0.35f, 0.35f, 0.35f, 1.00f);
+        colors[ImGuiCol_HeaderHovered]          = ImVec4(0.45f, 0.45f, 0.45f, 1.00f);
+        colors[ImGuiCol_HeaderActive]           = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
+        colors[ImGuiCol_Separator]              = ImVec4(0.53f, 0.53f, 0.57f, 1.00f);
+        colors[ImGuiCol_SeparatorHovered]       = ImVec4(0.53f, 0.53f, 0.53f, 1.00f);
+        colors[ImGuiCol_SeparatorActive]        = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
+        colors[ImGuiCol_ResizeGrip]             = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
+        colors[ImGuiCol_ResizeGripHovered]      = ImVec4(0.52f, 0.52f, 0.52f, 1.00f);
+        colors[ImGuiCol_ResizeGripActive]       = ImVec4(0.63f, 0.63f, 0.63f, 1.00f);
+        colors[ImGuiCol_Tab]                    = ImVec4(0.18f, 0.18f, 0.18f, 1.00f);
+        colors[ImGuiCol_TabHovered]             = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
+        colors[ImGuiCol_TabActive]              = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
+
+        style.WindowBorderSize  = 0.0f;
+        style.FrameBorderSize   = 1.0f;
+        style.ChildBorderSize   = 1.0f;
+        style.PopupBorderSize   = 1.0f;
+        style.TabBorderSize     = 1.0f;
+
+        style.WindowRounding    = 4.0f;
+        style.FrameRounding     = 1.0f;
+        style.ChildRounding     = 1.0f;
+        style.PopupRounding     = 3.0f;
+        style.TabRounding       = 1.0f;
+        style.ScrollbarRounding = 1.0f;
+
+        result = 1;
+    }
+    else
+    {
+        colors[ImGuiCol_Text]                   = ImVec4(0.81f, 0.81f, 0.81f, 1.00f);
+        colors[ImGuiCol_TextDisabled]           = ImVec4(0.56f, 0.56f, 0.56f, 1.00f);
+        colors[ImGuiCol_TextSelectedBg]         = ImVec4(0.12f, 0.37f, 0.75f, 0.50f);
+        colors[ImGuiCol_WindowBg]               = ImVec4(0.27f, 0.29f, 0.31f, 1.00f);
+        colors[ImGuiCol_ChildBg]                = ImVec4(0.04f, 0.06f, 0.08f, 1.00f);
+        colors[ImGuiCol_PopupBg]                = ImVec4(0.27f, 0.29f, 0.31f, 1.00f);
+        colors[ImGuiCol_Border]                 = ImVec4(0.08f, 0.10f, 0.12f, 1.00f);
+        colors[ImGuiCol_FrameBg]                = ImVec4(0.13f, 0.15f, 0.16f, 1.00f);
+        colors[ImGuiCol_FrameBgHovered]         = ImVec4(0.19f, 0.21f, 0.23f, 1.00f);
+        colors[ImGuiCol_FrameBgActive]          = ImVec4(0.24f, 0.26f, 0.28f, 1.00f);
+        colors[ImGuiCol_TitleBg]                = ImVec4(0.20f, 0.22f, 0.24f, 1.00f);
+        colors[ImGuiCol_TitleBgActive]          = ImVec4(0.22f, 0.24f, 0.26f, 1.00f);
+        colors[ImGuiCol_MenuBarBg]              = ImVec4(0.22f, 0.24f, 0.26f, 1.00f);
+        colors[ImGuiCol_ScrollbarBg]            = ImVec4(0.10f, 0.12f, 0.14f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrab]          = ImVec4(0.41f, 0.43f, 0.45f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrabHovered]   = ImVec4(0.53f, 0.55f, 0.57f, 1.00f);
+        colors[ImGuiCol_ScrollbarGrabActive]    = ImVec4(0.63f, 0.65f, 0.67f, 1.00f);
+        colors[ImGuiCol_CheckMark]              = ImVec4(0.61f, 0.63f, 0.65f, 1.00f);
+        colors[ImGuiCol_SliderGrab]             = ImVec4(0.41f, 0.43f, 0.45f, 1.00f);
+        colors[ImGuiCol_SliderGrabActive]       = ImVec4(0.53f, 0.55f, 0.57f, 1.00f);
+        colors[ImGuiCol_Button]                 = ImVec4(0.35f, 0.37f, 0.39f, 1.00f);
+        colors[ImGuiCol_ButtonHovered]          = ImVec4(0.45f, 0.47f, 0.49f, 1.00f);
+        colors[ImGuiCol_ButtonActive]           = ImVec4(0.52f, 0.54f, 0.56f, 1.00f);
+        colors[ImGuiCol_Header]                 = ImVec4(0.35f, 0.37f, 0.39f, 1.00f);
+        colors[ImGuiCol_HeaderHovered]          = ImVec4(0.45f, 0.47f, 0.49f, 1.00f);
+        colors[ImGuiCol_HeaderActive]           = ImVec4(0.53f, 0.55f, 0.57f, 1.00f);
+        colors[ImGuiCol_Separator]              = ImVec4(0.08f, 0.10f, 0.12f, 1.00f);
+        colors[ImGuiCol_SeparatorHovered]       = ImVec4(0.53f, 0.55f, 0.57f, 1.00f);
+        colors[ImGuiCol_SeparatorActive]        = ImVec4(0.63f, 0.65f, 0.67f, 1.00f);
+        colors[ImGuiCol_ResizeGrip]             = ImVec4(0.41f, 0.43f, 0.45f, 1.00f);
+        colors[ImGuiCol_ResizeGripHovered]      = ImVec4(0.52f, 0.54f, 0.56f, 1.00f);
+        colors[ImGuiCol_ResizeGripActive]       = ImVec4(0.63f, 0.65f, 0.67f, 1.00f);
+        colors[ImGuiCol_Tab]                    = ImVec4(0.18f, 0.20f, 0.22f, 1.00f);
+        colors[ImGuiCol_TabHovered]             = ImVec4(0.39f, 0.41f, 0.43f, 1.00f);
+        colors[ImGuiCol_TabActive]              = ImVec4(0.39f, 0.41f, 0.43f, 1.00f);
+        colors[ImGuiCol_TableHeaderBg]          = ImVec4(0.19f, 0.21f, 0.23f, 1.00f);
+        colors[ImGuiCol_TableBorderStrong]      = ImVec4(0.31f, 0.33f, 0.35f, 1.00f);
+        colors[ImGuiCol_TableBorderLight]       = ImVec4(0.23f, 0.25f, 0.27f, 1.00f);
+
+        style.WindowBorderSize  = 1.0f;
+        style.FrameBorderSize   = 1.0f;
+        style.ChildBorderSize   = 1.0f;
+        style.PopupBorderSize   = 1.0f;
+        style.TabBorderSize     = 1.0f;
+
+        style.WindowRounding    = 4.0f;
+        style.FrameRounding     = 1.0f;
+        style.ChildRounding     = 2.0f;
+        style.PopupRounding     = 3.0f;
+        style.TabRounding       = 1.0f;
+        style.ScrollbarRounding = 1.0f;
+
+        result = 2;
+    }
+
+    style.ItemSpacing       = ImVec2(4, 4);
+    style.FramePadding      = ImVec2(4, 4);
+    style.WindowPadding     = ImVec2(5, 5);
+    style.WindowMinSize = ImVec2(750, 510);
+
+    return result;
+}
+
 ImGuiConfig* g_pImGuiConfig = new ImGuiConfig();