Nebula
Loading...
Searching...
No Matches
Dynui::ImguiConsole Class Reference

#include <imguiconsole.h>

Detailed Description

The ImGui console uses ImGui to produce a live interactive console.

Inherits Core::RefCounted.

Classes

struct  LogEntry
 

Public Types

enum  LogMessageType {
  N_MESSAGE = 0 , N_INPUT = 1 , N_WARNING = 2 , N_ERROR = 3 ,
  N_EXCEPTION = 4 , N_SYSTEM = 5
}
 These are all the types of messages that can be printed in the console Depending on the type of the message, they are sorted into different categories by appending a type prefix to the message. More...
 
enum  CommandMode { Python , CVar }
 

Public Member Functions

 ImguiConsole ()
 constructor
 
virtual ~ImguiConsole ()
 destructor
 
void Setup ()
 setup console, the ImguiAddon must be setup prior to this
 
void Discard ()
 discard console
 
void Render ()
 render, call this per-frame
 
void RenderContent ()
 render only content, You need to wrap this in ImGui::Begin and ImGui::End
 
void AppendToLog (const LogEntry &msg)
 add line to the log
 
bool EvaluateCVar (Util::Array< Util::String > const &splits)
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 

Public Attributes

Util::Array< Util::StringpreviousCommands
 
int previousCommandIndex
 
enum Dynui::ImguiConsole::CommandMode cmdMode
 

Private Member Functions

 __DeclareClass (ImguiConsole)
 
 __DeclareInterfaceSingleton (ImguiConsole)
 
const char * LogEntryTypeAsCharPtr (const LogMessageType &type) const
 
void Execute (const Util::String &command)
 run script command
 

Private Attributes

bool scrollToBottom
 
char command [65535]
 
Util::RingBuffer< LogEntryconsoleBuffer
 
IndexT selectedSuggestion
 
Ptr< Scripting::ScriptServerscriptServer
 
bool visible
 
Ptr< IO::TextWriterpersistentHistory
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 

Member Enumeration Documentation

◆ CommandMode

Enumerator
Python 
CVar 

◆ LogMessageType

These are all the types of messages that can be printed in the console Depending on the type of the message, they are sorted into different categories by appending a type prefix to the message.

Enumerator
N_MESSAGE 

Just plain white text. Adds [Message] prefix to the log message.

N_INPUT 

User Input text. Appends nothing to the message.

N_WARNING 

Warning text. Adds [Warning] to the message.

N_ERROR 

Error message. Adds [Error] to the message.

N_EXCEPTION 

Exception. Adds [FATAL ERROR] to the messsage. These are only used when the application encounters an assertion and needs to abort.

N_SYSTEM 

default messages from system. Adds [SYSTEM] to the message

Constructor & Destructor Documentation

◆ ImguiConsole()

Dynui::ImguiConsole::ImguiConsole ( )

constructor

◆ ~ImguiConsole()

Dynui::ImguiConsole::~ImguiConsole ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Dynui::ImguiConsole::__DeclareClass ( ImguiConsole )
private

◆ __DeclareInterfaceSingleton()

Dynui::ImguiConsole::__DeclareInterfaceSingleton ( ImguiConsole )
private

◆ AppendToLog()

void Dynui::ImguiConsole::AppendToLog ( const LogEntry & msg)

add line to the log

◆ Discard()

void Dynui::ImguiConsole::Discard ( )

discard console

◆ EvaluateCVar()

bool Dynui::ImguiConsole::EvaluateCVar ( Util::Array< Util::String > const & splits)

◆ Execute()

void Dynui::ImguiConsole::Execute ( const Util::String & command)
private

run script command

◆ LogEntryTypeAsCharPtr()

const char * Dynui::ImguiConsole::LogEntryTypeAsCharPtr ( const LogMessageType & type) const
private

◆ Render()

void Dynui::ImguiConsole::Render ( )

render, call this per-frame

◆ RenderContent()

void Dynui::ImguiConsole::RenderContent ( )

render only content, You need to wrap this in ImGui::Begin and ImGui::End

◆ Setup()

void Dynui::ImguiConsole::Setup ( )

setup console, the ImguiAddon must be setup prior to this

Member Data Documentation

◆ cmdMode

enum Dynui::ImguiConsole::CommandMode Dynui::ImguiConsole::cmdMode

◆ command

char Dynui::ImguiConsole::command[65535]
private

◆ consoleBuffer

Util::RingBuffer<LogEntry> Dynui::ImguiConsole::consoleBuffer
private

◆ persistentHistory

Ptr<IO::TextWriter> Dynui::ImguiConsole::persistentHistory
private

◆ previousCommandIndex

int Dynui::ImguiConsole::previousCommandIndex

◆ previousCommands

Util::Array<Util::String> Dynui::ImguiConsole::previousCommands

◆ scriptServer

Ptr<Scripting::ScriptServer> Dynui::ImguiConsole::scriptServer
private

◆ scrollToBottom

bool Dynui::ImguiConsole::scrollToBottom
private

◆ selectedSuggestion

IndexT Dynui::ImguiConsole::selectedSuggestion
private

◆ visible

bool Dynui::ImguiConsole::visible
private

The documentation for this class was generated from the following files: