Pyrogenesis
trunk
|
External interface to the GUI system. More...
#include <GUIManager.h>
Classes | |
struct | SGUIPage |
Public Member Functions | |
CGUIManager () | |
~CGUIManager () | |
shared_ptr< ScriptInterface > | GetScriptInterface () |
shared_ptr< ScriptRuntime > | GetRuntime () |
shared_ptr< CGUI > | GetActiveGUI () |
bool | HasPages () |
Returns whether there are any current pages. More... | |
void | SwitchPage (const CStrW &name, ScriptInterface *srcScriptInterface, JS::HandleValue initData) |
Load a new GUI page and make it active. More... | |
void | PushPage (const CStrW &pageName, shared_ptr< ScriptInterface::StructuredClone > initData) |
Load a new GUI page and make it active. More... | |
void | PopPage () |
Unload the currently active GUI page, and make the previous page active. More... | |
void | PopPageCB (shared_ptr< ScriptInterface::StructuredClone > args) |
void | DisplayMessageBox (int width, int height, const CStrW &title, const CStrW &message) |
Display a modal message box with an "OK" button. More... | |
Status | ReloadChangedFile (const VfsPath &path) |
Called when a file has been modified, to hotload changes. More... | |
void | ResetCursor () |
Sets the default mouse pointer. More... | |
Status | ReloadAllPages () |
Called when we should reload all pages (e.g. More... | |
InReaction | HandleEvent (const SDL_Event_ *ev) |
Pass input events to the currently active GUI page. More... | |
bool | GetPreDefinedColor (const CStr &name, CColor &output) const |
See CGUI::GetPreDefinedColor; applies to the currently active page. More... | |
IGUIObject * | FindObjectByName (const CStr &name) const |
See CGUI::FindObjectByName; applies to the currently active page. More... | |
void | SendEventToAll (const CStr &eventName) const |
See CGUI::SendEventToAll; applies to the currently active page. More... | |
void | TickObjects () |
See CGUI::TickObjects; applies to all loaded pages. More... | |
void | Draw () |
See CGUI::Draw; applies to all loaded pages. More... | |
void | UpdateResolution () |
See CGUI::UpdateResolution; applies to all loaded pages. More... | |
std::string | GetSavedGameData () |
Calls the current page's script function getSavedGameData() and returns the result. More... | |
void | RestoreSavedGameData (const std::string &jsonData) |
bool | TemplateExists (const std::string &templateName) const |
Check if a template with this name exists. More... | |
const CParamNode & | GetTemplate (const std::string &templateName) |
Retrieve the requested template, used for displaying faction specificities. More... | |
Private Types | |
typedef std::vector< SGUIPage > | PageStackType |
Private Member Functions | |
NONCOPYABLE (CGUIManager) | |
void | LoadPage (SGUIPage &page) |
shared_ptr< CGUI > | top () const |
Private Attributes | |
shared_ptr< CGUI > | m_CurrentGUI |
shared_ptr< ScriptRuntime > | m_ScriptRuntime |
shared_ptr< ScriptInterface > | m_ScriptInterface |
PageStackType | m_PageStack |
CTemplateLoader | m_TemplateLoader |
External interface to the GUI system.
The GUI consists of a set of pages. Each page is constructed from a series of XML files, and is independent from any other page. Only one page is active at a time. All events and render requests etc will go to the active page. This lets the GUI switch between pre-game menu and in-game UI.
|
private |
CGUIManager::CGUIManager | ( | ) |
CGUIManager::~CGUIManager | ( | ) |
void CGUIManager::DisplayMessageBox | ( | int | width, |
int | height, | ||
const CStrW & | title, | ||
const CStrW & | message | ||
) |
Display a modal message box with an "OK" button.
void CGUIManager::Draw | ( | ) |
See CGUI::Draw; applies to all loaded pages.
IGUIObject * CGUIManager::FindObjectByName | ( | const CStr & | name | ) | const |
See CGUI::FindObjectByName; applies to the currently active page.
|
inline |
bool CGUIManager::GetPreDefinedColor | ( | const CStr & | name, |
CColor & | output | ||
) | const |
See CGUI::GetPreDefinedColor; applies to the currently active page.
|
inline |
std::string CGUIManager::GetSavedGameData | ( | ) |
Calls the current page's script function getSavedGameData() and returns the result.
|
inline |
const CParamNode & CGUIManager::GetTemplate | ( | const std::string & | templateName | ) |
Retrieve the requested template, used for displaying faction specificities.
InReaction CGUIManager::HandleEvent | ( | const SDL_Event_ * | ev | ) |
Pass input events to the currently active GUI page.
bool CGUIManager::HasPages | ( | ) |
Returns whether there are any current pages.
|
private |
|
private |
void CGUIManager::PopPage | ( | ) |
Unload the currently active GUI page, and make the previous page active.
(There must be at least two pages when you call this.)
void CGUIManager::PopPageCB | ( | shared_ptr< ScriptInterface::StructuredClone > | args | ) |
void CGUIManager::PushPage | ( | const CStrW & | pageName, |
shared_ptr< ScriptInterface::StructuredClone > | initData | ||
) |
Load a new GUI page and make it active.
All current pages will be retained, and will still be drawn and receive tick events, but will not receive user inputs.
Status CGUIManager::ReloadAllPages | ( | ) |
Called when we should reload all pages (e.g.
translation hotloading update).
Called when a file has been modified, to hotload changes.
void CGUIManager::ResetCursor | ( | ) |
Sets the default mouse pointer.
void CGUIManager::RestoreSavedGameData | ( | const std::string & | jsonData | ) |
void CGUIManager::SendEventToAll | ( | const CStr & | eventName | ) | const |
See CGUI::SendEventToAll; applies to the currently active page.
void CGUIManager::SwitchPage | ( | const CStrW & | name, |
ScriptInterface * | srcScriptInterface, | ||
JS::HandleValue | initData | ||
) |
Load a new GUI page and make it active.
All current pages will be destroyed.
bool CGUIManager::TemplateExists | ( | const std::string & | templateName | ) | const |
Check if a template with this name exists.
void CGUIManager::TickObjects | ( | ) |
See CGUI::TickObjects; applies to all loaded pages.
|
private |
void CGUIManager::UpdateResolution | ( | ) |
See CGUI::UpdateResolution; applies to all loaded pages.
|
private |
|
private |
|
private |
|
private |
|
private |