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

Public Member Functions | |
| PaletteEditor (Rom *rom=nullptr) | |
| void | SetDependencies (const EditorDependencies &deps) override |
| 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 |
| bool | CanUndo () const override |
| bool | CanRedo () const override |
| bool | CanCut () const override |
| bool | CanCopy () const override |
| bool | CanPaste () const override |
| absl::Status | Save () override |
| absl::Status | BeginSaveTransaction () override |
| void | RollbackSaveTransaction () override |
| void | CommitSaveTransaction () override |
| void | set_rom (Rom *rom) |
| Rom * | rom () const |
| void | SetGameData (zelda3::GameData *game_data) override |
| void | JumpToPalette (const std::string &group_name, int palette_index) |
| Jump to a specific palette by group and index. | |
| absl::Status | ReloadPaletteCatalog () |
| const core::PaletteCatalog * | palette_catalog () const |
| const absl::Status & | palette_catalog_status () const |
Public Member Functions inherited from yaze::editor::Editor | |
| Editor ()=default | |
| virtual | ~Editor ()=default |
| virtual void | PrepareForSessionTeardown () |
| virtual std::string | GetUndoDescription () const |
| virtual std::string | GetRedoDescription () const |
| const UndoManager & | undo_manager () const |
| virtual absl::Status | Clear () |
| virtual bool | CanFind () const |
| virtual void | ContributeStatus (StatusBar *) |
| virtual EditorContextSnapshot | BuildContextSnapshot () const |
| EditorType | type () const |
| bool * | active () |
| void | set_active (bool active) |
| void | toggle_active () |
| virtual bool | IsRomLoaded () const |
| virtual std::string | GetRomStatus () const |
| Rom * | rom () const |
| zelda3::GameData * | game_data () const |
| project::YazeProject * | project () const |
| core::VersionManager * | version_manager () const |
| EditorContext | context () const |
| bool | HasContext () const |
Private Member Functions | |
| void | DrawControlPanel () |
| void | DrawPaletteCatalog () |
| void | RefreshPaletteCatalogIfChanged () |
| void | DrawQuickAccessPanel () |
| void | DrawCustomPalettePanel () |
| void | RefreshPanelReferences () |
| void | ApplyPanelDependencies () |
| void | DrawCategorizedPaletteList () |
| void | DrawSearchBar () |
| bool | PassesSearchFilter (const std::string &group_name) const |
| PaletteGroupPanel * | GetPanelForGroup (const std::string &group_name) |
| 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 | MakePanelTitle (const std::string &base_title) const |
| std::string | MakeWindowId (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_ |
| UndoManager | undo_manager_ |
Allows the user to view and edit in game palettes.
Definition at line 83 of file palette_editor.h.
|
inlineexplicit |
Definition at line 85 of file palette_editor.h.
References custom_palette_, yaze::editor::kPalette, and yaze::editor::Editor::type_.
|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 528 of file palette_editor.cc.
References ApplyPanelDependencies(), RefreshPaletteCatalogIfChanged(), and yaze::editor::Editor::SetDependencies().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 291 of file palette_editor.cc.
References yaze::editor::WindowPresentationPolicy::CoreWorkspace(), 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::Rom::is_loaded(), yaze::editor::WindowPresentationPolicy::OptionalPopOut(), rom_, yaze::editor::EditorDependencies::session_id, show_control_panel_, show_custom_palette_, show_dungeon_main_panel_, show_equipment_panel_, show_ow_animated_panel_, show_ow_main_panel_, show_quick_access_, show_sprite_panel_, show_sprites_aux1_panel_, show_sprites_aux2_panel_, show_sprites_aux3_panel_, and yaze::editor::EditorDependencies::window_manager.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 599 of file palette_editor.cc.
References ApplyPanelDependencies(), yaze::project::ResourceLabelManager::CreateOrGetLabel(), yaze::editor::Editor::dependencies_, DrawControlPanel(), DrawCustomPalettePanel(), DrawQuickAccessPanel(), dungeon_main_panel_, equipment_panel_, yaze::editor::Editor::game_data(), yaze::gfx::PaletteManager::Get(), yaze::gfx::PaletteManager::Initialize(), yaze::gfx::kNumPalettes, ow_anim_panel_, ow_main_panel_, yaze::Rom::resource_label(), rom(), rom_, sprite_aux1_panel_, sprite_aux2_panel_, sprite_aux3_panel_, sprite_global_panel_, and yaze::editor::EditorDependencies::window_manager.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 769 of file palette_editor.cc.
|
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.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 749 of file palette_editor.cc.
References yaze::editor::Editor::game_data(), yaze::gfx::PaletteManager::Get(), and yaze::gfx::PaletteManager::Undo().
Referenced by DrawControlPanel().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 759 of file palette_editor.cc.
References yaze::editor::Editor::game_data(), yaze::gfx::PaletteManager::Get(), and yaze::gfx::PaletteManager::Redo().
Referenced by DrawControlPanel().

|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 99 of file palette_editor.h.
|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 739 of file palette_editor.cc.
References yaze::editor::Editor::game_data(), and yaze::gfx::PaletteManager::Get().
Referenced by DrawControlPanel().

|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 744 of file palette_editor.cc.
References yaze::editor::Editor::game_data(), and yaze::gfx::PaletteManager::Get().
Referenced by DrawControlPanel().

|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 103 of file palette_editor.h.
|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 104 of file palette_editor.h.
|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 105 of file palette_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 708 of file palette_editor.cc.
References yaze::editor::Editor::dependencies_, yaze::editor::Editor::game_data(), yaze::gfx::PaletteManager::Get(), yaze::project::YazeProject::hack_manifest, yaze::Rom::is_loaded(), yaze::core::HackManifest::loaded(), yaze::editor::EditorDependencies::project, RETURN_IF_ERROR, rom_, yaze::project::YazeProject::rom_metadata, yaze::Rom::set_dirty(), yaze::editor::EditorDependencies::toast_manager, yaze::editor::ValidateHackManifestSaveConflicts(), and yaze::project::RomMetadata::write_policy.
|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 691 of file palette_editor.cc.
References yaze::editor::Editor::game_data(), and yaze::gfx::PaletteManager::Get().

|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 700 of file palette_editor.cc.
References yaze::gfx::PaletteManager::Get(), and yaze::gfx::PaletteManager::RollbackSaveTransaction().

|
overridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 704 of file palette_editor.cc.
References yaze::gfx::PaletteManager::CommitSaveTransaction(), and yaze::gfx::PaletteManager::Get().

|
inline |
|
inline |
Definition at line 112 of file palette_editor.h.
References rom_.
Referenced by DrawPaletteGroup(), Load(), and set_rom().
|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 115 of file palette_editor.h.
References yaze::editor::Editor::game_data(), and yaze::editor::Editor::SetGameData().

| 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 1376 of file palette_editor.cc.
References yaze::editor::Editor::dependencies_, GetPanelForGroup(), yaze::editor::WorkspaceWindowManager::OpenWindow(), RefreshPanelReferences(), selected_group_, yaze::editor::EditorDependencies::session_id, and yaze::editor::EditorDependencies::window_manager.
Referenced by yaze::editor::palette_utility::DrawInlineColorEdit(), DrawPaletteCatalog(), and yaze::editor::palette_utility::DrawPaletteJumpButton().

| absl::Status yaze::editor::PaletteEditor::ReloadPaletteCatalog | ( | ) |
Definition at line 20 of file palette_editor_catalog.cc.
References catalog_path_, catalog_project_, catalog_project_file_, catalog_query_, catalog_session_id_, catalog_status_, catalog_use_, catalog_world_, yaze::editor::Editor::dependencies_, yaze::project::YazeProject::filepath, yaze::core::PaletteCatalog::LoadForProject(), palette_catalog_, yaze::project::YazeProject::palette_catalog_file, yaze::editor::Editor::project(), and yaze::editor::EditorDependencies::session_id.
Referenced by DrawPaletteCatalog(), and RefreshPaletteCatalogIfChanged().

|
inline |
Definition at line 127 of file palette_editor.h.
References palette_catalog_.
|
inline |
Definition at line 130 of file palette_editor.h.
References catalog_status_.
|
private |
Definition at line 1095 of file palette_editor.cc.
References yaze::gui::AutoRegisterLastItem(), CanRedo(), CanUndo(), yaze::editor::Editor::dependencies_, yaze::Rom::dirty(), DrawCategorizedPaletteList(), DrawPaletteCatalog(), yaze::editor::Editor::game_data(), yaze::gfx::PaletteManager::Get(), yaze::editor::GetGroupDisplayName(), GetPanelForGroup(), ICON_MD_MORE_HORIZ, ICON_MD_OPEN_IN_NEW, ICON_MD_REDO, ICON_MD_SAVE, ICON_MD_UNDO, yaze::editor::kError, yaze::editor::WorkspaceWindowManager::OpenWindow(), Redo(), RefreshPaletteCatalogIfChanged(), RefreshPanelReferences(), rom_, selected_group_, yaze::editor::EditorDependencies::session_id, yaze::editor::ToastManager::Show(), show_catalog_, yaze::gui::ThemedIconButton(), yaze::editor::EditorDependencies::toast_manager, yaze::editor::WorkspaceWindowManager::TriggerSaveRom(), Undo(), and yaze::editor::EditorDependencies::window_manager.
Referenced by Load().
|
private |
Definition at line 43 of file palette_editor_catalog.cc.
References yaze::gui::AutoRegisterLastItem(), catalog_query_, catalog_status_, catalog_use_, catalog_world_, yaze::editor::Editor::dependencies_, GetPanelForGroup(), JumpToPalette(), palette_catalog_, ReloadPaletteCatalog(), show_catalog_, and yaze::editor::EditorDependencies::window_manager.
Referenced by DrawControlPanel().

|
private |
Definition at line 10 of file palette_editor_catalog.cc.
References catalog_path_, catalog_project_, catalog_project_file_, catalog_session_id_, yaze::editor::Editor::dependencies_, yaze::editor::Editor::project(), ReloadPaletteCatalog(), and yaze::editor::EditorDependencies::session_id.
Referenced by DrawControlPanel(), and SetDependencies().

|
private |
Definition at line 1208 of file palette_editor.cc.
References yaze::gui::ConvertSnesColorToImVec4(), current_color_, F32_TO_INT8_SAT, yaze::editor::kColorPopupFlags, yaze::editor::kPalButtonFlags, recently_used_colors_, yaze::gfx::SnesColor::rgb(), yaze::gfx::SnesColor::snes(), and yaze::gui::SnesColorEdit4().
Referenced by Load().

|
private |
Definition at line 1259 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, custom_palette_, edit_palette_index_, ICON_MD_ADD, ICON_MD_CONTENT_COPY, ICON_MD_DELETE, yaze::editor::kColorPopupFlags, yaze::editor::kPalButtonFlags, yaze::gui::EditorNames::kPalette, yaze::gui::MakePopupId(), and yaze::gui::SnesColorEdit4().
Referenced by Load().

|
private |
Definition at line 545 of file palette_editor.cc.
References yaze::editor::Editor::dependencies_, dungeon_main_panel_, equipment_panel_, ow_anim_panel_, ow_main_panel_, rom_, yaze::editor::EditorDependencies::session_id, sprite_aux1_panel_, sprite_aux2_panel_, sprite_aux3_panel_, sprite_global_panel_, and yaze::editor::EditorDependencies::window_manager.
Referenced by ApplyPanelDependencies(), DrawControlPanel(), and JumpToPalette().
|
private |
Definition at line 578 of file palette_editor.cc.
References yaze::editor::Editor::dependencies_, dungeon_main_panel_, equipment_panel_, ow_anim_panel_, ow_main_panel_, yaze::editor::EditorDependencies::project, RefreshPanelReferences(), sprite_aux1_panel_, sprite_aux2_panel_, sprite_aux3_panel_, sprite_global_panel_, and yaze::editor::EditorDependencies::toast_manager.
Referenced by Load(), and SetDependencies().

|
private |
Definition at line 1411 of file palette_editor.cc.
References yaze::gui::AutoRegisterLastItem(), DrawSearchBar(), yaze::gfx::PaletteManager::Get(), yaze::editor::GetGroupDisplayName(), yaze::editor::GetPaletteCategories(), GetPanelForGroup(), PassesSearchFilter(), and selected_group_.
Referenced by DrawControlPanel().
|
private |
Definition at line 1393 of file palette_editor.cc.
References ICON_MD_SEARCH, and search_buffer_.
Referenced by DrawCategorizedPaletteList().
|
private |
Definition at line 1402 of file palette_editor.cc.
References yaze::gui::FuzzyMatch(), yaze::editor::GetGroupDisplayName(), and search_buffer_.
Referenced by DrawCategorizedPaletteList().

|
private |
Definition at line 1356 of file palette_editor.cc.
References dungeon_main_panel_, equipment_panel_, ow_anim_panel_, ow_main_panel_, sprite_aux1_panel_, sprite_aux2_panel_, sprite_aux3_panel_, and sprite_global_panel_.
Referenced by DrawCategorizedPaletteList(), DrawControlPanel(), DrawPaletteCatalog(), and JumpToPalette().
|
private |
Definition at line 776 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 843 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, custom_palette_, edit_palette_index_, yaze::editor::kColorPopupFlags, yaze::gui::EditorNames::kPalette, yaze::gui::MakePopupId(), and yaze::gui::SnesColorEdit4().
Referenced by DrawQuickAccessTab().

|
private |
Definition at line 923 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, yaze::editor::Editor::game_data(), yaze::gfx::PaletteGroupMap::get_group(), HandleColorPopup(), history_, yaze::gfx::PaletteGroup::mutable_palette(), yaze::zelda3::GameData::palette_groups, yaze::editor::palette_internal::PaletteEditorHistory::RecordChange(), 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 1060 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertImVec4ToSnesColor(), and yaze::gfx::SnesPalette::size().

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

|
private |
Definition at line 995 of file palette_editor.cc.
References recently_used_colors_.
Referenced by DrawCustomPalette(), DrawCustomPalettePanel(), DrawPaletteGroup(), EditColorInPalette(), and HandleColorPopup().
|
private |
Definition at line 1015 of file palette_editor.cc.
References AddRecentlyUsedColor(), custom_palette_, F32_TO_INT8_SAT, history_, ICON_MD_ADD, ICON_MD_CONTENT_COPY, yaze::editor::kColorPopupFlags, yaze::editor::palette_internal::PaletteEditorHistory::RecordChange(), yaze::gui::SnesColorCopyMenuItems(), yaze::gui::SnesColorEdit4(), and yaze::gfx::ToFloatArray().
Referenced by DrawPaletteGroup().
|
private |
Definition at line 146 of file palette_editor.h.
Referenced by DrawCategorizedPaletteList(), DrawControlPanel(), and JumpToPalette().
|
private |
Definition at line 148 of file palette_editor.h.
Referenced by DrawPaletteCatalog(), palette_catalog(), and ReloadPaletteCatalog().
|
private |
Definition at line 149 of file palette_editor.h.
Referenced by DrawPaletteCatalog(), palette_catalog_status(), and ReloadPaletteCatalog().
|
private |
Definition at line 150 of file palette_editor.h.
Referenced by RefreshPaletteCatalogIfChanged(), and ReloadPaletteCatalog().
|
private |
Definition at line 151 of file palette_editor.h.
Referenced by RefreshPaletteCatalogIfChanged(), and ReloadPaletteCatalog().
|
private |
Definition at line 152 of file palette_editor.h.
Referenced by RefreshPaletteCatalogIfChanged(), and ReloadPaletteCatalog().
|
private |
Definition at line 153 of file palette_editor.h.
Referenced by RefreshPaletteCatalogIfChanged(), and ReloadPaletteCatalog().
|
private |
Definition at line 154 of file palette_editor.h.
Referenced by DrawPaletteCatalog(), and ReloadPaletteCatalog().
|
private |
Definition at line 155 of file palette_editor.h.
Referenced by DrawPaletteCatalog(), and ReloadPaletteCatalog().
|
private |
Definition at line 156 of file palette_editor.h.
Referenced by DrawPaletteCatalog(), and ReloadPaletteCatalog().
|
private |
Definition at line 157 of file palette_editor.h.
Referenced by DrawControlPanel(), and DrawPaletteCatalog().
|
private |
Definition at line 169 of file palette_editor.h.
|
private |
Definition at line 170 of file palette_editor.h.
Referenced by DrawCustomPalette(), DrawCustomPalettePanel(), DrawPaletteGroup(), DrawQuickAccessPanel(), and DrawQuickAccessTab().
|
private |
Definition at line 172 of file palette_editor.h.
Referenced by DrawCustomPalette(), DrawCustomPalettePanel(), HandleColorPopup(), and PaletteEditor().
|
private |
Definition at line 173 of file palette_editor.h.
Referenced by AddRecentlyUsedColor(), DrawQuickAccessPanel(), and DrawQuickAccessTab().
|
private |
Definition at line 175 of file palette_editor.h.
Referenced by DrawCustomPalette(), and DrawCustomPalettePanel().
|
private |
Definition at line 177 of file palette_editor.h.
|
private |
Definition at line 179 of file palette_editor.h.
Referenced by DrawPaletteGroup(), and HandleColorPopup().
|
private |
Definition at line 181 of file palette_editor.h.
Referenced by DrawControlPanel(), Initialize(), Load(), RefreshPanelReferences(), rom(), Save(), and set_rom().
|
private |
Definition at line 184 of file palette_editor.h.
Referenced by DrawSearchBar(), and PassesSearchFilter().
|
private |
Definition at line 187 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 189 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 190 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 191 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 192 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 193 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 194 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 195 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 196 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 197 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 198 of file palette_editor.h.
Referenced by Initialize().
|
private |
Definition at line 202 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().
|
private |
Definition at line 203 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().
|
private |
Definition at line 204 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().
|
private |
Definition at line 205 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().
|
private |
Definition at line 206 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().
|
private |
Definition at line 207 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().
|
private |
Definition at line 208 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().
|
private |
Definition at line 209 of file palette_editor.h.
Referenced by ApplyPanelDependencies(), GetPanelForGroup(), Load(), and RefreshPanelReferences().