yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::DungeonMainPalettePanel Class Reference

Dungeon Main palette group panel. More...

#include <palette_group_panel.h>

Inheritance diagram for yaze::editor::DungeonMainPalettePanel:
Collaboration diagram for yaze::editor::DungeonMainPalettePanel:

Public Member Functions

 DungeonMainPalettePanel (Rom *rom, zelda3::GameData *game_data=nullptr)
 
 ~DungeonMainPalettePanel () override=default
 
- Public Member Functions inherited from yaze::editor::PaletteGroupPanel
 PaletteGroupPanel (const std::string &group_name, const std::string &display_name, Rom *rom, zelda3::GameData *game_data=nullptr)
 Construct a new Palette Group Panel.
 
void SetGameData (zelda3::GameData *game_data)
 
virtual ~PaletteGroupPanel ()=default
 
void Draw (bool *p_open) override
 Draw the card's ImGui UI.
 
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 Show ()
 
void Hide ()
 
bool IsVisible () const
 
bool * visibility_flag ()
 
absl::Status SaveToRom ()
 Save all modified palettes to ROM.
 
void DiscardChanges ()
 Discard all unsaved changes.
 
void ResetPalette (int palette_index)
 Reset a specific palette to original ROM values.
 
void ResetColor (int palette_index, int color_index)
 Reset a specific color to original ROM value.
 
void SetColor (int palette_index, int color_index, const gfx::SnesColor &new_color)
 Set a color value (records change for undo)
 
void Undo ()
 
void Redo ()
 
bool CanUndo () const
 
bool CanRedo () const
 
void ClearHistory ()
 
bool HasUnsavedChanges () const
 
bool IsPaletteModified (int palette_index) const
 
bool IsColorModified (int palette_index, int color_index) const
 
int GetSelectedPaletteIndex () const
 
void SetSelectedPaletteIndex (int index)
 
int GetSelectedColorIndex () const
 
void SetSelectedColorIndex (int index)
 
std::string ExportToJson () const
 
absl::Status ImportFromJson (const std::string &json)
 
std::string ExportToClipboard () const
 
absl::Status ImportFromClipboard ()
 
- 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.
 

Protected Member Functions

gfx::PaletteGroupGetPaletteGroup () override
 Get the palette group for this card.
 
const gfx::PaletteGroupGetPaletteGroup () const override
 
const PaletteGroupMetadataGetMetadata () const override
 Get metadata for this palette group.
 
void DrawPaletteGrid () override
 Draw the palette grid specific to this palette type.
 
int GetColorsPerRow () const override
 Get the number of colors per row for grid layout.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
int GetPriority () const override
 Get display priority for menu ordering.
 
- Protected Member Functions inherited from yaze::editor::PaletteGroupPanel
virtual void DrawCustomToolbarButtons ()
 Draw additional toolbar buttons (called after standard buttons)
 
virtual void DrawCustomPanels ()
 Draw additional panels (called after main content)
 
void DrawToolbar ()
 Draw standard toolbar with save/discard/undo/redo.
 
void DrawPaletteSelector ()
 Draw palette selector dropdown.
 
void DrawColorPicker ()
 Draw color picker for selected color.
 
void DrawColorInfo ()
 Draw color info panel with RGB/SNES/Hex values.
 
void DrawMetadataInfo ()
 Draw palette metadata info panel.
 
void DrawBatchOperationsPopup ()
 Draw batch operations popup.
 
gfx::SnesPaletteGetMutablePalette (int index)
 Get mutable palette by index.
 
gfx::SnesColor GetOriginalColor (int palette_index, int color_index) const
 Get original color from ROM (for reset/comparison)
 
absl::Status WriteColorToRom (int palette_index, int color_index, const gfx::SnesColor &color)
 Write a single color to ROM.
 
void MarkModified (int palette_index, int color_index)
 Mark palette as modified.
 
void ClearModified (int palette_index)
 Clear modified flags for palette.
 

Static Private Member Functions

static PaletteGroupMetadata InitializeMetadata ()
 

Static Private Attributes

static const PaletteGroupMetadata metadata_
 

Additional Inherited Members

- Protected Attributes inherited from yaze::editor::PaletteGroupPanel
std::string group_name_
 
std::string display_name_
 
Romrom_
 
zelda3::GameDatagame_data_ = nullptr
 
bool show_ = false
 
int selected_palette_ = 0
 
int selected_color_ = -1
 
gfx::SnesColor editing_color_
 
bool auto_save_enabled_ = false
 
bool show_snes_format_ = true
 
bool show_hex_format_ = true
 

Detailed Description

Dungeon Main palette group panel.

Manages palettes for dungeon rooms (0-19)

Definition at line 347 of file palette_group_panel.h.

Constructor & Destructor Documentation

◆ DungeonMainPalettePanel()

yaze::editor::DungeonMainPalettePanel::DungeonMainPalettePanel ( Rom * rom,
zelda3::GameData * game_data = nullptr )
explicit

Definition at line 729 of file palette_group_panel.cc.

◆ ~DungeonMainPalettePanel()

yaze::editor::DungeonMainPalettePanel::~DungeonMainPalettePanel ( )
overridedefault

Member Function Documentation

◆ GetPaletteGroup() [1/2]

gfx::PaletteGroup * yaze::editor::DungeonMainPalettePanel::GetPaletteGroup ( )
overrideprotectedvirtual

Get the palette group for this card.

Implements yaze::editor::PaletteGroupPanel.

Definition at line 761 of file palette_group_panel.cc.

References yaze::editor::PaletteGroupPanel::game_data_, yaze::gfx::PaletteGroupMap::get_group(), and yaze::zelda3::GameData::palette_groups.

Here is the call graph for this function:

◆ GetPaletteGroup() [2/2]

const gfx::PaletteGroup * yaze::editor::DungeonMainPalettePanel::GetPaletteGroup ( ) const
overrideprotectedvirtual

◆ GetMetadata()

const PaletteGroupMetadata & yaze::editor::DungeonMainPalettePanel::GetMetadata ( ) const
inlineoverrideprotectedvirtual

Get metadata for this palette group.

Implements yaze::editor::PaletteGroupPanel.

Definition at line 355 of file palette_group_panel.h.

References metadata_.

◆ DrawPaletteGrid()

void yaze::editor::DungeonMainPalettePanel::DrawPaletteGrid ( )
overrideprotectedvirtual

◆ GetColorsPerRow()

int yaze::editor::DungeonMainPalettePanel::GetColorsPerRow ( ) const
inlineoverrideprotectedvirtual

Get the number of colors per row for grid layout.

Implements yaze::editor::PaletteGroupPanel.

Definition at line 357 of file palette_group_panel.h.

Referenced by DrawPaletteGrid().

◆ GetIcon()

std::string yaze::editor::DungeonMainPalettePanel::GetIcon ( ) const
inlineoverrideprotectedvirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::EditorPanel.

Definition at line 360 of file palette_group_panel.h.

References ICON_MD_CASTLE.

◆ GetPriority()

int yaze::editor::DungeonMainPalettePanel::GetPriority ( ) const
inlineoverrideprotectedvirtual

Get display priority for menu ordering.

Returns
Priority value (lower = higher in list, default 50)

Reimplemented from yaze::editor::EditorPanel.

Definition at line 361 of file palette_group_panel.h.

◆ InitializeMetadata()

Member Data Documentation

◆ metadata_

const PaletteGroupMetadata yaze::editor::DungeonMainPalettePanel::metadata_
staticprivate
Initial value:

Definition at line 365 of file palette_group_panel.h.

Referenced by GetMetadata().


The documentation for this class was generated from the following files: