Palettes::PaletteCategoryUI class

This class holds all information related with the user interface of a palette category.

It's the UI representation of a Palettes::PaletteCategory.

Base classes

class App::IMessageListener
An interface that can receive messages sent through the app.
class UTFWin::IWinProc
This class is a window procedure, also known as an event/message listener.
class DefaultRefCounted
The default implementation of a reference counted class.

Public types

struct PageUIContainer
enum ControlIDs { kControlDLCPanel = 0x05D122C0, kControlArrowsPanel = 0x92DF6FD8, kControlPagePanel = 0x05D1754B, kControlPageFrame = 0x5D17546, kControlMainFrame = 0x52DF67AF, kControlColorPicker = 0x3304221B, kControlColorPicker2 = 0x3304221C, kControlColorPickersPanel = 0x5D3F56B }

Public static variables

static const static uint32_t TYPE

Constructors, destructors, conversion operators

PaletteCategoryUI()
~PaletteCategoryUI() virtual

Public functions

void Load(PaletteCategory* pCategory, IWindow* pWindow, void*)
void LoadPages(PaletteCategory* pCategory, void*)
void FlipPage(int nDeltaPage)
Changes the current page, moving it the specified number of pages.
void Update(int msTime)
auto HandleMessage(uint32_t messageID, void* msg) -> bool override
Called every time a message is received.
auto AddRef() -> int virtual
auto Release() -> int virtual
auto Cast(uint32_t) -> void* virtual
auto GetEventFlags() const -> int override
Gets the flags that represent which type of messages this IWinProc can handle.
auto HandleUIMessage(IWindow* pWindow, const Message& message) -> bool override
Method called every time a message is received on a window that has this IWinProc added.

Public variables

intrusive_ptr<UILayout> mpLayout
The layout of the palette category, loaded using the ID in Palettes::PaletteCategory::mLayoutID.
int field_14
intrusive_ptr<IWindow> mpMainFrame
The window that contains most important windows.
intrusive_ptr<IWindow> mpArrowsPanel
The panel that will contain the page number and the arrow buttons to switch pages.
intrusive_ptr<IWindow> mpDLCPanel
The panel that will contain the buttons for the DLC groups.
intrusive_ptr<IWindow> mpColorPickersPanel
The window that contains the panels that will contain the color picker UI(s).
intrusive_ptr<IWindow> mpPagePanel
The panel that will contain the current page itself.
intrusive_ptr<IWindow> mpPageFrame
The window that contains all panels related with pages.
intrusive_ptr<ColorPickerUI> mpColorPickerUI
The UI of the color picker buttons.
intrusive_ptr<ColorPickerUI> mpColorPickerUI2
The UI of the secondary color picker buttons (like in the building editor).
Math::Rectangle mColorPickerArea
The area occupied by the color picker UI.
Math::Rectangle mColorPickerArea2
The area occupied by the secondary color picker UI. If it doesn't exist, it's the same as the primary one.
Math::Rectangle mTotalColorPickerArea
The area occupied by both color picker UIs.
int field_68
intrusive_ptr<PaletteCategory> mpCategory
The Palettes::PaletteCategory that this UI displays.
intrusive_ptr<PageArrowsUI> mpPageArrowsUI
The class that manages the piece of UI that displays the page number and the turn page buttons.
vector<int> field_74
vector<PageUIContainer> mPageUIs
int field_9C
int field_A0
int field_A4
int field_A8
int field_AC
int field_B0
int field_B4
int field_B8
int field_BC
int field_C0
int field_C4
int field_C8
Math::ColorRGB field_CC
Math::ColorRGB field_D8
bool field_E4
bool field_E5
vector<int> field_E8

Enum documentation

enum Palettes::PaletteCategoryUI::ControlIDs

Enumerators
kControlDLCPanel

The ControlID of the panel that will contain the buttons for the DLC groups.

kControlArrowsPanel

The ControlID of the panel that will contain the page number and the arrow buttons to switch pages.

kControlPagePanel

The ControlID of the panel that will contain the current page itself.

