Panel for managing palettes applied to graphics sheets. More...
#include <palette_controls_panel.h>


Public Member Functions | |
| PaletteControlsPanel (GraphicsEditorState *state, Rom *rom, zelda3::GameData *game_data=nullptr) | |
| void | SetGameData (zelda3::GameData *game_data) |
| std::string | GetId () const override |
| Unique identifier for this panel. | |
| std::string | GetDisplayName () const override |
| Human-readable name shown in menus and title bars. | |
| std::string | GetIcon () const override |
| Material Design icon for this panel. | |
| std::string | GetEditorCategory () const override |
| Editor category this panel belongs to. | |
| int | GetPriority () const override |
| Get display priority for menu ordering. | |
| void | Initialize () |
| Initialize the panel. | |
| void | Draw (bool *p_open) override |
| Draw the palette controls UI (EditorPanel interface) | |
| absl::Status | Update () |
| Legacy Update method for backward compatibility. | |
Public Member Functions inherited from yaze::editor::EditorPanel | |
| virtual | ~EditorPanel ()=default |
| virtual void | OnOpen () |
| Called when panel becomes visible. | |
| virtual void | OnClose () |
| Called when panel is hidden. | |
| virtual void | OnFocus () |
| Called when panel receives focus. | |
| virtual PanelCategory | GetPanelCategory () const |
| Get the lifecycle category for this panel. | |
| virtual bool | IsEnabled () const |
| Check if this panel is currently enabled. | |
| virtual std::string | GetDisabledTooltip () const |
| Get tooltip text when panel is disabled. | |
| virtual std::string | GetShortcutHint () const |
| Get keyboard shortcut hint for display. | |
| virtual float | GetPreferredWidth () const |
| Get preferred width for this panel (optional) | |
| virtual bool | IsVisibleByDefault () const |
| Whether this panel should be visible by default. | |
| virtual std::string | GetParentPanelId () const |
| Get parent panel ID for cascade behavior. | |
| virtual bool | CascadeCloseChildren () const |
| Whether closing this panel should close child panels. | |
Private Member Functions | |
| void | DrawPresets () |
| Draw quick preset buttons. | |
| void | DrawPaletteGroupSelector () |
| Draw palette group selection. | |
| void | DrawPaletteDisplay () |
| Draw the current palette display. | |
| void | DrawApplyButtons () |
| Draw apply buttons. | |
| void | ApplyPaletteToSheet (uint16_t sheet_id) |
| Apply current palette to specified sheet. | |
| void | ApplyPaletteToAllSheets () |
| Apply current palette to all active sheets. | |
Private Attributes | |
| GraphicsEditorState * | state_ |
| Rom * | rom_ |
| zelda3::GameData * | game_data_ = nullptr |
Panel for managing palettes applied to graphics sheets.
Provides palette group selection, quick presets, and apply-to-sheet functionality.
Definition at line 20 of file palette_controls_panel.h.
|
inlineexplicit |
Definition at line 22 of file palette_controls_panel.h.
|
inline |
Definition at line 26 of file palette_controls_panel.h.
References game_data_.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 32 of file palette_controls_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 33 of file palette_controls_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 34 of file palette_controls_panel.h.
References ICON_MD_PALETTE.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 35 of file palette_controls_panel.h.
|
inlineoverridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 36 of file palette_controls_panel.h.
| void yaze::editor::PaletteControlsPanel::Initialize | ( | ) |
Initialize the panel.
Definition at line 15 of file palette_controls_panel.cc.
References yaze::editor::GraphicsEditorState::palette_group_index, yaze::editor::GraphicsEditorState::palette_index, state_, and yaze::editor::GraphicsEditorState::sub_palette_index.
|
overridevirtual |
Draw the palette controls UI (EditorPanel interface)
Implements yaze::editor::EditorPanel.
Definition at line 22 of file palette_controls_panel.cc.
References DrawApplyButtons(), DrawPaletteDisplay(), DrawPaletteGroupSelector(), DrawPresets(), yaze::Rom::is_loaded(), and rom_.
| absl::Status yaze::editor::PaletteControlsPanel::Update | ( | ) |
Legacy Update method for backward compatibility.
Definition at line 38 of file palette_controls_panel.cc.
References DrawApplyButtons(), DrawPaletteDisplay(), DrawPaletteGroupSelector(), DrawPresets(), yaze::Rom::is_loaded(), and rom_.
|
private |
Draw quick preset buttons.
Definition at line 55 of file palette_controls_panel.cc.
References HOVER_HINT, ICON_MD_ACCOUNT_BOX, ICON_MD_CASTLE, ICON_MD_LANDSCAPE, ICON_MD_MENU, ICON_MD_PERSON, yaze::editor::GraphicsEditorState::palette_group_index, yaze::editor::GraphicsEditorState::palette_index, yaze::editor::GraphicsEditorState::refresh_graphics, state_, and yaze::gui::TextWithSeparators().
Referenced by Draw(), and Update().

