UTFWin::UILayout class

An object used to load and contain user interfaces.

An instance of this object can be used to load SPUI interfaces into the game UI. Example usage:

UILayout layout;
layout.Load(u"EditorCameraUI");

Base classes

class DefaultRefCounted
The default implementation of a reference counted class.

Public types

enum Defaults { kDefaultGroup = 0x40464100, kDefaultType = 0x510A95B, kDefaultParameter = 0x5B598FA }

Constructors, destructors, conversion operators

UILayout()
~UILayout()

Public functions

auto Load(const ResourceKey& resourceKey, bool = true, uint32_t = kDefaultParameter) -> bool
Loads a user interface from a file.
auto LoadByID(uint32_t instanceID, uint32_t groupID = kDefaultGroup, uint32_t typeID = kDefaultType, bool = true, uint32_t = kDefaultParameter) -> bool
An easier version of the UILayout::Load() method; this verison only requires the instance ID of the layout file, although other parameters can be specified.
auto LoadByName(const char16_t* pLayoutName, uint32_t groupID = kDefaultGroup, bool = true, uint32_t = kDefaultParameter) -> bool
Loads a user interface from a file.
auto FindWindowByID(uint32_t controlID, bool bRecursive = true) -> IWindow*
Returns the first child window that has the given controlID.
auto SetParentWindow(IWindow* pParent, bool = true, uint32_t = kDefaultParameter) -> bool
auto SetVisible(bool value) -> bool
Switches the visibility of all the layout.
auto IsVisible() -> bool
auto GetContainerWindow() -> IWindow*
Returns the window that contains the UI layout.

Protected functions

auto Delete(int) -> void

Protected variables

ResourceKey mResourceKey
UILayoutObjectsPtr mpLayoutObjects

Function documentation

bool UTFWin::UILayout::Load(const ResourceKey& resourceKey, bool = true, uint32_t = kDefaultParameter)

Loads a user interface from a file.

Parameters
resourceKey The ResourceKey of the file that must be loaded. The groupID should be UILayout::kDefaultGroup, and the typeID UILayout::kDefaultType.

The user interface is expected to be in the SPUI format or an (undocumented) .xml format. A new IWindow will be created and added to the main window; the main windows of the user interface loaded will be added as children of that new container window.

bool UTFWin::UILayout::LoadByName(const char16_t* pLayoutName, uint32_t groupID = kDefaultGroup, bool = true, uint32_t = kDefaultParameter)

Loads a user interface from a file.

Parameters
pLayoutName
groupID [Optional] The ID of the group where the file is stored, usually UILayout::kDefaultGroup.

The user interface is expected to be in the SPUI format or an (undocumented) .xml format. A new IWindow will be created and added to the main window; the main windows of the user interface loaded will be added as children of that new container window. This method will just process the resource name and call UILayout::Load().

IWindow* UTFWin::UILayout::FindWindowByID(uint32_t controlID, bool bRecursive = true)

Returns the first child window that has the given controlID.

Parameters
controlID The controlID of the window to find.
bRecursive Whether the children hierarchy should be checked as well, true by default. If false, only the main windows will be checked.
Returns The first window in the hierarchy that has the given controlID, or nullptr if there is no match.

By default, this also checks on the children' children, so the controlID is searched in all the window hierarchy.

bool UTFWin::UILayout::SetVisible(bool value)

Switches the visibility of all the layout.

Parameters
value