DungeonEditorV2 - Simplified dungeon editor using component delegation. More...
#include <dungeon_editor_v2.h>

Classes | |
| struct | PendingSwap |
Public Member Functions | |
| DungeonEditorV2 (Rom *rom=nullptr) | |
| ~DungeonEditorV2 () override | |
| void | SetGameData (zelda3::GameData *game_data) override |
| void | Initialize (gfx::IRenderer *renderer, Rom *rom) |
| void | Initialize () override |
| absl::Status | Load () |
| absl::Status | Update () override |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| absl::Status | Cut () override |
| absl::Status | Copy () override |
| absl::Status | Paste () override |
| absl::Status | Find () override |
| absl::Status | Save () override |
| void | SetRom (Rom *rom) |
| Rom * | rom () const |
| void | add_room (int room_id) |
| void | FocusRoom (int room_id) |
| void | SelectObject (int obj_id) |
| void | SetAgentMode (bool enabled) |
| bool | IsRomLoaded () const override |
| std::string | GetRomStatus () const override |
| void | ShowPanel (const std::string &card_id) |
| int | current_room_id () const |
| const ImVector< int > & | active_rooms () const |
| ObjectEditorPanel * | object_editor_panel () const |
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 () |
| Rom * | rom () const |
| zelda3::GameData * | game_data () const |
| EditorContext | context () const |
| bool | HasContext () const |
Static Public Attributes | |
| static constexpr const char * | kControlPanelId = "dungeon.control_panel" |
| static constexpr const char * | kRoomSelectorId = "dungeon.room_selector" |
| static constexpr const char * | kEntranceListId = "dungeon.entrance_list" |
| static constexpr const char * | kRoomMatrixId = "dungeon.room_matrix" |
| static constexpr const char * | kRoomGraphicsId = "dungeon.room_graphics" |
| static constexpr const char * | kObjectToolsId = "dungeon.object_tools" |
| static constexpr const char * | kPaletteEditorId = "dungeon.palette_editor" |
Private Member Functions | |
| void | DrawRoomPanels () |
| void | DrawRoomTab (int room_id) |
| void | ProcessDeferredTextures () |
| void | OnRoomSelected (int room_id, bool request_focus=true) |
| void | OnEntranceSelected (int entrance_id) |
| void | SwapRoomInPanel (int old_room_id, int new_room_id) |
| void | HandleObjectPlaced (const zelda3::RoomObject &obj) |
| DungeonCanvasViewer * | GetViewerForRoom (int room_id) |
| void | PushUndoSnapshot (int room_id) |
| absl::Status | RestoreFromSnapshot (int room_id, std::vector< zelda3::RoomObject > snapshot) |
| void | ClearRedo (int room_id) |
| void | ProcessPendingSwap () |
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_ |
DungeonEditorV2 - Simplified dungeon editor using component delegation.
This is a drop-in replacement for DungeonEditor that properly delegates to the component system instead of implementing everything inline.
Architecture:
The editor acts as a coordinator, not an implementer.
OWNED by DungeonEditorV2 (use unique_ptr or direct member):
EXTERNALLY OWNED (raw pointers, lifetime managed elsewhere):
OWNED BY PanelManager (registered EditorPanels):
Panel pointers are stored for convenience access but should NOT be deleted by this class. PanelManager owns them.
Definition at line 74 of file dungeon_editor_v2.h.
|
inlineexplicit |
Definition at line 76 of file dungeon_editor_v2.h.
References yaze::zelda3::CreateDungeonEditorSystem(), dungeon_editor_system_, yaze::editor::kDungeon, rom(), rooms_, and yaze::editor::Editor::type_.

|
override |
Definition at line 51 of file dungeon_editor_v2.cc.
References item_editor_panel_, object_editor_panel_, yaze::editor::ItemEditorPanel::SetCanvasViewer(), yaze::editor::ObjectEditorPanel::SetCanvasViewer(), yaze::editor::SpriteEditorPanel::SetCanvasViewer(), and sprite_editor_panel_.

|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 89 of file dungeon_editor_v2.h.
References yaze::editor::Editor::dependencies_, dungeon_editor_system_, yaze::editor::EditorDependencies::game_data, yaze::editor::Editor::game_data(), game_data_, object_editor_panel_, room_loader_, room_viewers_, rooms_, yaze::editor::DungeonRoomLoader::SetGameData(), and yaze::editor::ObjectEditorPanel::SetGameData().

