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

The UI manager. More...

#include <UiManager.h>

Inheritance diagram for UiManager:
Collaboration diagram for UiManager:

Classes

struct  UiPrototype
 A UI prototype. More...
 

Public Member Functions

 UiManager ()
 Constructor. More...
 
virtual ~UiManager ()
 Destructor. More...
 
void Initialise ()
 Initializes the manager. More...
 
void Input (const VGears::Event &event) override
 Handles an input event. More...
 
void UpdateDebug () override
 Updates the elements in the manager with debug information. More...
 
void OnResize ()
 Handles resizing events. More...
 
void ClearField () override
 Clears all field UI elements in the manager. More...
 
void ClearBattle () override
 Clears all battle UI elements in the manager. More...
 
void ClearWorld () override
 Clears all world map UI elements in the manager. More...
 
void AddFont (UiFont *font)
 Adds a font to the manager. More...
 
UiFontGetFont (const Ogre::String &name)
 Retrieves a font by name. More...
 
void AddPrototype (const Ogre::String &name, TiXmlNode *prototype)
 Adds a prototype to the manager. More...
 
TiXmlNode * GetPrototype (const Ogre::String &name) const
 Retrieves a prototype by name. More...
 
void AddWidget (UiWidget *widget)
 Adds a UI widget to the manager. More...
 
UiWidgetGetWidget (const Ogre::String &name)
 Retrieves a UI widget by name. More...
 
UiWidgetScriptGetWidget (const char *name)
 Retrieves a UI widget by name. More...
 
void renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation)
 Updates the render queue. More...
 
- Public Member Functions inherited from Manager
 Manager ()
 Constructor. More...
 
virtual ~Manager ()
 Destructor. More...
 
Module GetModule () const
 Retrieves the currently selected module. More...
 
bool IsModule (const Module module) const
 Checks the currently selected module. More...
 
bool IsFieldModule () const
 Checks if the currently selected module is the field module. More...
 
bool IsBattleModule () const
 Checks if the currently selected module is the battle module. More...
 
bool IsWorldModule () const
 Checks if the currently selected module is the world module. More...
 
void SetModule (const Module module)
 Sets the current module for the entity manager. More...
 
void SetFieldModule ()
 Sets the current module to the field mode. More...
 
void SetBattleModule ()
 Sets the current module to the battle mode. More...
 
void SetWorldModule ()
 Sets the current module to the world map mode. More...
 
void SetPreviousModule ()
 Sets the module that was loaded before a battle. More...
 
virtual void Input (const VGears::Event &event)=0
 Handles an input event. More...
 
void Update ()
 Called every frame, performs an update on the things controlled by the manager. More...
 
virtual void UpdateDebug ()=0
 Called every frame, performs an update on the things controlled by the manager. More...
 
virtual void OnResize ()=0
 Handles resizing events. More...
 
void Clear ()
 Clears the manager. More...
 
void Clear (const Module module)
 Clears the manager. More...
 
virtual void ClearField ()=0
 Clear all field information in the manager. More...
 
virtual void ClearBattle ()=0
 Clear all battle information in the manager. More...
 
virtual void ClearWorld ()=0
 Clear all world map information in the manager. More...
 
void ClearAll ()
 Clears the manager. More...
 
void ScriptSetPaused (const bool paused)
 Handles game pausing. More...
 

Private Member Functions

void UpdateField () override
 Updates the field UI elements in the manager. More...
 
void UpdateBattle () override
 Updates the battle UI elements in the manager. More...
 
void UpdateWorld () override
 Updates the world map UI elements in the manager. More...
 

Private Attributes

std::vector< UiFont * > fonts_
 List of fonts in the manager. More...
 
std::vector< UiPrototypeprototypes_
 List of prototypes. More...
 
std::vector< UiWidget * > widgets_
 List of widgets. More...
 

Additional Inherited Members

- Public Types inherited from Manager
enum  Module { FIELD = 0 , BATTLE = 1 , WORLD = 2 }
 The modules the entity manager can handle. More...
 
- Protected Member Functions inherited from Manager
virtual void UpdateField ()=0
 Updates the field entities in the manager. More...
 
virtual void UpdateBattle ()=0
 Updates the battle entities in the manager. More...
 
virtual void UpdateWorld ()=0
 Updates the world map entities in the manager. More...
 
