Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUI.cpp
Show First 20 Lines • Show All 435 Lines • ▼ Show 20 Lines | if (m_FocusedObject) | ||||
m_FocusedObject->HandleMessage(msg); | m_FocusedObject->HandleMessage(msg); | ||||
} | } | ||||
} | } | ||||
void CGUI::SetObjectStyle(IGUIObject* pObject, const CStr& styleName) | void CGUI::SetObjectStyle(IGUIObject* pObject, const CStr& styleName) | ||||
{ | { | ||||
// If the style is not recognised (or an empty string) then ApplyStyle will | // If the style is not recognised (or an empty string) then ApplyStyle will | ||||
// emit an error message. Thus we don't need to handle it here. | // emit an error message. Thus we don't need to handle it here. | ||||
if (pObject->ApplyStyle(styleName)) | pObject->ApplyStyle(styleName); | ||||
pObject->m_Style = styleName; | |||||
} | } | ||||
void CGUI::UnsetObjectStyle(IGUIObject* pObject) | void CGUI::UnsetObjectStyle(IGUIObject* pObject) | ||||
{ | { | ||||
SetObjectStyle(pObject, "default"); | SetObjectStyle(pObject, "default"); | ||||
} | } | ||||
void CGUI::SetObjectHotkey(IGUIObject* pObject, const CStr& hotkeyTag) | void CGUI::SetObjectHotkey(IGUIObject* pObject, const CStr& hotkeyTag) | ||||
▲ Show 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObject* pParent, std::vector<std::pair<CStr, CStr> >& NameSubst, std::unordered_set<VfsPath>& Paths, u32 nesting_depth) | ||||
object->AdditionalChildrenHandled(); | object->AdditionalChildrenHandled(); | ||||
if (!ManuallySetZ) | if (!ManuallySetZ) | ||||
{ | { | ||||
// Set it automatically to 10 plus its parents | // Set it automatically to 10 plus its parents | ||||
if (object->m_Absolute) | if (object->m_Absolute) | ||||
// If the object is absolute, we'll have to get the parent's Z buffered, | // If the object is absolute, we'll have to get the parent's Z buffered, | ||||
// and add to that! | // and add to that! | ||||
object->SetSetting<float>("z", pParent->GetBufferedZ() + 10.f, false); | object->m_Z.Set(pParent->GetBufferedZ() + 10.f, false); | ||||
else | else | ||||
// If the object is relative, then we'll just store Z as "10" | // If the object is relative, then we'll just store Z as "10" | ||||
object->SetSetting<float>("z", 10.f, false); | object->m_Z.Set(10.f, false); | ||||
} | } | ||||
if (!AddObject(*pParent, *object)) | if (!AddObject(*pParent, *object)) | ||||
delete object; | delete object; | ||||
} | } | ||||
void CGUI::Xeromyces_ReadRepeat(XMBElement Element, CXeromyces* pFile, IGUIObject* pParent, std::vector<std::pair<CStr, CStr> >& NameSubst, std::unordered_set<VfsPath>& Paths, u32 nesting_depth) | void CGUI::Xeromyces_ReadRepeat(XMBElement Element, CXeromyces* pFile, IGUIObject* pParent, std::vector<std::pair<CStr, CStr> >& NameSubst, std::unordered_set<VfsPath>& Paths, u32 nesting_depth) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 416 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator