Palettes::PaletteMain class

This object represents the palette of an editor.

An editor can have two palettes, one for build mode and the other for paint mode. Palettes contain categories (Palettes::PaletteCategory), which in turn contain pages (Palettes::PalettePage).

Base classes

class DefaultRefCounted
The default implementation of a reference counted class.
class Object
This class represents a basic reference counted object.

Public static variables

static const uint32_t TYPE

Constructors, destructors, conversion operators

PaletteMain()
~PaletteMain() virtual

Public functions

auto ReadProp(const ResourceKey& name, uint32_t creationTypeID = -1, uint32_t arg_8 = 0, uint32_t layoutID = 0, uint32_t categoryLayoutID = 0, uint32_t pageLayoutID = 0, uint32_t arg_18 = 0) -> bool
Loads the configuration .prop file of this palette, as well as all the page palettes that use it.
auto ReadModuleProp(const ResourceKey& name) -> void
Loads the configuration .prop of a module that makes up this palette.
auto GetCategory(uint32_t categoryID) -> PaletteCategory*
Returns the category or subcategory in this palette that has the specified instance ID.
auto GetCategoryAt(size_t nIndex) -> PaletteCategory*
Returns the category that is at the specified index.
auto Unload() -> void
auto AddRef() -> int override
auto Release() -> int override
auto Cast(uint32_t) const -> void* override

Public variables

eastl::vector<PaletteCategoryPtr> mCategories
A vector with all the categories used in this palette.
uint32_t mLayoutID
The instance ID of the user interface layout file used by the palette.
uint32_t mCategoryLayoutID
An instance ID that points to the layout categories must use.
uint32_t mPageLayoutID
An instance ID that points to the layout pages must use.
uint32_t field_2C
uint32_t mThumbnailGroupID
The ID of the folder that contains the icons for the parts in the palette, such as 0x02231C8B ('CreaturePartIcons~').
uint32_t field_34
Related to mThumbnailGroupID.
uint32_t mnStartupCategory
The index of the category that will be selected when the editor is first opened.
uint32_t mCreationTypeID
The type of creature, as an ID, that the editor of this palette is editing (for example, 'creature').

Function documentation

bool Palettes::PaletteMain::ReadProp(const ResourceKey& name, uint32_t creationTypeID = -1, uint32_t arg_8 = 0, uint32_t layoutID = 0, uint32_t categoryLayoutID = 0, uint32_t pageLayoutID = 0, uint32_t arg_18 = 0)

Loads the configuration .prop file of this palette, as well as all the page palettes that use it.

Parameters
name The ResourceKey that points to the .prop file.
creationTypeID The ID that represents the type of creation of the editor, such as 'creature'.
arg_8 Sets the field_34 value; it's a folder ID used for icons, but only on very specific occasions.
layoutID The default instance ID of the layout file that the palette must use. If this is specified, the 'palettePaletteLayoutID' property willbe ignored.
categoryLayoutID An instance ID that points to the layout categories must use. If this is specified, the 'paletteCategoryLayoutFile' property on each category will be ignored.
pageLayoutID An instance ID that points to the layout pages must use. If this is specified, the 'palettePageLayoutFile' property on each page will be ignored.
arg_18 A value that will be set in field_2C.
Returns True if the .prop file existed and was read, false otherwise.

All the modules (i.e. prop files that contain a list with all the pages used by the palette) will be loaded; modules are expected to be inside a folder with ID 0x406B6BXX, where XX are the last two digits of the instance ID of the palette .prop file.

void Palettes::PaletteMain::ReadModuleProp(const ResourceKey& name)

Loads the configuration .prop of a module that makes up this palette.

Parameters
name The ResourceKey that points to the .prop file.

A certain palette can have infinite modules that can belong to different mods; each module .prop just contains a list of pages that belong to the palette. This method will load all those pages as well, using the Palettes::PalettePage::Load() method. All the categories used by the pages will be loaded as well, using the Palettes::PaletteCategory::ReadProp() method.

PaletteCategory* Palettes::PaletteMain::GetCategory(uint32_t categoryID)

Returns the category or subcategory in this palette that has the specified instance ID.

Parameters
categoryID The instance ID of the category to return.
Returns The Palettes::PaletteCategory which has that ID, or nullptr if no category has it.

This method will check recursively on all the categories and their children categories (if any). If no category has the given ID, nullptr will be returned.

PaletteCategory* Palettes::PaletteMain::GetCategoryAt(size_t nIndex)

Returns the category that is at the specified index.

Parameters
nIndex The index the category is at in the vector.
Returns The Palettes::PaletteCategory at that index. If the index is out of bounds, the behaviour is undefined.

Categories are generally ordered by the Palettes::PaletteCategory::mnSequenceNumber field, with the ones that have the lowest value being first.

Variable documentation

uint32_t Palettes::PaletteMain::mLayoutID

The instance ID of the user interface layout file used by the palette.

This layout is the bar at the top that displays the category buttons. It must also have a window with ControlID 0x93019DBC that will contain the category page. By default it's 0x8511B8A.

uint32_t Palettes::PaletteMain::mCategoryLayoutID

An instance ID that points to the layout categories must use.

If this is specified, the 'paletteCategoryLayoutFile' property on each category will be ignored.

uint32_t Palettes::PaletteMain::mPageLayoutID

An instance ID that points to the layout pages must use.

If this is specified, the 'palettePageLayoutFile' property on each page will be ignored.

uint32_t Palettes::PaletteMain::field_34

Related to mThumbnailGroupID.

It's only used in the Captain Outfitter palette (not the one from the Create Menu, but the one you unlock in the game).

uint32_t Palettes::PaletteMain::mnStartupCategory

The index of the category that will be selected when the editor is first opened.

For instance, if the value is 0, the first category will be selected.