r5sdk/r5dev/gameui/IConsole.h
Amos de3b3f53bd Optimizations + QoL improvements/cleanup
* IConsole overlay now clears the oldest log entries to stay under the vector limit instead of clearing the whole vector.
* IConsole code cleanup.
* IBrowser code cleanup, reordered class methods.
* Use ConVar utilities to get/set values for strings in IBrowser and IConsole.
* New ConVar's for RUI console overlay to tweak colors.
2022-01-12 02:56:17 +01:00

45 lines
1.5 KiB
C++

#pragma once
#ifndef DEDICATED
class CConsole
{
private:
///////////////////////////////////////////////////////////////////////////
char m_szInputBuf[512] = { 0 };
ImVector<const char*> m_ivCommands;
ImVector<char*> m_ivHistory;
int m_nHistoryPos = -1;
ImGuiTextFilter m_itFilter;
bool m_bAutoScroll = true;
bool m_bScrollToBottom = false;
bool m_bCopyToClipBoard = false;
bool m_bReclaimFocus = false;
bool m_bInitialized = false;
public:
bool m_bActivate = false;
ImVector<char*> m_ivConLog;
///////////////////////////////////////////////////////////////////////////
CConsole();
~CConsole();
void Draw(const char* title, bool* bDraw);
void Options();
void ProcessCommand(const char* command_line);
int TextEditCallback(ImGuiInputTextCallbackData* data);
static int TextEditCallbackStub(ImGuiInputTextCallbackData* data);
///////////////////////////////////////////////////////////////////////////
void AddLog(const char* fmt, ...) IM_FMTARGS(2);
void ClearLog();
void ColorLog();
///////////////////////////////////////////////////////////////////////////
void SetStyleVar();
};
///////////////////////////////////////////////////////////////////////////////
extern CConsole* g_pIConsole;
#endif // !DEDICATED