mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
GameUI: only log to ImGui console if ImguiSystem is initialized
If disabled, there is no point in logging to the imgui console, so save on memory and avoid locking a mutex.
This commit is contained in:
parent
e2b931d6d8
commit
0dde788aa7
@ -22,6 +22,7 @@ History:
|
||||
#include "windows/resource.h"
|
||||
#include "engine/cmd.h"
|
||||
#include "gameui/IConsole.h"
|
||||
#include "imgui_system.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Console variables
|
||||
@ -1082,6 +1083,9 @@ int CConsole::TextEditCallbackStub(ImGuiInputTextCallbackData* iData)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CConsole::AddLog(const char* const text, const ImU32 color)
|
||||
{
|
||||
if (!ImguiSystem()->IsInitialized())
|
||||
return;
|
||||
|
||||
AUTO_LOCK(m_colorTextLoggerMutex);
|
||||
|
||||
m_colorTextLogger.InsertText(text, color);
|
||||
|
Loading…
x
Reference in New Issue
Block a user