2021-08-06 18:12:07 -07:00
|
|
|
#pragma once
|
2021-12-25 22:36:38 +01:00
|
|
|
#ifndef DEDICATED
|
|
|
|
class CConsole
|
2021-08-06 18:12:07 -07:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
2022-01-12 02:53:07 +01:00
|
|
|
char m_szInputBuf[512] = { 0 };
|
2021-12-25 22:36:38 +01:00
|
|
|
ImVector<const char*> m_ivCommands;
|
|
|
|
ImVector<char*> m_ivHistory;
|
2022-01-12 02:53:07 +01:00
|
|
|
int m_nHistoryPos = -1;
|
2021-12-25 22:36:38 +01:00
|
|
|
ImGuiTextFilter m_itFilter;
|
2022-01-12 02:53:07 +01:00
|
|
|
bool m_bAutoScroll = true;
|
|
|
|
bool m_bScrollToBottom = false;
|
|
|
|
bool m_bCopyToClipBoard = false;
|
|
|
|
bool m_bReclaimFocus = false;
|
|
|
|
bool m_bInitialized = false;
|
2021-08-06 18:12:07 -07:00
|
|
|
|
|
|
|
public:
|
2022-01-12 02:53:07 +01:00
|
|
|
bool m_bActivate = false;
|
|
|
|
ImVector<char*> m_ivConLog;
|
2021-08-06 18:12:07 -07:00
|
|
|
|
2022-01-12 02:53:07 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////
|
2021-12-25 22:36:38 +01:00
|
|
|
CConsole();
|
|
|
|
~CConsole();
|
2021-08-06 18:12:07 -07:00
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
void Draw(const char* title, bool* bDraw);
|
2022-01-12 02:53:07 +01:00
|
|
|
void Options();
|
2022-01-16 00:59:20 +01:00
|
|
|
void Think();
|
2022-01-12 02:53:07 +01:00
|
|
|
|
2021-08-06 18:12:07 -07:00
|
|
|
void ProcessCommand(const char* command_line);
|
|
|
|
int TextEditCallback(ImGuiInputTextCallbackData* data);
|
2022-01-12 02:53:07 +01:00
|
|
|
static int TextEditCallbackStub(ImGuiInputTextCallbackData* data);
|
2021-08-06 18:12:07 -07:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
2022-01-12 02:53:07 +01:00
|
|
|
void AddLog(const char* fmt, ...) IM_FMTARGS(2);
|
|
|
|
void ClearLog();
|
|
|
|
void ColorLog();
|
2021-08-06 18:12:07 -07:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
2022-01-12 02:53:07 +01:00
|
|
|
void SetStyleVar();
|
2021-08-06 18:12:07 -07:00
|
|
|
};
|
|
|
|
|
2022-01-12 02:53:07 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
extern CConsole* g_pIConsole;
|
2021-12-25 22:36:38 +01:00
|
|
|
#endif // !DEDICATED
|