Nebula
Loading...
Searching...
No Matches
imguiconsole.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
11//------------------------------------------------------------------------------
12#include "core/refcounted.h"
13#include "util/ringbuffer.h"
14#include "io/textwriter.h"
15
16namespace Dynui
17{
19{
22
23public:
43
44 struct LogEntry
45 {
47 // Util::String timestamp;
52 };
53
57 virtual ~ImguiConsole();
58
60 void Setup();
62 void Discard();
63
65 void Render();
66
68 void RenderContent();
69
71 void AppendToLog(const LogEntry& msg);
72
73 bool EvaluateCVar(Util::Array<Util::String> const& splits);
74
77
78private:
79 const char * LogEntryTypeAsCharPtr(const LogMessageType & type) const;
80
82
84 void Execute(const Util::String& command);
85
86 char command[65535];
89 bool visible;
90
92};
93} // namespace Dynui
The common base class of Nebula.
Definition refcounted.h:38
const char * LogEntryTypeAsCharPtr(const LogMessageType &type) const
Definition imguiconsole.cc:572
virtual ~ImguiConsole()
destructor
Definition imguiconsole.cc:215
IndexT selectedSuggestion
Definition imguiconsole.h:88
Util::RingBuffer< LogEntry > consoleBuffer
Definition imguiconsole.h:87
bool EvaluateCVar(Util::Array< Util::String > const &splits)
Definition imguiconsole.cc:525
void Render()
render, call this per-frame
Definition imguiconsole.cc:264
void Execute(const Util::String &command)
run script command
Definition imguiconsole.cc:474
__DeclareClass(ImguiConsole)
Util::Array< Util::String > previousCommands
Definition imguiconsole.h:75
void Discard()
discard console
Definition imguiconsole.cc:254
char command[65535]
Definition imguiconsole.h:86
__DeclareInterfaceSingleton(ImguiConsole)
bool scrollToBottom
Definition imguiconsole.h:81
int previousCommandIndex
Definition imguiconsole.h:76
Ptr< IO::TextWriter > persistentHistory
Definition imguiconsole.h:91
void AppendToLog(const LogEntry &msg)
add line to the log
Definition imguiconsole.cc:516
void RenderContent()
render only content, You need to wrap this in ImGui::Begin and ImGui::End
Definition imguiconsole.cc:288
ImguiConsole()
constructor
Definition imguiconsole.cc:203
void Setup()
setup console, the ImguiAddon must be setup prior to this
Definition imguiconsole.cc:224
LogMessageType
These are all the types of messages that can be printed in the console Depending on the type of the m...
Definition imguiconsole.h:29
@ N_ERROR
Error message. Adds [Error] to the message.
Definition imguiconsole.h:37
@ N_INPUT
User Input text. Appends nothing to the message.
Definition imguiconsole.h:33
@ N_MESSAGE
Just plain white text. Adds [Message] prefix to the log message.
Definition imguiconsole.h:31
@ N_WARNING
Warning text. Adds [Warning] to the message.
Definition imguiconsole.h:35
@ N_EXCEPTION
Exception. Adds [FATAL ERROR] to the messsage. These are only used when the application encounters an...
Definition imguiconsole.h:39
@ N_SYSTEM
default messages from system. Adds [SYSTEM] to the message
Definition imguiconsole.h:41
bool visible
Definition imguiconsole.h:89
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:61
A ring buffer stores up to a maximum number of elements in a circular fashion.
Definition ringbuffer.h:21
Nebula's universal string class.
Definition string.h:50
Imgui Profiler UI.
Definition imguiconsole.cc:195
Definition imguiconsole.h:45
LogMessageType type
Using a string for timestamp, so that we can just show it right away.
Definition imguiconsole.h:49
Util::String msg
Message string.
Definition imguiconsole.h:51
int IndexT
Definition types.h:41