Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/GUIManager.cpp
Show All 25 Lines | |||||
#include "ps/GameSetup/Config.h" | #include "ps/GameSetup/Config.h" | ||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "ps/XML/Xeromyces.h" | #include "ps/XML/Xeromyces.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include "scriptinterface/ScriptRuntime.h" | #include "scriptinterface/ScriptRuntime.h" | ||||
CGUIManager* g_GUI = nullptr; | CGUIManager* g_GUI = nullptr; | ||||
const CStr CGUIManager::EventNameWindowResized = "WindowResized"; | |||||
// General TODOs: | // General TODOs: | ||||
// | // | ||||
// A lot of the CGUI data could (and should) be shared between | // A lot of the CGUI data could (and should) be shared between | ||||
// multiple pages, instead of treating them as completely independent, to save | // multiple pages, instead of treating them as completely independent, to save | ||||
// memory and loading time. | // memory and loading time. | ||||
▲ Show 20 Lines • Show All 330 Lines • ▼ Show 20 Lines | |||||
void CGUIManager::UpdateResolution() | void CGUIManager::UpdateResolution() | ||||
{ | { | ||||
// Save an immutable copy so iterators aren't invalidated by event handlers | // Save an immutable copy so iterators aren't invalidated by event handlers | ||||
PageStackType pageStack = m_PageStack; | PageStackType pageStack = m_PageStack; | ||||
for (const SGUIPage& p : pageStack) | for (const SGUIPage& p : pageStack) | ||||
{ | { | ||||
p.gui->UpdateResolution(); | p.gui->UpdateResolution(); | ||||
p.gui->SendEventToAll("WindowResized"); | p.gui->SendEventToAll(EventNameWindowResized); | ||||
} | } | ||||
} | } | ||||
bool CGUIManager::TemplateExists(const std::string& templateName) const | bool CGUIManager::TemplateExists(const std::string& templateName) const | ||||
{ | { | ||||
return m_TemplateLoader.TemplateExists(templateName); | return m_TemplateLoader.TemplateExists(templateName); | ||||
} | } | ||||
Show All 17 Lines |
Wildfire Games · Phabricator