kControlPageFrame

The ControlID of the window that contains all panels related with pages.

kControlMainFrame

The ControlID of the window that contains most important windows.

kControlColorPicker

The ControlID of the window that will contain the color picker buttons.

kControlColorPicker2

The ControlID of the window that will contain the secondary color picker buttons (like in the building editor).

kControlColorPickersPanel

The ControlID of the window that contains the panels that will contain the color picker UI(s).

Function documentation

void Palettes::PaletteCategoryUI::FlipPage(int nDeltaPage)

Changes the current page, moving it the specified number of pages.

Parameters
nDeltaPage The number of pages to move (negative to move backwards).

If the number is negative, it will move to a previous page.

bool Palettes::PaletteCategoryUI::HandleMessage(uint32_t messageID, void* msg) override

Called every time a message is received.

Parameters
messageID The ID of the message received.
msg The data of the message received, it might be nullptr.
Returns Whether the message was handled or not.

Only the messages with an ID this listened signed up for will call this event.

int Palettes::PaletteCategoryUI::GetEventFlags() const override

Gets the flags that represent which type of messages this IWinProc can handle.

This allows for better performance, since generally a procedure only needs to listen specific events. The flags are in the kEventFlag... values.

bool Palettes::PaletteCategoryUI::HandleUIMessage(IWindow* pWindow, const Message& message) override

Method called every time a message is received on a window that has this IWinProc added.

Parameters
pWindow The window that received this message.
message The message received.
Returns Whether the message was handled or not.

This method is responsible of handling (or not) the message. This method receives the IWindow that is currently receiving the message; this way, the same IWinProc can be listening for more than one window. This method returns whether the message was handled or not; if it was handled, no other IWinProcs will be called on that window.

Variable documentation

intrusive_ptr<IWindow> Palettes::PaletteCategoryUI::mpMainFrame

The window that contains most important windows.

It corresponds to the Palettes::PaletteCategoryUI::ControlIDs::kControlMainFrame window.

intrusive_ptr<IWindow> Palettes::PaletteCategoryUI::mpArrowsPanel

The panel that will contain the page number and the arrow buttons to switch pages.

It corresponds to the Palettes::PaletteCategoryUI::ControlIDs::kControlArrowsPanel window.

intrusive_ptr<IWindow> Palettes::PaletteCategoryUI::mpDLCPanel

The panel that will contain the buttons for the DLC groups.

It corresponds to the Palettes::PaletteCategoryUI::ControlIDs::kControlDLCPanel window.

intrusive_ptr<IWindow> Palettes::PaletteCategoryUI::mpColorPickersPanel

The window that contains the panels that will contain the color picker UI(s).

It corresponds to the Palettes::PaletteCategoryUI::ControlIDs::kControlColorPickersPanel window.

intrusive_ptr<IWindow> Palettes::PaletteCategoryUI::mpPagePanel

The panel that will contain the current page itself.

It corresponds to the Palettes::PaletteCategoryUI::ControlIDs::kControlPagePanel window.

intrusive_ptr<IWindow> Palettes::PaletteCategoryUI::mpPageFrame

The window that contains all panels related with pages.

This window contains the mpArrowsPanel, mpDLCPanel and mpPagePanel windows. It corresponds to the Palettes::PaletteCategoryUI::ControlIDs::kControlPageFrame window.

intrusive_ptr<ColorPickerUI> Palettes::PaletteCategoryUI::mpColorPickerUI

The UI of the color picker buttons.

It is generated and added to the Palettes::PaletteCategoryUI::ControlIDs::kControlColorPicker window.

intrusive_ptr<ColorPickerUI> Palettes::PaletteCategoryUI::mpColorPickerUI2

The UI of the secondary color picker buttons (like in the building editor).

It is generated and added to the Palettes::PaletteCategoryUI::ControlIDs::kControlColorPicker2 window.

Math::Rectangle Palettes::PaletteCategoryUI::mTotalColorPickerArea

The area occupied by both color picker UIs.

They are expected to be one on top of the other and to have the same width.