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

Dungeon Main palette group card. More...

#include <palette_group_card.h>

Inheritance diagram for yaze::editor::DungeonMainPaletteCard:
Collaboration diagram for yaze::editor::DungeonMainPaletteCard:

Public Member Functions

 DungeonMainPaletteCard (Rom *rom)
 
 ~DungeonMainPaletteCard () override=default
 
- Public Member Functions inherited from yaze::editor::PaletteGroupCard
 PaletteGroupCard (const std::string &group_name, const std::string &display_name, Rom *rom)
 Construct a new Palette Group Card.
 
virtual ~PaletteGroupCard ()=default
 
void Draw ()
 Draw the card's ImGui UI.
 
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 ()
 

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.
 
- Protected Member Functions inherited from yaze::editor::PaletteGroupCard
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::PaletteGroupCard
std::string group_name_
 
std::string display_name_
 
Romrom_
 
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 card.

Manages palettes for dungeon rooms (0-19)

Definition at line 320 of file palette_group_card.h.

Constructor & Destructor Documentation

◆ DungeonMainPaletteCard()

yaze::editor::DungeonMainPaletteCard::DungeonMainPaletteCard ( Rom rom)
explicit

Definition at line 708 of file palette_group_card.cc.

◆ ~DungeonMainPaletteCard()

yaze::editor::DungeonMainPaletteCard::~DungeonMainPaletteCard ( )
overridedefault

Member Function Documentation

◆ GetPaletteGroup() [1/2]

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

Get the palette group for this card.

Implements yaze::editor::PaletteGroupCard.

Definition at line 741 of file palette_group_card.cc.

References yaze::Rom::mutable_palette_group(), and yaze::editor::PaletteGroupCard::rom_.

Here is the call graph for this function:

◆ GetPaletteGroup() [2/2]

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

◆ GetMetadata()

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

Get metadata for this palette group.

Implements yaze::editor::PaletteGroupCard.

Definition at line 328 of file palette_group_card.h.

References metadata_.

◆ DrawPaletteGrid()

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

◆ GetColorsPerRow()

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

Get the number of colors per row for grid layout.

Implements yaze::editor::PaletteGroupCard.

Definition at line 330 of file palette_group_card.h.

Referenced by DrawPaletteGrid().

◆ InitializeMetadata()

Member Data Documentation

◆ metadata_

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

Definition at line 334 of file palette_group_card.h.

Referenced by GetMetadata().


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