V-Gears 0
Free Final Fantasy VII engine.
Console Class Reference

The game console. More...

#include <Console.h>

Inheritance diagram for Console:
Collaboration diagram for Console:

Classes

struct  OutputLine
 An ouptut line of the console. More...
 

Public Member Functions

 Console ()
 Constructor. More...
 
 ~Console ()
 Destructor. More...
 
void Input (const VGears::Event &event)
 Processes an input event. More...
 
void Update ()
 Updates the console. More...
 
void UpdateDraw ()
 Redraws the console. More...
 
void UpdateNotification ()
 Notifies the console to update itself. More...
 
void OnResize ()
 Processes a console resizing event. More...
 
void SetToVisible ()
 Shows the console. More...
 
void SetToHide ()
 Hides the console. More...
 
bool IsVisible () const
 Checks if the console is currently visible. More...
 
void AddTextToOutput (const Ogre::String &text, const Ogre::ColourValue &colour=Ogre::ColourValue::White)
 Writes text to the console. More...
 
void ExecuteCommand (const Ogre::String &command)
 Executes a command in the console. More...
 
void ExecuteScript ()
 
void CompleteInput ()
 Autocompletes the current input. More...
 
void ResetAutoCompletion ()
 Clears the autocompletion list. More...
 
void AddInputToHistory ()
 Adds a console input to the console history. More...
 
void SetInputLineFromHistory ()
 Sets a line from the history as the current input. More...
 
virtual void messageLogged (const Ogre::String &message, Ogre::LogMessageLevel lml, bool maskDebug, const Ogre::String &logName, bool &skipThisMessage)
 Logs a message to the console. More...
 

Private Member Functions

void LoadHistory ()
 Loads the console input history. More...
 
void SaveHistory ()
 Saves the console input history. More...
 
void AddToHistory (const Ogre::String &history)
 Adds a string to the console input history. More...
 
char TranslateNumpad (const VGears::Event &event)
 Translates numpad key events to regular number events. More...
 

Private Attributes

int console_width_
 The console width. More...
 
int console_height_
 The console height. More...
 
unsigned int line_width_
 The width of each line in the console. More...
 
int letter_width_
 The width of each letter in the console. More...
 
bool to_visible_
 Indicates if the console is being made visible. More...
 
bool visible_
 Indicates if the console is currently visible. More...
 
float height_
 Line height of the console. More...
 
std::list< OutputLineoutput_line_
 Listof lines in the console. More...
 
unsigned int max_output_line_
 Max number of lines in output list. More...
 
unsigned int display_line_
 The bottom line of the console, the active one. More...
 
Ogre::String input_line_
 Currently typed text. More...
 
unsigned int cursor_position_
 Position of the cursor in the active line. More...
 
float cursor_blink_time_
 Cursor blink frequency, in seconds. More...
 
std::list< Ogre::String > history_
 The console input history. More...
 
int history_line_cycle_index_
 Currently selected line of the input history. More...
 
unsigned int max_history_size_
 Maximum number of inputs to save to the history. More...
 
Ogre::StringVector auto_completition_
 List of strings available for autocompletion. More...
 
unsigned int auto_completition_line_
 Index of the currently displayed autocompletion option. More...
 

Detailed Description

The game console.

Constructor & Destructor Documentation

◆ Console()

Console::Console ( )

Constructor.

◆ ~Console()

Console::~Console ( )

Destructor.

Member Function Documentation

◆ AddInputToHistory()

void Console::AddInputToHistory ( )

Adds a console input to the console history.

◆ AddTextToOutput()

void Console::AddTextToOutput ( const Ogre::String &  text,
const Ogre::ColourValue &  colour = Ogre::ColourValue::White 
)

Writes text to the console.

Parameters
[in]textText to write.
[in]colourColor for the text. Default is white.

◆ AddToHistory()

void Console::AddToHistory ( const Ogre::String &  history)
private

