![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
The dialog manager. More...
#include <DialogsManager.h>
Public Member Functions | |
DialogsManager () | |
Constructor. More... | |
virtual | ~DialogsManager () |
Destructor. More... | |
void | Initialise () |
Initializes the dialog manager. More... | |
void | Input (const VGears::Event &event) override |
Processes an input event. More... | |
void | UpdateDebug () |
Updates the messagemanager with debug information. More... | |
void | OnResize () override |
Handles resizing events. More... | |
void | ClearField () override |
Clears all field messages. More... | |
void | ClearBattle () override |
Clears all battle messages. More... | |
void | ClearWorld () override |
Clears all world map maeeages. More... | |
void | OpenDialog (const char *d_name, int x, int y, int w, int h) |
Opens a dialog. More... | |
void | SetText (const char *d_name, const char *text) |
Sets the text of a dialog. More... | |
void | SetNumeric (const char *d_name, const bool numeric, const bool timer) |
Sets or unsets a dialog window as numeric. More... | |
void | UpdateTimer (const unsigned int seconds) |
Updates the timer. More... | |
void | SetMode (const char *d_name, const int bg, const bool closeable) |
Sets the window mode. More... | |
int | Sync (const char *d_name) |
Syncs the dialog and makes the script wait until it is closed. More... | |
void | Hide (const char *d_name) |
Closes and hides a dialog window. More... | |
void | SetVariable (const char *d_name, const char *name, const char *value) |
Sets a variable in a dialog. More... | |
void | SetClickable (const char *d_name, const bool clickable) |
Makes the dialog clickable or not. More... | |
void | SetCursor (const char *d_name, const int first_row, const int last_row) |
Sets a choice sursor in the dialog. More... | |
int | GetCursor (const char *d_name) const |
Gets the cursor position in a dialog. More... | |
void | ScriptSetMapName (const char *text_id) |
Sets the map name from a text ID. More... | |
void | SetMapName (std::string name) |
Sets the map name from a text ID. More... | |
std::string | GetMapName () |
Retrieves the current map name. More... | |
![]() | |
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 dialogs while in a field. More... | |
void | UpdateBattle () override |
Updates the dialogs during a battle. More... | |
void | UpdateWorld () override |
Updates the dialogs while on the world map. More... | |
void | ShowMessage (const int id, const int x, const int y, const int width, const int height) |
Shows a message in a dialog. More... | |
void | HideMessage (const int id) |
Closes and hides a message. More... | |
int | GetMessageId (const char *d_name) const |
Retrieves a message Id from it's name. More... | |
bool | AutoCloseCheck (const unsigned int id) |
Checks if a message is set to close automatically. More... | |
Private Attributes | |
UiWidget * | limit_area_ |
The limit area for message boxes. More... | |
std::vector< MessageData * > | messages_ |
The list of messages for the field or the world map. More... | |
std::vector< MessageData * > | battle_messages_ |
The list of battle messages. More... | |
bool | next_pressed_ |
Indicates if the 'next' button has been pressed. More... | |
bool | next_repeated_ |
Indicates if the 'next' button is being hold. More... | |
bool | up_pressed_ |
Indicates if the 'up' button has been pressed. More... | |
bool | down_pressed_ |
Indicates if the 'down' button has been pressed. More... | |
std::string | map_name_ |
Current map name. More... | |
int | timer_window_id_ |
The ID of the window that contains the timer, is any. More... | |
unsigned int | timer_seconds_ |
The number of seconds in the timer. More... | |
Additional Inherited Members | |
![]() | |
enum | Module { FIELD = 0 , BATTLE = 1 , WORLD = 2 } |
The modules the entity manager can handle. More... | |
![]() | |
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... | |
![]() | |
Module | module_ |
The currently selected module. More... | |
Module | prev_module_ |
The previous module. More... | |
bool | paused_ |
Indicates if the game is paused. More... | |
The dialog manager.
DialogsManager::DialogsManager | ( | ) |
Constructor.
|
virtual |
Destructor.
|
private |
Checks if a message is set to close automatically.
[in] | id | Message ID. |
|
overridevirtual |
Clears all battle messages.
Implements Manager.
|
overridevirtual |
Clears all field messages.
Implements Manager.
|
overridevirtual |
Clears all world map maeeages.
Implements Manager.
int DialogsManager::GetCursor | ( | const char * | d_name | ) | const |
Gets the cursor position in a dialog.
[in] | d_name | Dialog name. |
std::string DialogsManager::GetMapName | ( | ) |
Retrieves the current map name.
|
private |
Retrieves a message Id from it's name.
[in] | d_name | Dialog name. |
void DialogsManager::Hide | ( | const char * | d_name | ) |
Closes and hides a dialog window.
Equivalent to dialog_close in the field scripts.
[in] | d_name | Name of the dialog to close. |
|
private |
Closes and hides a message.
[in] | id | ID of the message to close. |
void DialogsManager::Initialise | ( | ) |
Initializes the dialog manager.
|
overridevirtual |
|
overridevirtual |
Handles resizing events.
Implements Manager.
void DialogsManager::OpenDialog | ( | const char * | d_name, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Opens a dialog.
Equivalent to dialog_open in the field scripts.
[in] | d_name | The dialog name. Can be used as ID. |
[in] | x | X coordinate for the top left corner of the dialog. |
[in] | y | Y coordinate for the top left corner of the dialog. |
[in] | w | Width of the dialog, in pixels. |
[in] | h | Height of the dialog, in pixels. |
void DialogsManager::ScriptSetMapName | ( | const char * | text_id | ) |
Sets the map name from a text ID.
[in] | text_id | The ID of the text to set as map name. |
void DialogsManager::SetClickable | ( | const char * | d_name, |
const bool | clickable | ||
) |
Makes the dialog clickable or not.
A clickable dialog presents a choice for the user that must be selected with a cursor.
[in] | d_name | Name of the dialog. |
[in] | clickable | True to make the dialog clickable, false to make it unclickable |
void DialogsManager::SetCursor | ( | const char * | d_name, |
const int | first_row, | ||
const int | last_row | ||
) |
Sets a choice sursor in the dialog.
[in] | d_name | Name of the dialog. |
[in] | first_row | First selectable line. |
[in] | last_row | Last selectable line. |
void DialogsManager::SetMapName | ( | std::string | name | ) |
Sets the map name from a text ID.
[in] | name | The new map name. |
void DialogsManager::SetMode | ( | const char * | d_name, |
const int | bg, | ||
const bool | closeable | ||
) |
Sets the window mode.
[in] | d_name | Name of the dialog. |
[in] | bg | Background mode. 1: No background/border. 2: Translucent background. Anything else: Normal. |
[in] | closeable | True if the window can be closed manually, false to lock it. |
void DialogsManager::SetNumeric | ( | const char * | d_name, |
const bool | numeric, | ||
const bool | timer | ||
) |
Sets or unsets a dialog window as numeric.
[in] | d_name | Name of the dialog. |
[in] | numeric | True to make it numeric, false otherwise. |
[in] | timer | True to use the window for times, false for regular numbers. If used for timer, the window will be used when calling { |
void DialogsManager::SetText | ( | const char * | d_name, |
const char * | text | ||
) |
Sets the text of a dialog.
Equivalent to dialog_set_text in the field scripts.
[in] | d_name | Name of the dialog. |
[in] | text | Text to set in the dialog. |
void DialogsManager::SetVariable | ( | const char * | d_name, |
const char * | name, | ||
const char * | value | ||
) |
Sets a variable in a dialog.
[in] | d_name | Name of the dialog. |
[in] | name | Name of the variable. |
[in] | value | Value for the variable. |
|
private |
Shows a message in a dialog.
[in] | id | Message id. |
[in] | x | X coordinate for the text in the dialog. |
[in] | y | Y coordinate for the text in the dialog. |
[in] | width | Width of the text, in pixels. |
[in] | height | Height of the text, in pixels. |
int DialogsManager::Sync | ( | const char * | d_name | ) |
Syncs the dialog and makes the script wait until it is closed.
Equivalent to dialog_wait_for_close in the field scripts.
[in] | d_name | Name of the dialog. |
|
overrideprivatevirtual |
Updates the dialogs during a battle.
Implements Manager.
|
virtual |
Updates the messagemanager with debug information.
Implements Manager.
|
overrideprivatevirtual |
Updates the dialogs while in a field.
Implements Manager.
void DialogsManager::UpdateTimer | ( | const unsigned int | seconds | ) |
Updates the timer.
Displays the formatted time in the timer window. To do so, a timer window must have been set as timer with {
|
overrideprivatevirtual |
Updates the dialogs while on the world map.
Implements Manager.
|
private |
The list of battle messages.
|
private |
Indicates if the 'down' button has been pressed.
|
private |
The limit area for message boxes.
|
private |
Current map name.
|
private |
The list of messages for the field or the world map.
|
private |
Indicates if the 'next' button has been pressed.
|
private |
Indicates if the 'next' button is being hold.
|
private |
The number of seconds in the timer.
Stored solely to not re-set the text if the time is the same.
|
private |
The ID of the window that contains the timer, is any.
|
private |
Indicates if the 'up' button has been pressed.