Allows the user to view and edit in game palettes. More...
#include <palette_editor.h>

Public Member Functions | |
| PaletteEditor (Rom *rom=nullptr) | |
| void | Initialize () override |
| absl::Status | Load () override |
| absl::Status | Update () override |
| absl::Status | Cut () override |
| absl::Status | Copy () override |
| absl::Status | Paste () override |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| absl::Status | Find () override |
| absl::Status | Save () override |
| void | set_rom (Rom *rom) |
| Rom * | rom () const |
| void | JumpToPalette (const std::string &group_name, int palette_index) |
| Jump to a specific palette by group and index. | |
Public Member Functions inherited from yaze::editor::Editor | |
| Editor ()=default | |
| virtual | ~Editor ()=default |
| void | SetDependencies (const EditorDependencies &deps) |
| virtual absl::Status | Clear () |
| EditorType | type () const |
| bool * | active () |
| void | set_active (bool active) |
| void | toggle_active () |
| virtual bool | IsRomLoaded () const |
| virtual std::string | GetRomStatus () const |
Private Member Functions | |
| void | DrawToolset () |
| void | DrawControlPanel () |
| void | DrawQuickAccessCard () |
| void | DrawCustomPaletteCard () |
| void | DrawQuickAccessTab () |
| void | DrawCustomPalette () |
| Draw custom palette editor with enhanced ROM hacking features. | |
| absl::Status | DrawPaletteGroup (int category, bool right_side=false) |
| absl::Status | EditColorInPalette (gfx::SnesPalette &palette, int index) |
| absl::Status | ResetColorToOriginal (gfx::SnesPalette &palette, int index, const gfx::SnesPalette &originalPalette) |
| void | AddRecentlyUsedColor (const gfx::SnesColor &color) |
| absl::Status | HandleColorPopup (gfx::SnesPalette &palette, int i, int j, int n) |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::Editor | |
| std::string | MakeCardTitle (const std::string &base_title) const |
| std::string | MakeCardId (const std::string &base_id) const |
| template<typename T > | |
| absl::StatusOr< T > | SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const |
Protected Attributes inherited from yaze::editor::Editor | |
| bool | active_ = false |
| EditorType | type_ |
| EditorDependencies | dependencies_ |
Allows the user to view and edit in game palettes.
Definition at line 81 of file palette_editor.h.
|
inlineexplicit |
Definition at line 83 of file palette_editor.h.
References custom_palette_, yaze::editor::kPalette, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 186 of file palette_editor.cc.
References yaze::editor::EditorDependencies::card_registry, yaze::editor::Editor::dependencies_, ICON_MD_BRUSH, ICON_MD_CASTLE, ICON_MD_COLOR_LENS, ICON_MD_FILTER_1, ICON_MD_FILTER_2, ICON_MD_FILTER_3, ICON_MD_LANDSCAPE, ICON_MD_PALETTE, ICON_MD_PETS, ICON_MD_SHIELD, ICON_MD_WATER, yaze::editor::EditorCardRegistry::RegisterCard(), show_control_panel_, show_custom_palette_, show_dungeon_main_card_, show_equipment_card_, show_ow_animated_card_, show_ow_main_card_, show_quick_access_, show_sprite_card_, show_sprites_aux1_card_, show_sprites_aux2_card_, and show_sprites_aux3_card_.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 305 of file palette_editor.cc.
References yaze::project::ResourceLabelManager::CreateOrGetLabel(), dungeon_main_card_, equipment_card_, yaze::gfx::PaletteManager::Get(), yaze::gfx::PaletteManager::Initialize(), yaze::editor::kNumPalettes, ow_animated_card_, ow_main_card_, yaze::Rom::resource_label(), rom(), rom_, sprite_card_, sprites_aux1_card_, sprites_aux2_card_, and sprites_aux3_card_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 336 of file palette_editor.cc.
References yaze::gui::EditorCard::Begin(), control_panel_minimized_, DrawControlPanel(), DrawCustomPaletteCard(), DrawQuickAccessCard(), dungeon_main_card_, yaze::gui::EditorCard::End(), equipment_card_, ICON_MD_PALETTE, yaze::Rom::is_loaded(), ow_animated_card_, ow_main_card_, rom_, yaze::gui::EditorCard::SetDefaultSize(), show_control_panel_, show_custom_palette_, show_dungeon_main_card_, show_equipment_card_, show_ow_animated_card_, show_ow_main_card_, show_quick_access_, show_sprite_card_, show_sprites_aux1_card_, show_sprites_aux2_card_, show_sprites_aux3_card_, sprite_card_, sprites_aux1_card_, sprites_aux2_card_, and sprites_aux3_card_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 91 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 92 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 93 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 94 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 95 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 96 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 97 of file palette_editor.h.
|
inline |
|
inline |
Definition at line 100 of file palette_editor.h.
References rom_.
Referenced by DrawPaletteGroup(), Load(), and set_rom().
| void yaze::editor::PaletteEditor::JumpToPalette | ( | const std::string & | group_name, |
| int | palette_index | ||
| ) |
Jump to a specific palette by group and index.
| group_name | The palette group name (e.g., "ow_main", "dungeon_main") |
| palette_index | The palette index within the group |
Definition at line 1125 of file palette_editor.cc.
References dungeon_main_card_, equipment_card_, ow_animated_card_, ow_main_card_, show_control_panel_, show_dungeon_main_card_, show_equipment_card_, show_ow_animated_card_, show_ow_main_card_, show_sprite_card_, show_sprites_aux1_card_, show_sprites_aux2_card_, show_sprites_aux3_card_, sprite_card_, sprites_aux1_card_, sprites_aux2_card_, and sprites_aux3_card_.
Referenced by yaze::editor::palette_utility::DrawInlineColorEdit(), and yaze::editor::palette_utility::DrawPaletteJumpButton().
|
private |
Definition at line 752 of file palette_editor.cc.
Referenced by DrawControlPanel().
|
private |
Definition at line 757 of file palette_editor.cc.
References yaze::editor::EditorDependencies::card_registry, control_panel_minimized_, yaze::editor::Editor::dependencies_, yaze::gfx::PaletteManager::DiscardAllChanges(), DrawToolset(), dungeon_main_card_, equipment_card_, yaze::gfx::PaletteManager::Get(), yaze::gfx::PaletteManager::GetModifiedColorCount(), yaze::gfx::PaletteManager::HasUnsavedChanges(), ICON_MD_DASHBOARD, ICON_MD_MINIMIZE, ICON_MD_PALETTE, ow_animated_card_, ow_main_card_, yaze::gfx::PaletteManager::SaveAllToRom(), show_control_panel_, show_custom_palette_, show_dungeon_main_card_, show_equipment_card_, show_ow_animated_card_, show_ow_main_card_, show_quick_access_, show_sprite_card_, sprite_card_, sprites_aux1_card_, sprites_aux2_card_, and sprites_aux3_card_.
Referenced by Update().
|
private |
Definition at line 955 of file palette_editor.cc.
References yaze::gui::EditorCard::Begin(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, yaze::gui::EditorCard::End(), F32_TO_INT8_SAT, ICON_MD_COLOR_LENS, yaze::editor::kColorPopupFlags, yaze::editor::kPalButtonFlags, recently_used_colors_, yaze::gfx::SnesColor::rgb(), yaze::gui::EditorCard::Right, yaze::gui::EditorCard::SetDefaultSize(), yaze::gui::EditorCard::SetPosition(), show_quick_access_, yaze::gfx::SnesColor::snes(), and yaze::gui::SnesColorEdit4().
Referenced by Update().
|
private |
Definition at line 1013 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::EditorCard::Begin(), yaze::gui::EditorCard::Bottom, yaze::gui::ConvertSnesColorToImVec4(), current_color_, custom_palette_, edit_palette_index_, yaze::gui::EditorCard::End(), ICON_MD_ADD, ICON_MD_BRUSH, ICON_MD_CONTENT_COPY, ICON_MD_DELETE, yaze::editor::kColorPopupFlags, yaze::editor::kPalButtonFlags, yaze::gui::EditorCard::SetDefaultSize(), yaze::gui::EditorCard::SetPosition(), show_custom_palette_, and yaze::gui::SnesColorEdit4().
Referenced by Update().
|
private |
Definition at line 440 of file palette_editor.cc.
References yaze::gui::ConvertSnesColorToImVec4(), current_color_, DrawCustomPalette(), F32_TO_INT8_SAT, yaze::editor::kColorPopupFlags, recently_used_colors_, yaze::gfx::SnesColor::rgb(), yaze::gfx::SnesColor::snes(), and yaze::gui::SnesColorEdit4().
|
private |
Draw custom palette editor with enhanced ROM hacking features.
Enhanced Features:
Performance Notes:
Definition at line 506 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, custom_palette_, edit_palette_index_, yaze::editor::kColorPopupFlags, and yaze::gui::SnesColorEdit4().
Referenced by DrawQuickAccessTab().

|
private |
Definition at line 591 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, HandleColorPopup(), yaze::gfx::PaletteGroup::mutable_palette(), yaze::Rom::mutable_palette_group(), yaze::Rom::resource_label(), RETURN_IF_ERROR, rom(), yaze::project::ResourceLabelManager::SelectableLabelWithNameEdit(), yaze::gfx::SnesPalette::size(), and yaze::gfx::PaletteGroup::size().
|
private |
Definition at line 717 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertImVec4ToSnesColor(), and yaze::gfx::SnesPalette::size().

|
private |
Definition at line 736 of file palette_editor.cc.
References yaze::gui::ConvertImVec4ToSnesColor(), and yaze::gfx::SnesPalette::size().

|
private |
Definition at line 642 of file palette_editor.cc.
References recently_used_colors_.
Referenced by DrawCustomPalette(), DrawCustomPaletteCard(), DrawPaletteGroup(), EditColorInPalette(), and HandleColorPopup().
|
private |
Definition at line 662 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gfx::ConvertRgbToSnes(), custom_palette_, F32_TO_INT8_SAT, history_, yaze::editor::kColorPopupFlags, yaze::editor::palette_internal::PaletteEditorHistory::RecordChange(), yaze::gui::SnesColorEdit4(), and yaze::gfx::ToFloatArray().
Referenced by DrawPaletteGroup().
|
private |
Definition at line 125 of file palette_editor.h.
|
private |
Definition at line 126 of file palette_editor.h.
Referenced by DrawCustomPalette(), DrawCustomPaletteCard(), DrawPaletteGroup(), DrawQuickAccessCard(), and DrawQuickAccessTab().
|
private |
Definition at line 128 of file palette_editor.h.
|
private |
Definition at line 130 of file palette_editor.h.
Referenced by DrawCustomPalette(), DrawCustomPaletteCard(), HandleColorPopup(), and PaletteEditor().
|
private |
Definition at line 131 of file palette_editor.h.
Referenced by AddRecentlyUsedColor(), DrawQuickAccessCard(), and DrawQuickAccessTab().
|
private |
Definition at line 133 of file palette_editor.h.
Referenced by DrawCustomPalette(), and DrawCustomPaletteCard().
|
private |
Definition at line 135 of file palette_editor.h.
|
private |
Definition at line 137 of file palette_editor.h.
Referenced by HandleColorPopup().
|
private |
|
private |
Definition at line 142 of file palette_editor.h.
Referenced by DrawControlPanel(), Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 143 of file palette_editor.h.
Referenced by DrawControlPanel(), Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 144 of file palette_editor.h.
Referenced by DrawControlPanel(), Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 145 of file palette_editor.h.
Referenced by DrawControlPanel(), Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 146 of file palette_editor.h.
Referenced by DrawControlPanel(), Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 147 of file palette_editor.h.
Referenced by Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 148 of file palette_editor.h.
Referenced by Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 149 of file palette_editor.h.
Referenced by Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 150 of file palette_editor.h.
Referenced by DrawControlPanel(), Initialize(), JumpToPalette(), and Update().
|
private |
Definition at line 151 of file palette_editor.h.
Referenced by DrawControlPanel(), DrawQuickAccessCard(), Initialize(), and Update().
|
private |
Definition at line 152 of file palette_editor.h.
Referenced by DrawControlPanel(), DrawCustomPaletteCard(), Initialize(), and Update().
|
private |
Definition at line 153 of file palette_editor.h.
Referenced by DrawControlPanel(), and Update().
|
private |
Definition at line 156 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().
|
private |
Definition at line 157 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().
|
private |
Definition at line 158 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().
|
private |
Definition at line 159 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().
|
private |
Definition at line 160 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().
|
private |
Definition at line 161 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().
|
private |
Definition at line 162 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().
|
private |
Definition at line 163 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), Load(), and Update().