| void yaze::editor::DungeonEditorV2::Initialize | ( | gfx::IRenderer * | renderer, |
| Rom * | rom ) |
Definition at line 66 of file dungeon_editor_v2.cc.
References active_rooms_, current_entrance_id_, current_room_id_, yaze::editor::Editor::dependencies_, entrances_, ICON_MD_CASTLE, ICON_MD_DOOR_FRONT, ICON_MD_GRID_VIEW, ICON_MD_IMAGE, ICON_MD_LIST, ICON_MD_PALETTE, ICON_MD_TUNE, yaze::Rom::is_loaded(), kControlPanelId, kEntranceListId, kPaletteEditorId, kRoomGraphicsId, kRoomMatrixId, kRoomSelectorId, OnEntranceSelected(), OnRoomSelected(), yaze::editor::EditorDependencies::panel_manager, yaze::editor::PanelManager::RegisterPanel(), renderer_, rom(), rom_, room_selector_, room_window_class_, and rooms_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 195 of file dungeon_editor_v2.cc.
|
virtual |
Implements yaze::editor::Editor.
Definition at line 197 of file dungeon_editor_v2.cc.
References active_rooms_, ASSIGN_OR_RETURN, yaze::project::YazeProject::code_folder, yaze::gfx::CreatePaletteGroupFromLargePalette(), current_palette_, current_palette_group_, current_palette_group_id_, current_room_id_, yaze::project::YazeProject::custom_objects_folder, yaze::editor::Editor::dependencies_, dungeon_editor_system_, yaze::gfx::PaletteGroupMap::dungeon_main, entrances_, yaze::editor::Editor::game_data(), yaze::gfx::PaletteManager::Get(), yaze::core::FeatureFlags::get(), yaze::zelda3::CustomObjectManager::Get(), yaze::zelda3::ObjectDimensionTable::Get(), yaze::zelda3::CustomObjectManager::Initialize(), yaze::gfx::PaletteManager::Initialize(), yaze::gui::PaletteEditorWidget::Initialize(), yaze::Rom::is_loaded(), is_loaded_, item_editor_panel_, yaze::editor::DungeonRoomLoader::LoadRoomEntrances(), LOG_ERROR, minecart_track_editor_panel_, object_editor_panel_, OnRoomSelected(), owned_object_editor_panel_, palette_editor_, yaze::zelda3::GameData::palette_groups, yaze::editor::EditorDependencies::panel_manager, yaze::editor::EditorDependencies::project, yaze::editor::PanelManager::RegisterEditorPanel(), render_service_, renderer_, RETURN_IF_ERROR, rom_, room_graphics_panel_, room_loader_, room_selector_, rooms_, yaze::editor::DungeonRoomSelector::set_active_rooms(), yaze::editor::DungeonRoomSelector::set_entrances(), yaze::editor::DungeonRoomSelector::set_rooms(), yaze::editor::ObjectEditorPanel::SetGameData(), yaze::gui::PaletteEditorWidget::SetOnPaletteChanged(), yaze::editor::MinecartTrackEditorPanel::SetProjectRoot(), yaze::editor::DungeonRoomSelector::SetRoomSelectedCallback(), and sprite_editor_panel_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 339 of file dungeon_editor_v2.cc.
References yaze::gui::PanelWindow::Begin(), current_room_id_, DrawRoomPanels(), yaze::gui::PanelWindow::End(), yaze::editor::AgentUI::GetTheme(), GetViewerForRoom(), ICON_MD_CASTLE, is_loaded_, ProcessPendingSwap(), room_window_class_, and yaze::gui::PanelWindow::SetDefaultSize().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 373 of file dungeon_editor_v2.cc.
References dungeon_editor_system_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 380 of file dungeon_editor_v2.cc.
References dungeon_editor_system_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 751 of file dungeon_editor_v2.cc.
References current_room_id_, and GetViewerForRoom().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 759 of file dungeon_editor_v2.cc.
References current_room_id_, and GetViewerForRoom().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 766 of file dungeon_editor_v2.cc.
References current_room_id_, and GetViewerForRoom().

|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 119 of file dungeon_editor_v2.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 387 of file dungeon_editor_v2.cc.
References dungeon_editor_system_, yaze::gfx::PaletteManager::Get(), yaze::Rom::is_loaded(), LOG_ERROR, LOG_INFO, rom_, rooms_, and yaze::gfx::PaletteManager::SaveAllToRom().

|
inline |
Definition at line 123 of file dungeon_editor_v2.h.
References yaze::Rom::is_loaded(), render_service_, rom(), rom_, room_loader_, room_selector_, room_viewers_, rooms_, and yaze::editor::DungeonRoomSelector::SetRom().

