mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
ImGui panel improvements
* Eliminated all forms of concurrency for CConsole logger. * Used enum for determining which theme user loaded (DEFAULT, LEGACY, MODERN). * Fixed issue where browser panel doesn't have the same frame padding as the console for the modern theme. * Fixed issue where the history items count shows number higher than maximum until updated (updates vector before displaying, else this happens in g_pConsole->RunTask which is the operation that happens before we add new elements to the vector, thus showing the wrong count as this size is getting corrected the next frame after we painted, we don't update the summary each frame for performance reasons).
This commit is contained in:
parent
8476d22777
commit
3414a2cd2c
@ -102,10 +102,19 @@ void CBrowser::RunFrame(void)
|
||||
}
|
||||
|
||||
int nVars = 0;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha); nVars++;
|
||||
if (m_Style == ImGuiStyle_t::MODERN)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 8.f, 10.f }); nVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha); nVars++;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 6.f, 6.f }); nVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha); nVars++;
|
||||
}
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(910, 524)); nVars++;
|
||||
|
||||
if (!m_bModernTheme)
|
||||
if (m_Style != ImGuiStyle_t::MODERN)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 1.0f); nVars++;
|
||||
}
|
||||
@ -193,13 +202,13 @@ void CBrowser::BrowserPanel(void)
|
||||
if (ImGui::BeginTable("##ServerBrowser_ServerListTable", 6, ImGuiTableFlags_Resizable))
|
||||
{
|
||||
int nVars = 0;
|
||||
if (m_bModernTheme)
|
||||
if (m_Style == ImGuiStyle_t::MODERN)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2{ 8.f, 0.f }); nVars++;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.f, 0.f)); nVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2{ 4.f, 0.f }); nVars++;
|
||||
}
|
||||
|
||||
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthStretch, 25);
|
||||
@ -655,11 +664,7 @@ void CBrowser::SettingsPanel(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBrowser::SetStyleVar(void)
|
||||
{
|
||||
int nStyle = g_pImGuiConfig->InitStyle();
|
||||
|
||||
m_bModernTheme = nStyle == 0;
|
||||
m_bLegacyTheme = nStyle == 1;
|
||||
m_bDefaultTheme = nStyle == 2;
|
||||
m_Style = g_pImGuiConfig->InitStyle();
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(910, 524), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetWindowPos(ImVec2(-500, 50), ImGuiCond_FirstUseEver);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "networksystem/serverlisting.h"
|
||||
#include "networksystem/pylon.h"
|
||||
#include "public/isurfacesystem.h"
|
||||
#include "thirdparty/imgui/include/imgui_utility.h"
|
||||
|
||||
class CBrowser : public ISurface
|
||||
{
|
||||
@ -39,13 +40,11 @@ public:
|
||||
bool m_bActivate = false;
|
||||
private:
|
||||
bool m_bInitialized = false;
|
||||
bool m_bModernTheme = false;
|
||||
bool m_bLegacyTheme = false;
|
||||
bool m_bDefaultTheme = false;
|
||||
char m_szServerAddressBuffer[256] = { '\0' };
|
||||
char m_szServerEncKeyBuffer[30] = { '\0' };
|
||||
float m_flFadeAlpha = 0.f;
|
||||
|
||||
ImGuiStyle_t m_Style = ImGuiStyle_t::NONE;
|
||||
ID3D11ShaderResourceView* m_idLockedIcon = nullptr;
|
||||
MODULERESOURCE m_rLockedIconBlob;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/******************************************************************************
|
||||
/******************************************************************************
|
||||
-------------------------------------------------------------------------------
|
||||
File : IConsole.cpp
|
||||
Date : 18:07:2021
|
||||
@ -88,7 +88,7 @@ void CConsole::RunFrame(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_bModernTheme)
|
||||
if (m_Style == ImGuiStyle_t::MODERN)
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 8.f, 10.f }); nVars++;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_flFadeAlpha); nVars++;
|
||||
@ -111,7 +111,7 @@ void CConsole::RunFrame(void)
|
||||
int nVars = 0;
|
||||
if (AutoComplete())
|
||||
{
|
||||
if (m_bModernTheme)
|
||||
if (m_Style == ImGuiStyle_t::MODERN)
|
||||
{
|
||||
static const ImGuiStyle& style = ImGui::GetStyle();
|
||||
m_ivSuggestWindowPos.y = m_ivSuggestWindowPos.y + style.WindowPadding.y + 1.5f;
|
||||
@ -142,23 +142,8 @@ void CConsole::RunFrame(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CConsole::RunTask()
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
if (m_Logger.GetTotalLines() > con_max_size_logvector->GetInt())
|
||||
{
|
||||
while (m_Logger.GetTotalLines() > con_max_size_logvector->GetInt())
|
||||
{
|
||||
m_Logger.RemoveLine(0);
|
||||
m_nScrollBack++;
|
||||
m_nSelectBack++;
|
||||
}
|
||||
m_Logger.MoveSelection(m_nSelectBack, false);
|
||||
m_Logger.MoveCursor(m_nSelectBack, false);
|
||||
m_nSelectBack = 0;
|
||||
}
|
||||
while (m_vHistory.size() > 512)
|
||||
{
|
||||
m_vHistory.erase(m_vHistory.begin());
|
||||
}
|
||||
ClampLogSize();
|
||||
ClampHistorySize();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -196,8 +181,6 @@ void CConsole::DrawSurface(void)
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
|
||||
// Reserve enough left-over height and width for 1 separator + 1 input text
|
||||
const float flFooterHeightReserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing();
|
||||
const float flFooterWidthReserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetWindowWidth();
|
||||
@ -235,6 +218,8 @@ void CConsole::DrawSurface(void)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
ImGui::BeginChild(m_pszLoggingLabel, ImVec2(0, -flFooterHeightReserve), true, m_nLoggingFlags);
|
||||
|
||||
m_Mutex.lock();
|
||||
m_Logger.Render();
|
||||
|
||||
if (m_bCopyToClipBoard)
|
||||
@ -242,6 +227,7 @@ void CConsole::DrawSurface(void)
|
||||
m_Logger.Copy(true);
|
||||
m_bCopyToClipBoard = false;
|
||||
}
|
||||
m_Mutex.unlock();
|
||||
|
||||
m_flScrollX = ImGui::GetScrollX();
|
||||
m_flScrollY = ImGui::GetScrollY();
|
||||
@ -618,15 +604,49 @@ void CConsole::BuildSummary(string svConVar)
|
||||
else
|
||||
{
|
||||
// Display amount of history items if ConVar cannot be found.
|
||||
ClampHistorySize();
|
||||
snprintf(m_szSummary, sizeof(m_szSummary), "%zu history items", m_vHistory.size());
|
||||
}
|
||||
}
|
||||
else // Default or empty param.
|
||||
{
|
||||
ClampHistorySize();
|
||||
snprintf(m_szSummary, sizeof(m_szSummary), "%zu history items", m_vHistory.size());
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: clamps the size of the log vector
|
||||
//-----------------------------------------------------------------------------
|
||||
void CConsole::ClampLogSize(void)
|
||||
{
|
||||
m_Mutex.lock();
|
||||
if (m_Logger.GetTotalLines() > con_max_size_logvector->GetInt())
|
||||
{
|
||||
while (m_Logger.GetTotalLines() > con_max_size_logvector->GetInt())
|
||||
{
|
||||
m_Logger.RemoveLine(0);
|
||||
m_nScrollBack++;
|
||||
m_nSelectBack++;
|
||||
}
|
||||
m_Logger.MoveSelection(m_nSelectBack, false);
|
||||
m_Logger.MoveCursor(m_nSelectBack, false);
|
||||
m_nSelectBack = 0;
|
||||
}
|
||||
m_Mutex.unlock();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: clamps the size of the history vector
|
||||
//-----------------------------------------------------------------------------
|
||||
void CConsole::ClampHistorySize(void)
|
||||
{
|
||||
while (m_vHistory.size() > con_max_size_history->GetSizeT())
|
||||
{
|
||||
m_vHistory.erase(m_vHistory.begin());
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: loads flag images from resource section (must be aligned with resource.h!)
|
||||
// Output : true on success, false on failure
|
||||
@ -822,13 +842,7 @@ int CConsole::TextEditCallbackStub(ImGuiInputTextCallbackData* iData)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CConsole::AddLog(const ConLog_t& conLog)
|
||||
{
|
||||
if (!ThreadInRenderThread())
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
m_Logger.InsertText(conLog);
|
||||
|
||||
return;
|
||||
}
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
m_Logger.InsertText(conLog);
|
||||
}
|
||||
|
||||
@ -846,6 +860,7 @@ void CConsole::AddLog(const ImVec4& color, const char* fmt, ...) IM_FMTARGS(2)
|
||||
buf[IM_ARRAYSIZE(buf) - 1] = 0;
|
||||
va_end(args);
|
||||
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
m_Logger.InsertText(ConLog_t(Strdup(buf), color));
|
||||
}
|
||||
|
||||
@ -854,6 +869,7 @@ void CConsole::AddLog(const ImVec4& color, const char* fmt, ...) IM_FMTARGS(2)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CConsole::ClearLog(void)
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
m_Logger.RemoveLine(0, (m_Logger.GetTotalLines() - 1));
|
||||
}
|
||||
|
||||
@ -862,11 +878,7 @@ void CConsole::ClearLog(void)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CConsole::SetStyleVar(void)
|
||||
{
|
||||
int nStyle = g_pImGuiConfig->InitStyle();
|
||||
|
||||
m_bModernTheme = nStyle == 0;
|
||||
m_bLegacyTheme = nStyle == 1;
|
||||
m_bDefaultTheme = nStyle == 2;
|
||||
m_Style = g_pImGuiConfig->InitStyle();
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(1200, 524), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetWindowPos(ImVec2(-1000, 50), ImGuiCond_FirstUseEver);
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "windows/resource.h"
|
||||
#include "public/isurfacesystem.h"
|
||||
#include "thirdparty/imgui/include/imgui_logger.h"
|
||||
#include "thirdparty/imgui/include/imgui_utility.h"
|
||||
|
||||
class CConsole : public ISurface
|
||||
{
|
||||
@ -32,6 +33,9 @@ private:
|
||||
void ProcessCommand(const char* pszCommand);
|
||||
void BuildSummary(string svConVar = "");
|
||||
|
||||
void ClampLogSize(void);
|
||||
void ClampHistorySize(void);
|
||||
|
||||
bool LoadFlagIcons(void);
|
||||
int ColorCodeFlags(int nFlags) const;
|
||||
|
||||
@ -66,10 +70,6 @@ private:
|
||||
float m_flScrollY = 0.f;
|
||||
float m_flFadeAlpha = 0.f;
|
||||
|
||||
bool m_bModernTheme = false;
|
||||
bool m_bLegacyTheme = false;
|
||||
bool m_bDefaultTheme = false;
|
||||
|
||||
bool m_bInitialized = false;
|
||||
bool m_bReclaimFocus = false;
|
||||
bool m_bCopyToClipBoard = false;
|
||||
@ -82,6 +82,7 @@ private:
|
||||
vector<CSuggest> m_vSuggest;
|
||||
vector<MODULERESOURCE> m_vFlagIcons;
|
||||
|
||||
ImGuiStyle_t m_Style = ImGuiStyle_t::NONE;
|
||||
ImVec2 m_ivSuggestWindowPos;
|
||||
ImVec2 m_ivSuggestWindowSize;
|
||||
CTextLogger m_Logger;
|
||||
|
10
r5dev/thirdparty/imgui/include/imgui_utility.h
vendored
10
r5dev/thirdparty/imgui/include/imgui_utility.h
vendored
@ -7,6 +7,14 @@ int Strnicmp(const char* s1, const char* s2, int n);
|
||||
char* Strdup(const char* s);
|
||||
void Strtrim(char* s);
|
||||
|
||||
enum class ImGuiStyle_t
|
||||
{
|
||||
NONE = -1,
|
||||
DEFAULT,
|
||||
LEGACY,
|
||||
MODERN
|
||||
};
|
||||
|
||||
class ImGuiConfig
|
||||
{
|
||||
public:
|
||||
@ -24,7 +32,7 @@ public:
|
||||
|
||||
void Load();
|
||||
void Save();
|
||||
int InitStyle() const;
|
||||
ImGuiStyle_t InitStyle() const;
|
||||
};
|
||||
|
||||
extern ImGuiConfig* g_pImGuiConfig;
|
||||
|
118
r5dev/thirdparty/imgui/src/imgui_utility.cpp
vendored
118
r5dev/thirdparty/imgui/src/imgui_utility.cpp
vendored
@ -100,65 +100,13 @@ void ImGuiConfig::Save()
|
||||
outFile.close(); // Close the file handle.
|
||||
}
|
||||
|
||||
int ImGuiConfig::InitStyle() const
|
||||
ImGuiStyle_t ImGuiConfig::InitStyle() const
|
||||
{
|
||||
int result = -1;
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
ImVec4* colors = style.Colors;
|
||||
ImGuiStyle_t result = ImGuiStyle_t::NONE;
|
||||
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)
|
||||
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);
|
||||
@ -211,7 +159,59 @@ int ImGuiConfig::InitStyle() const
|
||||
style.TabRounding = 1.0f;
|
||||
style.ScrollbarRounding = 1.0f;
|
||||
|
||||
result = 1;
|
||||
result = ImGuiStyle_t::LEGACY;
|
||||
}
|
||||
else 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 = ImGuiStyle_t::MODERN;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -268,7 +268,7 @@ int ImGuiConfig::InitStyle() const
|
||||
style.GrabRounding = 1.0f;
|
||||
style.ScrollbarRounding = 1.0f;
|
||||
|
||||
result = 2;
|
||||
result = ImGuiStyle_t::DEFAULT;
|
||||
}
|
||||
|
||||
style.ItemSpacing = ImVec2(5, 4);
|
||||
|
@ -168,8 +168,9 @@ void ConVar::Init(void) const
|
||||
cl_materialinfo_offset_x = ConVar::Create("cl_materialinfo_offset_x", "0" , FCVAR_DEVELOPMENTONLY, "X offset for material debug info overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
cl_materialinfo_offset_y = ConVar::Create("cl_materialinfo_offset_y", "420", FCVAR_DEVELOPMENTONLY, "Y offset for material debug info overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
|
||||
con_max_size_logvector = ConVar::Create("con_max_size_logvector" , "1000", FCVAR_DEVELOPMENTONLY, "Maximum number of logs in the console until cleanup starts.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
con_suggestion_limit = ConVar::Create("con_suggestion_limit" , "120" , FCVAR_DEVELOPMENTONLY, "Maximum number of suggestions the autocomplete window will show for the console.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
con_max_size_logvector = ConVar::Create("con_max_size_logvector" , "1024", FCVAR_DEVELOPMENTONLY, "Maximum number of logs in the console before cleanup starts.", true, 0.f, false, 0.f, nullptr, nullptr);
|
||||
con_max_size_history = ConVar::Create("con_max_size_history" , "512" , FCVAR_DEVELOPMENTONLY, "Maximum number of command history items before cleanup starts.", true, 0.f, false, 0.f, nullptr, nullptr);
|
||||
con_suggestion_limit = ConVar::Create("con_suggestion_limit" , "128" , FCVAR_DEVELOPMENTONLY, "Maximum number of suggestions the autocomplete window will show for the console.", true, 0.f, false, 0.f, nullptr, nullptr);
|
||||
con_suggestion_showhelptext = ConVar::Create("con_suggestion_showhelptext" , "1" , FCVAR_DEVELOPMENTONLY, "Show CommandBase help text in autocomplete window.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
con_suggestion_showflags = ConVar::Create("con_suggestion_showflags" , "1" , FCVAR_DEVELOPMENTONLY, "Show CommandBase flags in autocomplete window.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
con_suggestion_flags_realtime = ConVar::Create("con_suggestion_flags_realtime" , "0" , FCVAR_DEVELOPMENTONLY, "Whether to show compile-time or run-time CommandBase flags.", false, 0.f, false, 0.f, nullptr, nullptr);
|
||||
|
@ -134,6 +134,7 @@ ConVar* cl_materialinfo_offset_y = nullptr;
|
||||
ConVar* cl_threaded_bone_setup = nullptr;
|
||||
|
||||
ConVar* con_max_size_logvector = nullptr;
|
||||
ConVar* con_max_size_history = nullptr;
|
||||
ConVar* con_suggestion_limit = nullptr;
|
||||
ConVar* con_suggestion_showhelptext = nullptr;
|
||||
ConVar* con_suggestion_showflags = nullptr;
|
||||
|
@ -129,6 +129,7 @@ extern ConVar* cl_materialinfo_offset_y;
|
||||
extern ConVar* cl_threaded_bone_setup;
|
||||
|
||||
extern ConVar* con_max_size_logvector;
|
||||
extern ConVar* con_max_size_history;
|
||||
extern ConVar* con_suggestion_limit;
|
||||
extern ConVar* con_suggestion_showhelptext;
|
||||
extern ConVar* con_suggestion_showflags;
|
||||
|
Loading…
x
Reference in New Issue
Block a user