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 | 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. | |
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 |
| Rom * | rom () const |
| zelda3::GameData * | game_data () const |
| EditorContext | context () const |
| bool | HasContext () const |
Private Member Functions | |
| void | DrawToolset () |
| void | DrawControlPanel () |
| void | DrawQuickAccessPanel () |
| void | DrawCustomPalettePanel () |
| void | DrawCategorizedPaletteList () |
| void | DrawSearchBar () |
| bool | PassesSearchFilter (const std::string &group_name) const |
| bool * | GetShowFlagForGroup (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 | MakePanelId (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 82 of file palette_editor.h.
|
inlineexplicit |
Definition at line 84 of file palette_editor.h.
References custom_palette_, yaze::editor::kPalette, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 195 of file palette_editor.cc.
References 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::EditorDependencies::panel_manager, 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_, and show_sprites_aux3_panel_.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 392 of file palette_editor.cc.
References 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(), gfx_group_editor_, yaze::gfx::PaletteManager::Initialize(), yaze::editor::kNumPalettes, ow_anim_panel_, ow_main_panel_, yaze::editor::EditorDependencies::panel_manager, yaze::Rom::resource_label(), rom(), rom_, yaze::editor::GfxGroupEditor::SetGameData(), yaze::editor::GfxGroupEditor::SetRom(), sprite_aux1_panel_, sprite_aux2_panel_, sprite_aux3_panel_, and sprite_global_panel_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 510 of file palette_editor.cc.
|
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.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 492 of file palette_editor.cc.
References yaze::gfx::PaletteManager::Get(), and yaze::gfx::PaletteManager::Undo().

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

|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 97 of file palette_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 478 of file palette_editor.cc.
References yaze::gfx::PaletteManager::Get(), yaze::Rom::is_loaded(), RETURN_IF_ERROR, rom_, and yaze::Rom::set_dirty().

|
inline |
|
inline |
Definition at line 101 of file palette_editor.h.
References rom_.
Referenced by DrawPaletteGroup(), Load(), and set_rom().
|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 104 of file palette_editor.h.
References yaze::editor::Editor::game_data(), gfx_group_editor_, yaze::editor::GfxGroupEditor::SetGameData(), 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 1236 of file palette_editor.cc.
References yaze::editor::Editor::dependencies_, dungeon_main_panel_, equipment_panel_, ow_anim_panel_, ow_main_panel_, yaze::editor::EditorDependencies::panel_manager, yaze::editor::EditorDependencies::session_id, yaze::editor::PaletteGroupPanel::SetSelectedPaletteIndex(), yaze::editor::PaletteGroupPanel::Show(), sprite_aux1_panel_, sprite_aux2_panel_, sprite_aux3_panel_, and sprite_global_panel_.
Referenced by yaze::editor::palette_utility::DrawInlineColorEdit(), and yaze::editor::palette_utility::DrawPaletteJumpButton().

|
private |
Definition at line 846 of file palette_editor.cc.
Referenced by DrawControlPanel().
|
private |
Definition at line 851 of file palette_editor.cc.
References yaze::gfx::PaletteManager::ApplyPreviewChanges(), control_panel_minimized_, yaze::editor::Editor::dependencies_, yaze::gfx::PaletteManager::DiscardAllChanges(), DrawCategorizedPaletteList(), DrawToolset(), dungeon_main_panel_, equipment_panel_, yaze::gfx::PaletteManager::Get(), yaze::gfx::PaletteManager::GetModifiedColorCount(), yaze::editor::PaletteGroupPanel::HasUnsavedChanges(), yaze::gfx::PaletteManager::HasUnsavedChanges(), ICON_MD_DASHBOARD, ICON_MD_MINIMIZE, ICON_MD_PALETTE, ICON_MD_SAVE, ICON_MD_UNDO, ICON_MD_VISIBILITY, yaze::gui::PopupNames::kConfirmDiscardAll, yaze::gui::EditorNames::kPalette, yaze::gui::PopupNames::kPalettePanelManager, yaze::gui::PopupNames::kSaveError, yaze::gui::MakePopupId(), ow_anim_panel_, ow_main_panel_, yaze::editor::EditorDependencies::panel_manager, yaze::gfx::PaletteManager::SaveAllToRom(), show_control_panel_, sprite_aux1_panel_, sprite_aux2_panel_, sprite_aux3_panel_, and sprite_global_panel_.
Referenced by Load().
|
private |
Definition at line 1060 of file palette_editor.cc.
References yaze::gui::PanelWindow::Begin(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, yaze::gui::PanelWindow::End(), F32_TO_INT8_SAT, ICON_MD_COLOR_LENS, yaze::editor::kColorPopupFlags, yaze::editor::kPalButtonFlags, recently_used_colors_, yaze::gfx::SnesColor::rgb(), yaze::gui::PanelWindow::Right, yaze::gui::PanelWindow::SetDefaultSize(), yaze::gui::PanelWindow::SetPosition(), show_quick_access_, yaze::gfx::SnesColor::snes(), and yaze::gui::SnesColorEdit4().
Referenced by Load().
|
private |
Definition at line 1119 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::PanelWindow::Begin(), yaze::gui::PanelWindow::Bottom, yaze::gui::ConvertSnesColorToImVec4(), current_color_, custom_palette_, edit_palette_index_, yaze::gui::PanelWindow::End(), ICON_MD_ADD, ICON_MD_BRUSH, ICON_MD_CONTENT_COPY, ICON_MD_DELETE, yaze::editor::kColorPopupFlags, yaze::editor::kPalButtonFlags, yaze::gui::EditorNames::kPalette, yaze::gui::MakePopupId(), yaze::gui::PanelWindow::SetDefaultSize(), yaze::gui::PanelWindow::SetPosition(), show_custom_palette_, and yaze::gui::SnesColorEdit4().
Referenced by Load().
|
private |
Definition at line 1332 of file palette_editor.cc.
References DrawSearchBar(), yaze::gfx::PaletteManager::Get(), yaze::editor::GetGroupDisplayName(), yaze::editor::GetPaletteCategories(), GetShowFlagForGroup(), PassesSearchFilter(), show_custom_palette_, and show_quick_access_.
Referenced by DrawControlPanel().
|
private |
Definition at line 1303 of file palette_editor.cc.
References ICON_MD_SEARCH, and search_buffer_.
Referenced by DrawCategorizedPaletteList().
|
private |
Definition at line 1312 of file palette_editor.cc.
References yaze::gui::FuzzyMatch(), yaze::editor::GetGroupDisplayName(), and search_buffer_.
Referenced by DrawCategorizedPaletteList().

|
private |
Definition at line 1320 of file palette_editor.cc.
References show_dungeon_main_panel_, show_equipment_panel_, show_ow_animated_panel_, show_ow_main_panel_, show_sprite_panel_, show_sprites_aux1_panel_, show_sprites_aux2_panel_, and show_sprites_aux3_panel_.
Referenced by DrawCategorizedPaletteList().
|
private |
Definition at line 517 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 584 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 674 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, yaze::editor::Editor::game_data(), yaze::gfx::PaletteGroupMap::get_group(), HandleColorPopup(), yaze::gfx::PaletteGroup::mutable_palette(), yaze::zelda3::GameData::palette_groups, 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 811 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertImVec4ToSnesColor(), and yaze::gfx::SnesPalette::size().

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

|
private |
Definition at line 727 of file palette_editor.cc.
References recently_used_colors_.
Referenced by DrawCustomPalette(), DrawCustomPalettePanel(), DrawPaletteGroup(), EditColorInPalette(), and HandleColorPopup().
|
private |
Definition at line 747 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gfx::ConvertRgbToSnes(), custom_palette_, F32_TO_INT8_SAT, history_, yaze::editor::kColorPopupFlags, yaze::gui::PopupNames::kCopyPopup, yaze::gui::EditorNames::kPalette, yaze::gui::MakePopupId(), yaze::editor::palette_internal::PaletteEditorHistory::RecordChange(), yaze::gui::SnesColorEdit4(), and yaze::gfx::ToFloatArray().
Referenced by DrawPaletteGroup().
|
private |
Definition at line 138 of file palette_editor.h.
|
private |
Definition at line 139 of file palette_editor.h.
Referenced by DrawCustomPalette(), DrawCustomPalettePanel(), DrawPaletteGroup(), DrawQuickAccessPanel(), and DrawQuickAccessTab().
|
private |
Definition at line 141 of file palette_editor.h.
Referenced by Load(), and SetGameData().
|
private |
Definition at line 143 of file palette_editor.h.
Referenced by DrawCustomPalette(), DrawCustomPalettePanel(), HandleColorPopup(), and PaletteEditor().
|
private |
Definition at line 144 of file palette_editor.h.
Referenced by AddRecentlyUsedColor(), DrawQuickAccessPanel(), and DrawQuickAccessTab().
|
private |
Definition at line 146 of file palette_editor.h.
Referenced by DrawCustomPalette(), and DrawCustomPalettePanel().
|
private |
Definition at line 148 of file palette_editor.h.
|
private |
Definition at line 150 of file palette_editor.h.
Referenced by HandleColorPopup().
|
private |
Definition at line 152 of file palette_editor.h.
Referenced by Initialize(), Load(), rom(), Save(), and set_rom().
|
private |
Definition at line 155 of file palette_editor.h.
Referenced by DrawSearchBar(), and PassesSearchFilter().
|
private |
Definition at line 158 of file palette_editor.h.
Referenced by DrawControlPanel(), and Initialize().
|
private |
Definition at line 159 of file palette_editor.h.
Referenced by DrawControlPanel().
|
private |
Definition at line 162 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 163 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 164 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 165 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 166 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 167 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 168 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 169 of file palette_editor.h.
Referenced by GetShowFlagForGroup(), and Initialize().
|
private |
Definition at line 170 of file palette_editor.h.
Referenced by DrawCategorizedPaletteList(), DrawQuickAccessPanel(), and Initialize().
|
private |
Definition at line 171 of file palette_editor.h.
Referenced by DrawCategorizedPaletteList(), DrawCustomPalettePanel(), and Initialize().
|
private |
Definition at line 175 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().
|
private |
Definition at line 176 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().
|
private |
Definition at line 177 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().
|
private |
Definition at line 178 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().
|
private |
Definition at line 179 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().
|
private |
Definition at line 180 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().
|
private |
Definition at line 181 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().
|
private |
Definition at line 182 of file palette_editor.h.
Referenced by DrawControlPanel(), JumpToPalette(), and Load().