18#include <OgreColourValue.h>
20#include <OgreSingleton.h>
21#include <OgreStringVector.h>
30class Console :
public Ogre::Singleton<Console>,
public Ogre::LogListener{
95 const Ogre::String& text,
const Ogre::ColourValue& colour = Ogre::ColourValue::White
142 bool maskDebug,
const Ogre::String &logName,
bool& skipThisMessage
The game console.
Definition: Console.h:30
void ExecuteCommand(const Ogre::String &command)
Executes a command in the console.
Definition: Console.cpp:446
void AddTextToOutput(const Ogre::String &text, const Ogre::ColourValue &colour=Ogre::ColourValue::White)
Writes text to the console.
Definition: Console.cpp:403
char TranslateNumpad(const VGears::Event &event)
Translates numpad key events to regular number events.
Definition: Console.cpp:263
std::list< OutputLine > output_line_
Listof lines in the console.
Definition: Console.h:228
void SetInputLineFromHistory()
Sets a line from the history as the current input.
Definition: Console.cpp:591
void SetToVisible()
Shows the console.
Definition: Console.cpp:394
~Console()
Destructor.
Definition: Console.cpp:71
unsigned int max_output_line_
Max number of lines in output list.
Definition: Console.h:233
int history_line_cycle_index_
Currently selected line of the input history.
Definition: Console.h:263
int console_height_
The console height.
Definition: Console.h:177
unsigned int max_history_size_
Maximum number of inputs to save to the history.
Definition: Console.h:268
void AddInputToHistory()
Adds a console input to the console history.
Definition: Console.cpp:589
void Update()
Updates the console.
Definition: Console.cpp:284
float height_
Line height of the console.
Definition: Console.h:202
Ogre::StringVector auto_completition_
List of strings available for autocompletion.
Definition: Console.h:273
void ExecuteScript()
Definition: Console.cpp:475
void Input(const VGears::Event &event)
Processes an input event.
Definition: Console.cpp:100
unsigned int auto_completition_line_
Index of the currently displayed autocompletion option.
Definition: Console.h:278
unsigned int display_line_
The bottom line of the console, the active one.
Definition: Console.h:238
void SetToHide()
Hides the console.
Definition: Console.cpp:399
void LoadHistory()
Loads the console input history.
Definition: Console.cpp:77
unsigned int cursor_position_
Position of the cursor in the active line.
Definition: Console.h:248
unsigned int line_width_
The width of each line in the console.
Definition: Console.h:182
virtual void messageLogged(const Ogre::String &message, Ogre::LogMessageLevel lml, bool maskDebug, const Ogre::String &logName, bool &skipThisMessage)
Logs a message to the console.
Definition: Console.cpp:603
void UpdateNotification()
Notifies the console to update itself.
Definition: Console.cpp:359
void OnResize()
Processes a console resizing event.
Definition: Console.cpp:380
void CompleteInput()
Autocompletes the current input.
Definition: Console.cpp:477
bool IsVisible() const
Checks if the console is currently visible.
Definition: Console.cpp:401
Console()
Constructor.
Definition: Console.cpp:39
int letter_width_
The width of each letter in the console.
Definition: Console.h:187
void ResetAutoCompletion()
Clears the autocompletion list.
Definition: Console.cpp:584
bool visible_
Indicates if the console is currently visible.
Definition: Console.h:197
bool to_visible_
Indicates if the console is being made visible.
Definition: Console.h:192
float cursor_blink_time_
Cursor blink frequency, in seconds.
Definition: Console.h:253
void UpdateDraw()
Redraws the console.
Definition: Console.cpp:302
int console_width_
The console width.
Definition: Console.h:172
std::list< Ogre::String > history_
The console input history.
Definition: Console.h:258
void SaveHistory()
Saves the console input history.
Definition: Console.cpp:85
void AddToHistory(const Ogre::String &history)
Adds a string to the console input history.
Definition: Console.cpp:94
Ogre::String input_line_
Currently typed text.
Definition: Console.h:243
Ogre::String String
Definition: TypeDefine.h:37
An ouptut line of the console.
Definition: Console.h:207
float time
Time at which it was printed.
Definition: Console.h:222
Ogre::ColourValue colour
Color for the text in the line.
Definition: Console.h:217
Ogre::String text
Text in the line.
Definition: Console.h:212
An input event.
Definition: Event.h:84