|
inline |
Definition at line 145 of file dungeon_editor_v2.h.
References rom_.
Referenced by DungeonEditorV2(), Initialize(), and SetRom().
| void yaze::editor::DungeonEditorV2::add_room | ( | int | room_id | ) |
Definition at line 701 of file dungeon_editor_v2.cc.
References OnRoomSelected().

| void yaze::editor::DungeonEditorV2::FocusRoom | ( | int | room_id | ) |
Definition at line 703 of file dungeon_editor_v2.cc.
References room_cards_.
Referenced by OnRoomSelected().
| void yaze::editor::DungeonEditorV2::SelectObject | ( | int | obj_id | ) |
Definition at line 710 of file dungeon_editor_v2.cc.
References kObjectToolsId, object_editor_panel_, yaze::editor::ObjectEditorPanel::SelectObject(), and ShowPanel().

| void yaze::editor::DungeonEditorV2::SetAgentMode | ( | bool | enabled | ) |
Definition at line 717 of file dungeon_editor_v2.cc.
References yaze::editor::Editor::dependencies_, kObjectToolsId, kRoomGraphicsId, kRoomSelectorId, object_editor_panel_, yaze::editor::EditorDependencies::panel_manager, yaze::editor::ObjectEditorPanel::SetAgentOptimizedLayout(), and ShowPanel().

|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 156 of file dungeon_editor_v2.h.
References yaze::Rom::is_loaded(), and rom_.

|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 157 of file dungeon_editor_v2.h.
References yaze::Rom::is_loaded(), rom_, and yaze::Rom::title().

|
inline |
Definition at line 164 of file dungeon_editor_v2.h.
References yaze::editor::Editor::dependencies_, yaze::editor::EditorDependencies::panel_manager, and yaze::editor::PanelManager::ShowPanel().
Referenced by GetViewerForRoom(), SelectObject(), and SetAgentMode().

|
inline |
Definition at line 180 of file dungeon_editor_v2.h.
References yaze::editor::DungeonRoomSelector::current_room_id(), and room_selector_.

|
inline |
Definition at line 181 of file dungeon_editor_v2.h.
References yaze::editor::DungeonRoomSelector::active_rooms(), and room_selector_.

|
inline |
Definition at line 184 of file dungeon_editor_v2.h.
References object_editor_panel_.
|
private |
Definition at line 431 of file dungeon_editor_v2.cc.
References active_rooms_, yaze::editor::Editor::dependencies_, DrawRoomTab(), yaze::editor::PanelManager::GetActiveCategory(), yaze::zelda3::GetRoomLabel(), ICON_MD_GRID_ON, yaze::editor::PanelManager::IsPanelPinned(), yaze::editor::PanelManager::IsPanelVisible(), yaze::editor::Editor::MakePanelTitle(), OnRoomSelected(), yaze::editor::EditorDependencies::panel_manager, room_cards_, room_dock_id_, room_viewers_, room_window_class_, and yaze::editor::PanelManager::UnregisterPanel().
Referenced by Update().
|
private |
Definition at line 511 of file dungeon_editor_v2.cc.
References dungeon_editor_system_, yaze::editor::AgentUI::GetTheme(), GetViewerForRoom(), ICON_MD_CHECK, ICON_MD_PENDING, yaze::editor::DungeonRoomLoader::LoadRoom(), LOG_DEBUG, LOG_ERROR, room_loader_, and rooms_.
Referenced by DrawRoomPanels().

|
private |
Definition at line 728 of file dungeon_editor_v2.cc.
References yaze::gfx::Arena::Get(), yaze::gfx::Arena::ProcessTextureQueue(), and renderer_.

|
private |
Definition at line 591 of file dungeon_editor_v2.cc.
References active_rooms_, yaze::gfx::CreatePaletteGroupFromLargePalette(), current_palette_, current_palette_group_, current_palette_id_, current_room_id_, yaze::editor::Editor::dependencies_, dungeon_editor_system_, yaze::gfx::PaletteGroupMap::dungeon_main, FocusRoom(), yaze::editor::Editor::game_data(), yaze::zelda3::GetRoomLabel(), GetViewerForRoom(), ICON_MD_GRID_ON, item_editor_panel_, yaze::editor::DungeonRoomLoader::LoadRoom(), object_editor_panel_, palette_editor_, yaze::zelda3::GameData::palette_groups, yaze::editor::EditorDependencies::panel_manager, yaze::editor::PanelManager::RegisterPanel(), room_graphics_panel_, room_loader_, room_selector_, rooms_, yaze::editor::DungeonRoomSelector::set_active_rooms(), yaze::editor::ItemEditorPanel::SetCanvasViewer(), yaze::editor::ObjectEditorPanel::SetCanvasViewer(), yaze::editor::SpriteEditorPanel::SetCanvasViewer(), yaze::editor::DungeonRoomGraphicsPanel::SetCurrentPaletteGroup(), yaze::editor::ObjectEditorPanel::SetCurrentPaletteGroup(), yaze::gui::PaletteEditorWidget::SetCurrentPaletteId(), yaze::editor::ObjectEditorPanel::SetCurrentRoom(), yaze::editor::PanelManager::ShowPanel(), and sprite_editor_panel_.
Referenced by add_room(), DrawRoomPanels(), GetViewerForRoom(), Initialize(), Load(), OnEntranceSelected(), and ProcessPendingSwap().
|
private |
Definition at line 693 of file dungeon_editor_v2.cc.
References entrances_, and OnRoomSelected().
Referenced by Initialize().

