26 std::string completion;
31 if (completion.size() > 0) {
78 static bool scrollToBottom =
false;
81 scrollToBottom =
true;
84 static bool visibleLogs[
LOG_COUNT] = {
true,
true,
true,
true,
true };
95 static bool logToTTY =
false, logToClipboard =
false, logToFile =
false;
98 if (
ImGui::Button(
"Log to Clipboard")) { logToClipboard =
true; }
106 else if (logToClipboard)
110 for (
unsigned long i = 0; i <
Log::size(); i++) {
114 if (!visibleLogs[entry.level]) {
118 ImVec4 col(1.0f, 1.0f, 1.0f, 1.0f);
120 col =
ImVec4(1.0f, 0.0f, 0.0f, 1.0f);
122 col =
ImVec4(1.0f, 1.0f, 0.0f, 1.0f);
124 col =
ImVec4(0.0f, 1.0f, 0.0f, 1.0f);
125 }
else if (entry.level ==
LOG_USER) {
126 col =
ImVec4(0.5f, 0.75f, 1.0f, 1.0f);
133 if (logToTTY || logToClipboard || logToFile) {
135 logToTTY = logToClipboard = logToFile =
false;
137 if (scrollToBottom) {
139 scrollToBottom =
false;
143 bool focusInput =
false;
162 scrollToBottom =
true;
static LogEntry & getEntry(unsigned long i)
static long lastCommandIndex
static unsigned long lastLogLength
static int callback(ImGuiTextEditCallbackData *data)
IMGUI_API bool Checkbox(const char *label, bool *v)
static std::string bufferedCommand
static const int bufferLength
static std::string autoComplete(std::string begin)
IMGUI_API void PopStyleColor(int count=1)
static std::vector< std::string > lastCommands
IMGUI_API void LogToTTY(int max_depth=-1)
IMGUI_API void TextWrapped(const char *fmt,...)
static int command(std::string c)
static LogLevel & get(int level)
IMGUI_API float GetTextLineHeightWithSpacing()
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiTextEditCallback callback=NULL, void *user_data=NULL)
void DeleteChars(int pos, int bytes_count)
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0), bool repeat_when_held=false)
IMGUI_API void SetKeyboardFocusHere(int offset=0)
static void error(char *msg)
IMGUI_API void SameLine(int column_x=0, int spacing_w=-1)
IMGUI_API void EndChild()
IMGUI_API bool IsItemHovered()
IMGUI_API void SetScrollPosHere()
void InsertChars(int pos, const char *text, const char *text_end=NULL)
IMGUI_API void Separator()
static char buffer[bufferLength+1]
IMGUI_API void LogFinish()
#define assertLessThan(x, y)
static unsigned long size()
IMGUI_API void LogToClipboard(int max_depth=-1)
IMGUI_API void LogToFile(int max_depth=-1, const char *filename=NULL)
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags extra_flags=0)
IMGUI_API bool Begin(const char *name="Debug", bool *p_opened=NULL, const ImVec2 &initial_size=ImVec2(0, 0), float bg_alpha=-1.0f, ImGuiWindowFlags flags=0)
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4 &col)