void Update (Module module)
 Updates the entities of one module in the manager. More...
 
- Protected Attributes inherited from Manager
Module module_
 The currently selected module. More...
 
Module prev_module_
 The previous module. More...
 
bool paused_
 Indicates if the game is paused. More...
 

Detailed Description

The UI manager.

Constructor & Destructor Documentation

◆ UiManager()

UiManager::UiManager ( )

Constructor.

◆ ~UiManager()

UiManager::~UiManager ( )
virtual

Destructor.

Member Function Documentation

◆ AddFont()

void UiManager::AddFont ( UiFont font)

Adds a font to the manager.

Parameters
[in]fontThe font to add.

◆ AddPrototype()

void UiManager::AddPrototype ( const Ogre::String &  name,
TiXmlNode *  prototype 
)

Adds a prototype to the manager.

Parameters
[in]nameThe prototype manager.
[in]prototypeThe prototyme, as an XML node.
Todo:
What exactly is a prototype here?

◆ AddWidget()

void UiManager::AddWidget ( UiWidget widget)

Adds a UI widget to the manager.

Parameters
[in]widgetThe widget to add.

◆ ClearBattle()

void UiManager::ClearBattle ( )
overridevirtual

Clears all battle UI elements in the manager.

Implements Manager.

◆ ClearField()

void UiManager::ClearField ( )
overridevirtual

Clears all field UI elements in the manager.

Implements Manager.

◆ ClearWorld()

void UiManager::ClearWorld ( )
overridevirtual

Clears all world map UI elements in the manager.

Implements Manager.

◆ GetFont()

UiFont * UiManager::GetFont ( const Ogre::String &  name)

Retrieves a font by name.

Parameters
[in]nameName of the font.
Returns
The font by the specified name, or NULL if there is none.

◆ GetPrototype()

TiXmlNode * UiManager::GetPrototype ( const Ogre::String &  name) const

Retrieves a prototype by name.

Parameters
[in]nameName of the prototype.
Returns
The prototype by the specified name, or NULL if there is none.
Todo:
What exactly is a prototype here?

◆ GetWidget()

UiWidget * UiManager::GetWidget ( const Ogre::String &  name)

Retrieves a UI widget by name.

Parameters
[in]nameName of the widget.
Returns
The widget by the specified name, or NULL if there is none.

◆ Initialise()

void UiManager::Initialise ( )

Initializes the manager.

Loads all available fonts and screens from _fonts.xml and screens.xml, respectably.

◆ Input()

void UiManager::Input ( const VGears::Event event)
overridevirtual

Handles an input event.

Parameters
[in]eventEvent to handle.

Implements Manager.

◆ OnResize()

void UiManager::OnResize ( )
virtual

Handles resizing events.

Implements Manager.

◆ renderQueueStarted()

void UiManager::renderQueueStarted ( Ogre::uint8  queueGroupId,
const Ogre::String &  invocation,
bool &  skipThisInvocation 
)

Updates the render queue.

Parameters
[in]queueGroupIdThe queue group ID.
[in]invocationUnused.
[in]skipThisInvocationUnused.

◆ ScriptGetWidget()

UiWidget * UiManager::ScriptGetWidget ( const char *  name)

Retrieves a UI widget by name.

Parameters
[in]nameName of the widget.
Returns
The widget by the specified name, or NULL if there is none.

◆ UpdateBattle()

void UiManager::UpdateBattle ( )
overrideprivatevirtual

Updates the battle UI elements in the manager.

Implements Manager.

◆ UpdateDebug()

void UiManager::UpdateDebug ( )
overridevirtual

Updates the elements in the manager with debug information.

Implements Manager.

◆ UpdateField()

void UiManager::UpdateField ( )
overrideprivatevirtual

Updates the field UI elements in the manager.

Implements Manager.

◆ UpdateWorld()

void UiManager::UpdateWorld ( )
overrideprivatevirtual

Updates the world map UI elements in the manager.

Implements Manager.

Member Data Documentation

◆ fonts_

std::vector<UiFont*> UiManager::fonts_
private

List of fonts in the manager.

◆ prototypes_

std::vector<UiPrototype> UiManager::prototypes_
private

List of prototypes.

◆ widgets_

std::vector<UiWidget*> UiManager::widgets_
private

List of widgets.


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