Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUI.cpp
Show First 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | void CGUI::SendEventToAll(const CStr& EventName) | ||||
// leading to a similar problem. | // leading to a similar problem. | ||||
// now fixed; case is irrelevant since all are converted to lower. | // now fixed; case is irrelevant since all are converted to lower. | ||||
const CStr EventNameLower = EventName.LowerCase(); | const CStr EventNameLower = EventName.LowerCase(); | ||||
m_BaseObject.RecurseObject(nullptr, &IGUIObject::ScriptEvent, EventNameLower); | m_BaseObject.RecurseObject(nullptr, &IGUIObject::ScriptEvent, EventNameLower); | ||||
} | } | ||||
void CGUI::SendEventToAll(const CStr& EventName, const JS::HandleValueArray& paramData) | void CGUI::SendEventToAll(const CStr& EventName, const JS::HandleValueArray& paramData) | ||||
{ | { | ||||
// TODO: Keep a map of objects that subscribe to this event | |||||
const CStr EventNameLower = EventName.LowerCase(); | const CStr EventNameLower = EventName.LowerCase(); | ||||
m_BaseObject.RecurseObject(nullptr, &IGUIObject::ScriptEvent, EventNameLower, paramData); | m_BaseObject.RecurseObject(nullptr, &IGUIObject::ScriptEvent, EventNameLower, paramData); | ||||
} | } | ||||
CGUI::CGUI(const shared_ptr<ScriptRuntime>& runtime) | CGUI::CGUI(const shared_ptr<ScriptRuntime>& runtime) | ||||
: m_MouseButtons(0), m_FocusedObject(nullptr), m_InternalNameNumber(0), m_BaseObject(*this) | : m_MouseButtons(0), m_FocusedObject(nullptr), m_InternalNameNumber(0), m_BaseObject(*this) | ||||
{ | { | ||||
m_ScriptInterface.reset(new ScriptInterface("Engine", "GUIPage", runtime)); | m_ScriptInterface.reset(new ScriptInterface("Engine", "GUIPage", runtime)); | ||||
▲ Show 20 Lines • Show All 1,002 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator