1#ifndef YAZE_APP_EDITOR_GRAPHICS_PALETTE_GROUP_CARD_H
2#define YAZE_APP_EDITOR_GRAPHICS_PALETTE_GROUP_CARD_H
7#include <unordered_map>
8#include <unordered_set>
11#include "absl/status/status.h"
15#include "imgui/imgui.h"
76 const std::string& display_name,
115 void ResetColor(
int palette_index,
int color_index);
The Rom class is used to load, save, and modify Rom data.
Dungeon Main palette group card.
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
static PaletteGroupMetadata InitializeMetadata()
~DungeonMainPaletteCard() override=default
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
static const PaletteGroupMetadata metadata_
Equipment/Armor palette group card.
static const PaletteGroupMetadata metadata_
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
static PaletteGroupMetadata InitializeMetadata()
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
~EquipmentPaletteCard() override=default
Overworld Animated palette group card.
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
~OverworldAnimatedPaletteCard() override=default
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
static PaletteGroupMetadata InitializeMetadata()
static const PaletteGroupMetadata metadata_
Overworld Main palette group card.
static PaletteGroupMetadata InitializeMetadata()
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
~OverworldMainPaletteCard() override=default
static const PaletteGroupMetadata metadata_
Base class for palette group editing cards.
void DrawPaletteSelector()
Draw palette selector dropdown.
absl::Status SaveToRom()
Save all modified palettes to ROM.
gfx::SnesPalette * GetMutablePalette(int index)
Get mutable palette by index.
absl::Status ImportFromClipboard()
virtual gfx::PaletteGroup * GetPaletteGroup()=0
Get the palette group for this card.
void MarkModified(int palette_index, int color_index)
Mark palette as modified.
bool IsColorModified(int palette_index, int color_index) const
void DrawColorPicker()
Draw color picker for selected color.
virtual ~PaletteGroupCard()=default
virtual int GetColorsPerRow() const =0
Get the number of colors per row for grid layout.
int GetSelectedPaletteIndex() const
void SetColor(int palette_index, int color_index, const gfx::SnesColor &new_color)
Set a color value (records change for undo)
void DrawBatchOperationsPopup()
Draw batch operations popup.
gfx::SnesColor editing_color_
virtual void DrawCustomToolbarButtons()
Draw additional toolbar buttons (called after standard buttons)
void DrawToolbar()
Draw standard toolbar with save/discard/undo/redo.
virtual void DrawCustomPanels()
Draw additional panels (called after main content)
int GetSelectedColorIndex() const
void ClearModified(int palette_index)
Clear modified flags for palette.
virtual void DrawPaletteGrid()=0
Draw the palette grid specific to this palette type.
void SetSelectedPaletteIndex(int index)
virtual const PaletteGroupMetadata & GetMetadata() const =0
Get metadata for this palette group.
void ResetPalette(int palette_index)
Reset a specific palette to original ROM values.
gfx::SnesColor GetOriginalColor(int palette_index, int color_index) const
Get original color from ROM (for reset/comparison)
std::string ExportToClipboard() const
absl::Status WriteColorToRom(int palette_index, int color_index, const gfx::SnesColor &color)
Write a single color to ROM.
void ResetColor(int palette_index, int color_index)
Reset a specific color to original ROM value.
void DrawMetadataInfo()
Draw palette metadata info panel.
void DrawColorInfo()
Draw color info panel with RGB/SNES/Hex values.
std::string display_name_
bool IsPaletteModified(int palette_index) const
virtual const gfx::PaletteGroup * GetPaletteGroup() const =0
void SetSelectedColorIndex(int index)
void DiscardChanges()
Discard all unsaved changes.
bool HasUnsavedChanges() const
void Draw()
Draw the card's ImGui UI.
std::string ExportToJson() const
absl::Status ImportFromJson(const std::string &json)
Global Sprite palette group card.
static const PaletteGroupMetadata metadata_
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
static PaletteGroupMetadata InitializeMetadata()
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
void DrawCustomPanels() override
Draw additional panels (called after main content)
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
~SpritePaletteCard() override=default
Sprites Aux1 palette group card.
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
static const PaletteGroupMetadata metadata_
static PaletteGroupMetadata InitializeMetadata()
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
~SpritesAux1PaletteCard() override=default
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
Sprites Aux2 palette group card.
~SpritesAux2PaletteCard() override=default
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
static PaletteGroupMetadata InitializeMetadata()
static const PaletteGroupMetadata metadata_
Sprites Aux3 palette group card.
~SpritesAux3PaletteCard() override=default
int GetColorsPerRow() const override
Get the number of colors per row for grid layout.
static PaletteGroupMetadata InitializeMetadata()
const PaletteGroupMetadata & GetMetadata() const override
Get metadata for this palette group.
void DrawPaletteGrid() override
Draw the palette grid specific to this palette type.
gfx::PaletteGroup * GetPaletteGroup() override
Get the palette group for this card.
static const PaletteGroupMetadata metadata_
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Main namespace for the application.
Represents a single color change for undo/redo.
gfx::SnesColor original_color
Represents a group of palettes.