diff --git a/r5dev/engine/sys_utils.cpp b/r5dev/engine/sys_utils.cpp index 0374b9ec..d0ccc9d7 100644 --- a/r5dev/engine/sys_utils.cpp +++ b/r5dev/engine/sys_utils.cpp @@ -47,7 +47,7 @@ void* HSys_Warning(int level, char* fmt, ...) buf[sizeof(buf) - 1] = 0; va_end(args); - DevMsg(eDLL_T::NONE, "Warning(%d)%s\n", level, buf); // TODO: Color + DevMsg(eDLL_T::NONE, "Warning(%d):%s\n", level, buf); // TODO: Color return Sys_Warning(level, buf); } diff --git a/r5dev/gameui/IBrowser.cpp b/r5dev/gameui/IBrowser.cpp index a81b5d26..11d26f6c 100644 --- a/r5dev/gameui/IBrowser.cpp +++ b/r5dev/gameui/IBrowser.cpp @@ -764,7 +764,7 @@ void IBrowser::SetStyleVar() style.TabBorderSize = 1.0f; style.WindowRounding = 2.5f; - style.FrameRounding = 0.0f; + style.FrameRounding = 1.0f; style.ChildRounding = 0.0f; style.PopupRounding = 0.0f; style.TabRounding = 1.0f; diff --git a/r5dev/gameui/IConsole.cpp b/r5dev/gameui/IConsole.cpp index d994592f..26935c49 100644 --- a/r5dev/gameui/IConsole.cpp +++ b/r5dev/gameui/IConsole.cpp @@ -59,7 +59,11 @@ void CConsole::Draw(const char* pszTitle, bool* bDraw) m_bInitialized = true; m_pszConsoleTitle = pszTitle; } - //ImGui::ShowStyleEditor(); + + { + //ImGui::ShowStyleEditor(); + //ImGui::ShowDemoWindow(); + } { // BASEPANEL SETUP. if (!*bDraw) @@ -67,16 +71,28 @@ void CConsole::Draw(const char* pszTitle, bool* bDraw) m_bActivate = false; return; } + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 4.f, 6.f }); + ImGui::SetNextWindowSize(ImVec2(1000, 600), ImGuiCond_FirstUseEver); ImGui::SetWindowPos(ImVec2(-1000, 50), ImGuiCond_FirstUseEver); BasePanel(bDraw); + + ImGui::PopStyleVar(1); } { // SUGGESTION PANEL SETUP if (CanAutoComplete()) { + ImGui::SetNextWindowPos(m_vecSuggestWindowPos); + ImGui::SetNextWindowSize(m_vecSuggestWindowSize); + + ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 1.0f); + ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(500, 37)); + SuggestPanel(); + + ImGui::PopStyleVar(2); } } } @@ -132,7 +148,6 @@ void CConsole::BasePanel(bool* bDraw) /////////////////////////////////////////////////////////////////////// ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), true, ImGuiWindowFlags_AlwaysVerticalScrollbar); - ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 4.f, 6.f }); if (m_bCopyToClipBoard) { ImGui::LogToClipboard(); } ColorLog(); @@ -151,7 +166,6 @@ void CConsole::BasePanel(bool* bDraw) } /////////////////////////////////////////////////////////////////////// - ImGui::PopStyleVar(1); ImGui::EndChild(); ImGui::Separator(); @@ -196,7 +210,7 @@ void CConsole::BasePanel(bool* bDraw) m_vecSuggestWindowPos = ImGui::GetItemRectMin(); m_vecSuggestWindowPos.y += ImGui::GetItemRectSize().y; - m_vecSuggestWindowSize = ImVec2(500, std::clamp((int)m_vsvSuggest.size() * 20, 0, 123)); + m_vecSuggestWindowSize = ImVec2(500, std::clamp((int)m_vsvSuggest.size() * 18, 37, 122)); ImGui::SameLine(); if (ImGui::Button("Submit")) @@ -265,12 +279,6 @@ void CConsole::OptionsPanel(void) //----------------------------------------------------------------------------- void CConsole::SuggestPanel(void) { - ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 1.0f); - ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(0.0f, 0.0f)); - - ImGui::SetNextWindowPos(m_vecSuggestWindowPos); - ImGui::SetNextWindowSize(m_vecSuggestWindowSize); - ImGui::Begin("##suggest", nullptr, popup_window_flags); ImGui::PushAllowKeyboardFocus(false); @@ -309,7 +317,6 @@ void CConsole::SuggestPanel(void) ImGui::PopAllowKeyboardFocus(); ImGui::End(); - ImGui::PopStyleVar(2); } //----------------------------------------------------------------------------- @@ -372,6 +379,16 @@ void CConsole::FindFromPartial(void) svValue = "= \""; // Assign default value to string if its a ConVar. svValue.append(g_pCVar->FindVar(g_vsvAllConVars[i].c_str())->GetString()); svValue.append("\""); + + if (con_suggestion_helptext->GetBool()) + { + std::string svHelpText = g_pCVar->FindVar(g_vsvAllConVars[i].c_str())->GetHelpText(); + + if (!svHelpText.empty()) + { + svValue.append(" [" + svHelpText + "]"); + } + } } m_vsvSuggest.push_back(g_vsvAllConVars[i] + " " + svValue + ""); @@ -698,7 +715,7 @@ void CConsole::SetStyleVar(void) style.TabBorderSize = 1.0f; style.WindowRounding = 2.5f; - style.FrameRounding = 0.0f; + style.FrameRounding = 1.0f; style.ChildRounding = 0.0f; style.PopupRounding = 0.0f; style.TabRounding = 1.0f; @@ -706,7 +723,7 @@ void CConsole::SetStyleVar(void) style.ItemSpacing = ImVec2(4, 4); style.WindowPadding = ImVec2(5, 5); - style.WindowMinSize = ImVec2(510, 510); + style.WindowMinSize = ImVec2(518, 518); } CConsole* g_pIConsole = new CConsole(); diff --git a/r5dev/gameui/IConsole.h b/r5dev/gameui/IConsole.h index 44f73cf0..ef50f9b6 100644 --- a/r5dev/gameui/IConsole.h +++ b/r5dev/gameui/IConsole.h @@ -34,13 +34,14 @@ private: ImGuiInputTextFlags_EnterReturnsTrue; ImGuiWindowFlags popup_window_flags = - ImGuiWindowFlags_HorizontalScrollbar | - ImGuiWindowFlags_NoMove | - /*ImGuiWindowFlags_NoResize |*/ - ImGuiWindowFlags_NoTitleBar | - ImGuiWindowFlags_NoSavedSettings | - ImGuiWindowFlags_NoFocusOnAppearing | - ImGuiWindowFlags_NoBringToFrontOnFocus; + ImGuiWindowFlags_NoMove | + /*ImGuiWindowFlags_NoResize |*/ + ImGuiWindowFlags_NoTitleBar | + ImGuiWindowFlags_NoSavedSettings | + ImGuiWindowFlags_NoFocusOnAppearing | + ImGuiWindowFlags_NoBringToFrontOnFocus | + ImGuiWindowFlags_AlwaysVerticalScrollbar | + ImGuiWindowFlags_AlwaysHorizontalScrollbar; public: bool m_bActivate = false; diff --git a/r5dev/tier0/IConVar.cpp b/r5dev/tier0/IConVar.cpp index 73732f0a..f056f39b 100644 --- a/r5dev/tier0/IConVar.cpp +++ b/r5dev/tier0/IConVar.cpp @@ -76,7 +76,8 @@ void ConVar::Init(void) cl_gpustats_offset_x = new ConVar("cl_gpustats_offset_x", "1250", FCVAR_DEVELOPMENTONLY, "X offset for texture streaming debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr); cl_gpustats_offset_y = new ConVar("cl_gpustats_offset_y", "900", FCVAR_DEVELOPMENTONLY, "Y offset for texture streaming debug overlay.", false, 0.f, false, 0.f, nullptr, nullptr); - con_suggestion_limit = new ConVar("con_suggestion_limit", "40", FCVAR_DEVELOPMENTONLY, "Maximum number of suggestions the autocomplete window will show for the console.", false, 0.f, false, 0.f, nullptr, nullptr); + con_suggestion_limit = new ConVar("con_suggestion_limit", "40", FCVAR_DEVELOPMENTONLY, "Maximum number of suggestions the autocomplete window will show for the console.", false, 0.f, false, 0.f, nullptr, nullptr); + con_suggestion_helptext = new ConVar("con_suggestion_helptext", "0", FCVAR_DEVELOPMENTONLY, "Show ConVar help text in autocomplete window. Disabled by default to keep window less populated.", false, 0.f, false, 0.f, nullptr, nullptr); //------------------------------------------------------------------------- // FILESYSTEM | fs_warning_level_native = new ConVar("fs_warning_level_native", "0", FCVAR_DEVELOPMENTONLY, "Set the filesystem warning level.", false, 0.f, false, 0.f, nullptr, nullptr); diff --git a/r5dev/tier0/cvar.cpp b/r5dev/tier0/cvar.cpp index dce9c643..83e7a3d9 100644 --- a/r5dev/tier0/cvar.cpp +++ b/r5dev/tier0/cvar.cpp @@ -33,6 +33,7 @@ ConVar* cl_gpustats_offset_x = new ConVar(); ConVar* cl_gpustats_offset_y = new ConVar(); ConVar* con_suggestion_limit = new ConVar(); +ConVar* con_suggestion_helptext = new ConVar(); //----------------------------------------------------------------------------- // FILESYSTEM | ConVar* fs_warning_level_native = new ConVar(); diff --git a/r5dev/tier0/cvar.h b/r5dev/tier0/cvar.h index c11e7e9d..cd0f409d 100644 --- a/r5dev/tier0/cvar.h +++ b/r5dev/tier0/cvar.h @@ -45,6 +45,7 @@ extern ConVar* cl_gpustats_offset_x; extern ConVar* cl_gpustats_offset_y; extern ConVar* con_suggestion_limit; +extern ConVar* con_suggestion_helptext; //------------------------------------------------------------------------- // FILESYSTEM | extern ConVar* fs_warning_level_native;