18#include <OgreSingleton.h>
301 void OpenDialog(
const char* d_name,
int x,
int y,
int w,
int h);
311 void SetText(
const char* d_name,
const char* text);
321 void SetNumeric(
const char* d_name,
const bool numeric,
const bool timer);
339 void SetMode(
const char* d_name,
const int bg,
const bool closeable);
349 int Sync(
const char* d_name);
358 void Hide(
const char* d_name);
367 void SetVariable(
const char* d_name,
const char* name,
const char* value);
377 void SetClickable(
const char* d_name,
const bool clickable);
386 void SetCursor(
const char* d_name,
const int first_row,
const int last_row);
445 void ShowMessage(
const int id,
const int x,
const int y,
const int width,
const int height);
MessageStyle
Styles for message boxes.
Definition: DialogsManager.h:59
@ MSL_SOLID
Regular message box, solid background.
Definition: DialogsManager.h:64
@ MSL_TRANSPARENT
Translucent message box.
Definition: DialogsManager.h:69
@ MSL_NONE
No message box.
Definition: DialogsManager.h:74
MessageState
Possible states for messages.
Definition: DialogsManager.h:28
@ MS_OPENED
The message window is open.
Definition: DialogsManager.h:48
@ MS_CLOSED
The message is now closed.
Definition: DialogsManager.h:33
@ MS_SHOW_WINDOW
The message window is shown, but there is no text.
Definition: DialogsManager.h:38
@ MS_SHOW_TEXT
The message window and text are shown.
Definition: DialogsManager.h:43
@ MS_HIDE_WINDOW
The message window has been hidden.
Definition: DialogsManager.h:53
The dialog manager.
Definition: DialogsManager.h:239
void SetMapName(std::string name)
Sets the map name from a text ID.
Definition: DialogsManager.cpp:120
std::vector< MessageData * > messages_
The list of messages for the field or the world map.
Definition: DialogsManager.h:478
std::string map_name_
Current map name.
Definition: DialogsManager.h:508
void ClearField() override
Clears all field messages.
Definition: DialogsManager.cpp:103
void UpdateBattle() override
Updates the dialogs during a battle.
Definition: DialogsManager.cpp:491
void SetVariable(const char *d_name, const char *name, const char *value)
Sets a variable in a dialog.
Definition: DialogsManager.cpp:263
void UpdateDebug()
Updates the messagemanager with debug information.
Definition: DialogsManager.cpp:99
void SetCursor(const char *d_name, const int first_row, const int last_row)
Sets a choice sursor in the dialog.
Definition: DialogsManager.cpp:281
unsigned int timer_seconds_
The number of seconds in the timer.
Definition: DialogsManager.h:520
bool down_pressed_
Indicates if the 'down' button has been pressed.
Definition: DialogsManager.h:503
int timer_window_id_
The ID of the window that contains the timer, is any.
Definition: DialogsManager.h:513
void HideMessage(const int id)
Closes and hides a message.
Definition: DialogsManager.cpp:335
void UpdateField() override
Updates the dialogs while in a field.
Definition: DialogsManager.cpp:372
bool next_repeated_
Indicates if the 'next' button is being hold.
Definition: DialogsManager.h:493
bool up_pressed_
Indicates if the 'up' button has been pressed.
Definition: DialogsManager.h:498
void SetText(const char *d_name, const char *text)
Sets the text of a dialog.
Definition: DialogsManager.cpp:147
int GetCursor(const char *d_name) const
Gets the cursor position in a dialog.
Definition: DialogsManager.cpp:299
void SetMode(const char *d_name, const int bg, const bool closeable)
Sets the window mode.
Definition: DialogsManager.cpp:210
void ClearBattle() override
Clears all battle messages.
Definition: DialogsManager.cpp:107
void UpdateWorld() override
Updates the dialogs while on the world map.
Definition: DialogsManager.cpp:493
void UpdateTimer(const unsigned int seconds)
Updates the timer.
Definition: DialogsManager.cpp:198
void Input(const VGears::Event &event) override
Processes an input event.
Definition: DialogsManager.cpp:90
void OnResize() override
Handles resizing events.
Definition: DialogsManager.cpp:101
virtual ~DialogsManager()
Destructor.
Definition: DialogsManager.cpp:46
void SetNumeric(const char *d_name, const bool numeric, const bool timer)
Sets or unsets a dialog window as numeric.
Definition: DialogsManager.cpp:172
std::string GetMapName()
Retrieves the current map name.
Definition: DialogsManager.cpp:122
void Hide(const char *d_name)
Closes and hides a dialog window.
Definition: DialogsManager.cpp:250
int Sync(const char *d_name)
Syncs the dialog and makes the script wait until it is closed.
Definition: DialogsManager.cpp:239
UiWidget * limit_area_
The limit area for message boxes.
Definition: DialogsManager.h:473
void ScriptSetMapName(const char *text_id)
Sets the map name from a text ID.
Definition: DialogsManager.cpp:115
void SetClickable(const char *d_name, const bool clickable)
Makes the dialog clickable or not.
Definition: DialogsManager.cpp:272
void ShowMessage(const int id, const int x, const int y, const int width, const int height)
Shows a message in a dialog.
Definition: DialogsManager.cpp:308
void OpenDialog(const char *d_name, int x, int y, int w, int h)
Opens a dialog.
Definition: DialogsManager.cpp:124
DialogsManager()
Constructor.
Definition: DialogsManager.cpp:35
std::vector< MessageData * > battle_messages_
The list of battle messages.
Definition: DialogsManager.h:483
bool AutoCloseCheck(const unsigned int id)
Checks if a message is set to close automatically.
Definition: DialogsManager.cpp:361
void Initialise()
Initializes the dialog manager.
Definition: DialogsManager.cpp:51
void ClearWorld() override
Clears all world map maeeages.
Definition: DialogsManager.cpp:111
int GetMessageId(const char *d_name) const
Retrieves a message Id from it's name.
Definition: DialogsManager.cpp:355
bool next_pressed_
Indicates if the 'next' button has been pressed.
Definition: DialogsManager.h:488
A base manager.
Definition: Manager.h:24
An ingame textarea.
Definition: UiTextArea.h:163
Message data.
Definition: DialogsManager.h:80
int w
The message width, in pixels.
Definition: DialogsManager.h:148
UiWidget * widget
The widget where the message is displayed.
Definition: DialogsManager.h:108
std::vector< ScriptId > sync
Definition: DialogsManager.h:158
MessageState state
The state of the message.
Definition: DialogsManager.h:133
UiWidget * cursor
The message cursor.
Definition: DialogsManager.h:128
int cursor_row_first
First chooseable line.
Definition: DialogsManager.h:203
float cursor_percent_y
Definition: DialogsManager.h:183
float cursor_y
Y position of the cursor in the message box.
Definition: DialogsManager.h:188
bool auto_close
Indicates if the dialog must be closed automatically.
Definition: DialogsManager.h:178
bool closeable
Indicates if the window is closeable.
Definition: DialogsManager.h:213
bool visible
Indicates if the window background is visible.
Definition: DialogsManager.h:218
int cursor_row_last
Last chooseable line.
Definition: DialogsManager.h:208
bool show_cursor
Indicates if the choice selection cursor must be shown.
Definition: DialogsManager.h:173
UiWidget * scissor
Definition: DialogsManager.h:118
int x
The message window X coordinate.
Definition: DialogsManager.h:138
bool timer
Indicates if the window is for a timer.
Definition: DialogsManager.h:228
MessageData()
Definition: DialogsManager.h:81
UiTextArea * text_area
The message text area.
Definition: DialogsManager.h:123
int y
The message window Y coordinate.
Definition: DialogsManager.h:143
bool clickable
Indicates if the text is 'clickable', i.e., if it requieres a keypress to advance.
Definition: DialogsManager.h:163
bool show_window
Indicates if the dialog window is shown.
Definition: DialogsManager.h:168
int h
The message height, in pixels.
Definition: DialogsManager.h:153
bool translucent
Indicates if the window background is translucent.
Definition: DialogsManager.h:223
bool numeric
Indicates if the window background is for a number.
Definition: DialogsManager.h:233
int cursor_row_current
Currently selected choice line.
Definition: DialogsManager.h:198
int cursor_row_selected
Selected choice line.
Definition: DialogsManager.h:193
UiWidget * window
The window where the message is displayed.
Definition: DialogsManager.h:113
An input event.
Definition: Event.h:84