|
private |
Draw palette group selection.
Definition at line 100 of file palette_controls_panel.cc.
References HOVER_HINT, yaze::editor::GraphicsEditorState::palette_group_index, yaze::editor::GraphicsEditorState::palette_index, yaze::editor::GraphicsEditorState::refresh_graphics, state_, yaze::editor::GraphicsEditorState::sub_palette_index, and yaze::gui::TextWithSeparators().
Referenced by Draw(), and Update().

|
private |
Draw the current palette display.
Definition at line 130 of file palette_controls_panel.cc.
References game_data_, yaze::gfx::PaletteGroupMap::get_group(), yaze::editor::GraphicsEditorState::palette_group_index, yaze::zelda3::GameData::palette_groups, yaze::editor::GraphicsEditorState::palette_index, yaze::editor::GraphicsEditorState::refresh_graphics, state_, yaze::editor::GraphicsEditorState::sub_palette_index, and yaze::gui::TextWithSeparators().
Referenced by Draw(), and Update().

|
private |
Draw apply buttons.
Definition at line 217 of file palette_controls_panel.cc.
References ApplyPaletteToAllSheets(), ApplyPaletteToSheet(), yaze::editor::GraphicsEditorState::current_sheet_id, HOVER_HINT, ICON_MD_BRUSH, ICON_MD_CHECKLIST, ICON_MD_FORMAT_PAINT, ICON_MD_REFRESH, yaze::editor::GraphicsEditorState::open_sheets, yaze::editor::GraphicsEditorState::refresh_graphics, yaze::editor::GraphicsEditorState::selected_sheets, state_, and yaze::gui::TextWithSeparators().
Referenced by Draw(), and Update().

|
private |
Apply current palette to specified sheet.
Definition at line 260 of file palette_controls_panel.cc.
References game_data_, yaze::gfx::Arena::Get(), yaze::gfx::PaletteGroupMap::get_group(), yaze::Rom::is_loaded(), yaze::gfx::Arena::mutable_gfx_sheets(), yaze::gfx::Arena::NotifySheetModified(), yaze::gfx::PaletteGroup::palette(), yaze::editor::GraphicsEditorState::palette_group_index, yaze::zelda3::GameData::palette_groups, yaze::editor::GraphicsEditorState::palette_index, rom_, state_, and yaze::editor::GraphicsEditorState::sub_palette_index.
Referenced by DrawApplyButtons().
|
private |
Apply current palette to all active sheets.
Definition at line 279 of file palette_controls_panel.cc.
References game_data_, yaze::gfx::Arena::Get(), yaze::gfx::PaletteGroupMap::get_group(), yaze::Rom::is_loaded(), yaze::zelda3::kNumGfxSheets, yaze::gfx::Arena::mutable_gfx_sheets(), yaze::gfx::Arena::NotifySheetModified(), yaze::gfx::PaletteGroup::palette(), yaze::editor::GraphicsEditorState::palette_group_index, yaze::zelda3::GameData::palette_groups, yaze::editor::GraphicsEditorState::palette_index, rom_, state_, and yaze::editor::GraphicsEditorState::sub_palette_index.
Referenced by DrawApplyButtons().
|
private |
Definition at line 89 of file palette_controls_panel.h.
Referenced by ApplyPaletteToAllSheets(), ApplyPaletteToSheet(), DrawApplyButtons(), DrawPaletteDisplay(), DrawPaletteGroupSelector(), DrawPresets(), and Initialize().
|
private |
Definition at line 90 of file palette_controls_panel.h.
Referenced by ApplyPaletteToAllSheets(), ApplyPaletteToSheet(), Draw(), and Update().
|
private |
Definition at line 91 of file palette_controls_panel.h.
Referenced by ApplyPaletteToAllSheets(), ApplyPaletteToSheet(), DrawPaletteDisplay(), and SetGameData().