|
private |
Definition at line 794 of file dungeon_editor_v2.cc.
References yaze::editor::DungeonEditorV2::PendingSwap::new_room_id, yaze::editor::DungeonEditorV2::PendingSwap::old_room_id, yaze::editor::DungeonEditorV2::PendingSwap::pending, pending_swap_, and rooms_.
Referenced by GetViewerForRoom().
|
private |
Definition at line 732 of file dungeon_editor_v2.cc.
References current_room_id_, yaze::zelda3::RoomObject::id_, LOG_DEBUG, LOG_ERROR, LOG_INFO, rooms_, yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.
Referenced by GetViewerForRoom().
|
private |
Definition at line 868 of file dungeon_editor_v2.cc.
References current_palette_group_, current_palette_id_, dungeon_editor_system_, game_data_, HandleObjectPlaced(), kObjectToolsId, OnRoomSelected(), PushUndoSnapshot(), renderer_, rom_, room_viewers_, rooms_, ShowPanel(), and SwapRoomInPanel().
Referenced by Copy(), Cut(), DrawRoomTab(), OnRoomSelected(), Paste(), and Update().
|
private |
Definition at line 773 of file dungeon_editor_v2.cc.
References ClearRedo(), rooms_, and undo_history_.
Referenced by GetViewerForRoom().

