Palettes::PaletteItem class

Represents an item inside a palette page.

The functionality of the item is not defined here; this class only has metadata related to the display of the item itself. Each item has one thumbnail image, the icon.

Base classes

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

Public types

enum ItemType { kItemBlock = 0xA2E50993, kItemCreation = 0x674AB27, kItemBlockPaint = 0xBD110A25, kItemBlockPaintTheme = 0x17D37D90, kItemSkinPaint = 0x2B61CC2D, kItemSkinPaintTheme = 0xDEE3D8A8, kItemPaintLikeThis = 0x800B7988, kItemTribeTool = 0x0FCAFD26, kItemOutfitter = 0x42BF8C1D, kItemCityStyle = 0x2B885DF4, kItemCityVehicle = 0x8BFAC054, kItemCityBuilding = 0x81C74DBC }
The supported types of palette items, which are selected depending on the file extension or the value of the 'paletteItemType' property.

Public static variables

static const uint32_t TYPE

Constructors, destructors, conversion operators

PaletteItem()
~PaletteItem() virtual

Public functions

auto Load(const ResourceKey& name, int nPagePartPriority, uint32_t thumbnailGroupID) -> bool
Loads the configuration of a specific palette item.
auto AddRef() -> int override
auto Release() -> int override
auto Cast(uint32_t) const -> void* override

Public variables

ResourceKey mName
The ResourceKey of the object that represents this item.
ResourceKey mThumbnailName
The ResourceKey of the image that will be used as the thumbnail of the item.
uint32_t mTypeID
An ID that determines the type of this block. Common IDs are in the Palettes::PaletteItem::ItemType enum.
uint32_t mUnlockableIconID
The instance ID of the icon image used when the item is unlockable (but has not been unlocked yet).
ResourceKey mUnlockableLayoutName
The name of the UI layout used when the item is unlockable (but has not been unlocked yet).
uint32_t mNotUnlockableIconID
The instance ID of the icon image used when the item is locked and not unlockable.
ResourceKey mNotUnlockableLayoutName
The name of the UI layout used when the item is locked and not unlockable.
int mnPartPriority
bool mbEnabledLockedRollover
ObjectPtr field_50

Enum documentation

enum Palettes::PaletteItem::ItemType

The supported types of palette items, which are selected depending on the file extension or the value of the 'paletteItemType' property.

There might be more that are undocumented.

Enumerators
kItemBlock

The item used when the item is a .png image file.

kItemCreation

The item used when the item is a creation (that is .vcl, .crt, .cll, etc files).

kItemBlockPaint

The item used in paints (not themes) for block creations (building, vehicle and ufo).

kItemBlockPaintTheme

The item used in paint themes for skin creations (building, vehicle and ufo).

kItemSkinPaint

The item used in paints (not themes) for skin creations (creature, cell and flora).

kItemSkinPaintTheme

The item used in paint themes for skin creations (creature, cell and flora).

kItemPaintLikeThis

The 'Paint Like This' item in paint mode.

kItemTribeTool

kItemOutfitter

kItemCityStyle

kItemCityVehicle

The item used to select vehicles in cities/colonies.

kItemCityBuilding

The item used to select buildings in cities/colonies.

Function documentation

bool Palettes::PaletteItem::Load(const ResourceKey& name, int nPagePartPriority, uint32_t thumbnailGroupID)

Loads the configuration of a specific palette item.

Parameters
name The ResourceKey of the item. If no typeID is specified, it will be assumed to be 'prop'.
nPagePartPriority The priority of the items module.
thumbnailGroupID The group ID of the folder where the icon images are stored.
Returns True if the item is of a recognised type, false otherwise.

This only sets fields related to the item configuration, and not specific to the item type itself. The item type will be set according to the file extension in the 'name' parameter: