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 uint32_t TYPE

Constructors, destructors, conversion operators

PaletteCategoryUI()
~PaletteCategoryUI() virtual

Public functions

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

Public variables

UILayoutPtr mpLayout
The layout of the palette category, loaded using the ID in Palettes::PaletteCategory::mLayoutID.
int field_14
IWindowPtr mpMainFrame
The window that contains most important windows.
IWindowPtr mpArrowsPanel
The panel that will contain the page number and the arrow buttons to switch pages.
IWindowPtr mpDLCPanel
The panel that will contain the buttons for the DLC groups.
IWindowPtr mpColorPickersPanel
The window that contains the panels that will contain the color picker UI(s).
IWindowPtr mpPagePanel
The panel that will contain the current page itself.
IWindowPtr mpPageFrame
The window that contains all panels related with pages.
ColorPickerUIPtr mpColorPickerUI
The UI of the color picker buttons.
ColorPickerUIPtr 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
PaletteCategoryPtr mpCategory
The Palettes::PaletteCategory that this UI displays.
eastl::intrusive_ptr<PageArrowsUI> mpPageArrowsUI
The class that manages the piece of UI that displays the page number and the turn page buttons.
eastl::vector<int> field_74
eastl::vector<PageUIContainer> mPageUIs
PaletteSubcategoriesUIPtr mpSubcategoriesUI
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
uint32_t mPaintID
Math::ColorRGB mPrimaryColor
Math::ColorRGB mSecondaryColor
bool mPrimaryIsDefault
bool mSecondaryIsDefault
eastl::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 listener 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(UTFWin::IWindow* pWindow, const UTFWin::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

IWindowPtr Palettes::PaletteCategoryUI::mpMainFrame

The window that contains most important windows.

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

IWindowPtr 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.

IWindowPtr Palettes::PaletteCategoryUI::mpDLCPanel

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

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

IWindowPtr 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.

IWindowPtr Palettes::PaletteCategoryUI::mpPagePanel

The panel that will contain the current page itself.

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

IWindowPtr 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.

ColorPickerUIPtr Palettes::PaletteCategoryUI::mpColorPickerUI

The UI of the color picker buttons.

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

ColorPickerUIPtr 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.