|
private |
Definition at line 780 of file dungeon_editor_v2.cc.
References rooms_.
|
private |
Definition at line 792 of file dungeon_editor_v2.cc.
References redo_history_.
Referenced by PushUndoSnapshot().
|
private |
Definition at line 805 of file dungeon_editor_v2.cc.
References active_rooms_, yaze::editor::Editor::dependencies_, yaze::zelda3::GetRoomLabel(), ICON_MD_GRID_ON, yaze::editor::DungeonEditorV2::PendingSwap::new_room_id, yaze::editor::DungeonEditorV2::PendingSwap::old_room_id, OnRoomSelected(), yaze::editor::EditorDependencies::panel_manager, yaze::editor::DungeonEditorV2::PendingSwap::pending, pending_swap_, yaze::editor::PanelManager::RegisterPanel(), room_cards_, room_selector_, room_viewers_, yaze::editor::DungeonRoomSelector::set_active_rooms(), yaze::editor::PanelManager::ShowPanel(), and yaze::editor::PanelManager::UnregisterPanel().
Referenced by Update().
|
staticconstexpr |
Definition at line 171 of file dungeon_editor_v2.h.
Referenced by Initialize().
|
staticconstexpr |
Definition at line 172 of file dungeon_editor_v2.h.
Referenced by Initialize(), and SetAgentMode().
|
staticconstexpr |
Definition at line 173 of file dungeon_editor_v2.h.
Referenced by Initialize().
|
staticconstexpr |
Definition at line 174 of file dungeon_editor_v2.h.
Referenced by Initialize().
|
staticconstexpr |
Definition at line 175 of file dungeon_editor_v2.h.
Referenced by Initialize(), and SetAgentMode().
|
staticconstexpr |
Definition at line 176 of file dungeon_editor_v2.h.
Referenced by GetViewerForRoom(), SelectObject(), and SetAgentMode().
|
staticconstexpr |
Definition at line 177 of file dungeon_editor_v2.h.
Referenced by Initialize().
|
private |
Definition at line 189 of file dungeon_editor_v2.h.
Referenced by GetViewerForRoom(), Initialize(), Load(), and ProcessDeferredTextures().
|
private |
Definition at line 212 of file dungeon_editor_v2.h.
Referenced by GetRomStatus(), GetViewerForRoom(), Initialize(), IsRomLoaded(), Load(), rom(), Save(), and SetRom().
|
private |
Definition at line 213 of file dungeon_editor_v2.h.
Referenced by GetViewerForRoom(), and SetGameData().
|
private |
Definition at line 214 of file dungeon_editor_v2.h.
Referenced by DrawRoomTab(), DungeonEditorV2(), GetViewerForRoom(), HandleObjectPlaced(), Initialize(), Load(), OnRoomSelected(), PushUndoSnapshot(), RestoreFromSnapshot(), Save(), SetGameData(), SetRom(), and SwapRoomInPanel().
|
private |
Definition at line 215 of file dungeon_editor_v2.h.
Referenced by Initialize(), Load(), and OnEntranceSelected().
|
private |
Definition at line 218 of file dungeon_editor_v2.h.
Referenced by Initialize().
|
private |
Definition at line 221 of file dungeon_editor_v2.h.
Referenced by DrawRoomPanels(), Initialize(), Load(), OnRoomSelected(), and ProcessPendingSwap().
|
private |
Definition at line 222 of file dungeon_editor_v2.h.
Referenced by Copy(), Cut(), HandleObjectPlaced(), Initialize(), Load(), OnRoomSelected(), Paste(), and Update().
|
private |
Definition at line 224 of file dungeon_editor_v2.h.
|
private |
Definition at line 227 of file dungeon_editor_v2.h.
Referenced by Load(), and OnRoomSelected().
|
private |
Definition at line 228 of file dungeon_editor_v2.h.
Referenced by GetViewerForRoom(), Load(), and OnRoomSelected().
|
private |
Definition at line 229 of file dungeon_editor_v2.h.
Referenced by GetViewerForRoom(), and OnRoomSelected().
|
private |
Definition at line 230 of file dungeon_editor_v2.h.
Referenced by Load().
|
private |
Definition at line 233 of file dungeon_editor_v2.h.
Referenced by DrawRoomTab(), Load(), OnRoomSelected(), SetGameData(), and SetRom().
|
private |
Definition at line 234 of file dungeon_editor_v2.h.
Referenced by active_rooms(), current_room_id(), Initialize(), Load(), OnRoomSelected(), ProcessPendingSwap(), and SetRom().
|
private |
Definition at line 236 of file dungeon_editor_v2.h.
Referenced by DrawRoomPanels(), GetViewerForRoom(), ProcessPendingSwap(), SetGameData(), and SetRom().
|
private |
Definition at line 238 of file dungeon_editor_v2.h.
Referenced by Load(), and OnRoomSelected().
|
private |
Definition at line 241 of file dungeon_editor_v2.h.
Referenced by Load(), object_editor_panel(), OnRoomSelected(), SelectObject(), SetAgentMode(), SetGameData(), and ~DungeonEditorV2().
|
private |
Definition at line 242 of file dungeon_editor_v2.h.
Referenced by Load(), and OnRoomSelected().
|
private |
Definition at line 243 of file dungeon_editor_v2.h.
Referenced by Load(), OnRoomSelected(), and ~DungeonEditorV2().
|
private |
Definition at line 244 of file dungeon_editor_v2.h.
Referenced by Load(), OnRoomSelected(), and ~DungeonEditorV2().
|
private |
Definition at line 245 of file dungeon_editor_v2.h.
Referenced by Load().
|
private |
Definition at line 249 of file dungeon_editor_v2.h.
Referenced by Load().
|
private |
Definition at line 250 of file dungeon_editor_v2.h.
Referenced by DrawRoomTab(), DungeonEditorV2(), GetViewerForRoom(), Load(), OnRoomSelected(), Redo(), Save(), SetGameData(), and Undo().
|
private |
Definition at line 251 of file dungeon_editor_v2.h.
|
private |
Definition at line 253 of file dungeon_editor_v2.h.
|
private |
Definition at line 256 of file dungeon_editor_v2.h.
Referenced by DrawRoomPanels(), Initialize(), and Update().
|
private |
Definition at line 259 of file dungeon_editor_v2.h.
Referenced by DrawRoomPanels().
|
private |
Definition at line 262 of file dungeon_editor_v2.h.
Referenced by DrawRoomPanels(), FocusRoom(), and ProcessPendingSwap().
|
private |
Definition at line 266 of file dungeon_editor_v2.h.
Referenced by PushUndoSnapshot().
|
private |
Definition at line 268 of file dungeon_editor_v2.h.
Referenced by ClearRedo().
|
private |
Definition at line 276 of file dungeon_editor_v2.h.
Referenced by ProcessPendingSwap(), and SwapRoomInPanel().