Adds a string to the console input history.

◆ CompleteInput()

void Console::CompleteInput ( )

Autocompletes the current input.

◆ ExecuteCommand()

void Console::ExecuteCommand ( const Ogre::String &  command)

Executes a command in the console.

Parameters
[in]commandCommand to execute.

◆ ExecuteScript()

void Console::ExecuteScript ( )
Todo:
Understand and document.

◆ Input()

void Console::Input ( const VGears::Event event)

Processes an input event.

Parameters
[in]eventEvent to process.

◆ IsVisible()

bool Console::IsVisible ( ) const

Checks if the console is currently visible.

Returns
TRue if the console is visible, false otherwise.

◆ LoadHistory()

void Console::LoadHistory ( )
private

Loads the console input history.

◆ messageLogged()

void Console::messageLogged ( const Ogre::String &  message,
Ogre::LogMessageLevel  lml,
bool  maskDebug,
const Ogre::String &  logName,
bool &  skipThisMessage 
)
virtual

Logs a message to the console.

Parameters
[in]messageThe message to log.
[in]lmlLog level for the message.
[in]maskDebugIndicates if the mesage is being printed to the console or not.
[in]logNameName of the log.
[in]skipThisMessageIf true, the message will not be logged.

◆ OnResize()

void Console::OnResize ( )

Processes a console resizing event.

◆ ResetAutoCompletion()

void Console::ResetAutoCompletion ( )

Clears the autocompletion list.

◆ SaveHistory()

void Console::SaveHistory ( )
private

Saves the console input history.

◆ SetInputLineFromHistory()

void Console::SetInputLineFromHistory ( )

Sets a line from the history as the current input.

◆ SetToHide()

void Console::SetToHide ( )

Hides the console.

◆ SetToVisible()

void Console::SetToVisible ( )

Shows the console.

◆ TranslateNumpad()

char Console::TranslateNumpad ( const VGears::Event event)
private

Translates numpad key events to regular number events.

Parameters
[in]eventEvent to translate.

◆ Update()

void Console::Update ( )

Updates the console.

◆ UpdateDraw()

void Console::UpdateDraw ( )

Redraws the console.

◆ UpdateNotification()

void Console::UpdateNotification ( )

Notifies the console to update itself.

Member Data Documentation

◆ auto_completition_

Ogre::StringVector Console::auto_completition_
private

List of strings available for autocompletion.

◆ auto_completition_line_

unsigned int Console::auto_completition_line_
private

Index of the currently displayed autocompletion option.

◆ console_height_

int Console::console_height_
private

The console height.

◆ console_width_

int Console::console_width_
private

The console width.

◆ cursor_blink_time_

float Console::cursor_blink_time_
private

Cursor blink frequency, in seconds.

◆ cursor_position_

unsigned int Console::cursor_position_
private

Position of the cursor in the active line.

◆ display_line_

unsigned int Console::display_line_
private

The bottom line of the console, the active one.

◆ height_

float Console::height_
private

Line height of the console.

◆ history_

std::list<Ogre::String> Console::history_
private

The console input history.

◆ history_line_cycle_index_

int Console::history_line_cycle_index_
private

Currently selected line of the input history.

◆ input_line_

Ogre::String Console::input_line_
private

Currently typed text.

◆ letter_width_

int Console::letter_width_
private

The width of each letter in the console.

◆ line_width_

unsigned int Console::line_width_
private

The width of each line in the console.

◆ max_history_size_

unsigned int Console::max_history_size_
private

Maximum number of inputs to save to the history.

◆ max_output_line_

unsigned int Console::max_output_line_
private

Max number of lines in output list.

◆ output_line_

std::list<OutputLine> Console::output_line_
private

Listof lines in the console.

◆ to_visible_

bool Console::to_visible_
private

Indicates if the console is being made visible.

◆ visible_

bool Console::visible_
private

Indicates if the console is currently visible.


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