yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::DungeonEditorV2 Class Reference

DungeonEditorV2 - Simplified dungeon editor using component delegation. More...

#include <dungeon_editor_v2.h>

Inheritance diagram for yaze::editor::DungeonEditorV2:

Public Member Functions

 DungeonEditorV2 (Rom *rom=nullptr)
 
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 set_rom (Rom *rom)
 
Romrom () const
 
void add_room (int room_id)
 
void FocusRoom (int room_id)
 
bool IsRomLoaded () const override
 
std::string GetRomStatus () const override
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
virtual absl::Status Clear ()
 
EditorType type () const
 
void set_context (EditorContext *context)
 
bool * active ()
 
void set_active (bool active)
 

Public Attributes

bool show_room_selector_ = false
 
bool show_room_matrix_ = false
 
bool show_entrances_list_ = false
 
bool show_room_graphics_ = false
 
bool show_object_editor_ = false
 
bool show_palette_editor_ = false
 
bool show_debug_controls_ = false
 
bool show_control_panel_ = true
 

Private Member Functions

void DrawLayout ()
 
void DrawRoomTab (int room_id)
 
void DrawToolset ()
 
void DrawRoomMatrixCard ()
 
void DrawRoomsListCard ()
 
void DrawEntrancesListCard ()
 
void DrawRoomGraphicsCard ()
 
void DrawDebugControlsCard ()
 
void DrawControlPanel ()
 
void ProcessDeferredTextures ()
 
void OnRoomSelected (int room_id)
 
void OnEntranceSelected (int entrance_id)
 

Private Attributes

gfx::IRendererrenderer_ = nullptr
 
Romrom_
 
std::array< zelda3::Room, 0x128 > rooms_
 
std::array< zelda3::RoomEntrance, 0x8C > entrances_
 
int current_entrance_id_ = 0
 
ImVector< int > active_rooms_
 
std::unordered_map< int, std::shared_ptr< gui::EditorCard > > room_cards_
 
int current_room_id_ = 0
 
bool control_panel_minimized_ = false
 
gfx::SnesPalette current_palette_
 
gfx::PaletteGroup current_palette_group_
 
uint64_t current_palette_id_ = 0
 
uint64_t current_palette_group_id_ = 0
 
DungeonRoomLoader room_loader_
 
DungeonRoomSelector room_selector_
 
DungeonCanvasViewer canvas_viewer_
 
DungeonObjectSelector object_selector_
 
gui::DungeonObjectEmulatorPreview object_emulator_preview_
 
gui::PaletteEditorWidget palette_editor_
 
std::unique_ptr< ObjectEditorCardobject_editor_card_
 
bool is_loaded_ = false
 
ImGuiWindowClass room_window_class_
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::Editor
std::string MakeCardTitle (const std::string &base_title) 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_
 
EditorContextcontext_ = nullptr
 

Detailed Description

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.

Definition at line 42 of file dungeon_editor_v2.h.

Constructor & Destructor Documentation

◆ DungeonEditorV2()

yaze::editor::DungeonEditorV2::DungeonEditorV2 ( Rom rom = nullptr)
inlineexplicit

Definition at line 44 of file dungeon_editor_v2.h.

References yaze::editor::kDungeon, and yaze::editor::Editor::type_.

Member Function Documentation

◆ Initialize() [1/2]

◆ Initialize() [2/2]

void yaze::editor::DungeonEditorV2::Initialize ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 113 of file dungeon_editor_v2.cc.

◆ Load()

◆ Update()

◆ Undo()

absl::Status yaze::editor::DungeonEditorV2::Undo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 59 of file dungeon_editor_v2.h.

◆ Redo()

absl::Status yaze::editor::DungeonEditorV2::Redo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 60 of file dungeon_editor_v2.h.

◆ Cut()

absl::Status yaze::editor::DungeonEditorV2::Cut ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 61 of file dungeon_editor_v2.h.

◆ Copy()

absl::Status yaze::editor::DungeonEditorV2::Copy ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 62 of file dungeon_editor_v2.h.

◆ Paste()

absl::Status yaze::editor::DungeonEditorV2::Paste ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 63 of file dungeon_editor_v2.h.

◆ Find()

absl::Status yaze::editor::DungeonEditorV2::Find ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 64 of file dungeon_editor_v2.h.

◆ Save()

absl::Status yaze::editor::DungeonEditorV2::Save ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 221 of file dungeon_editor_v2.cc.

References yaze::Rom::is_loaded(), LOG_ERROR, rom_, and rooms_.

Referenced by DrawDebugControlsCard(), and yaze::test::TEST_F().

Here is the call graph for this function:

◆ set_rom()

◆ rom()

Rom * yaze::editor::DungeonEditorV2::rom ( ) const
inline

Definition at line 76 of file dungeon_editor_v2.h.

References rom_.

Referenced by Initialize(), set_rom(), and yaze::test::TEST_F().

◆ add_room()

void yaze::editor::DungeonEditorV2::add_room ( int  room_id)

Definition at line 527 of file dungeon_editor_v2.cc.

References OnRoomSelected().

Referenced by yaze::editor::EditorManager::JumpToDungeonRoom(), and yaze::editor::EditorManager::OpenEditorAndCardsFromFlags().

Here is the call graph for this function:

◆ FocusRoom()

void yaze::editor::DungeonEditorV2::FocusRoom ( int  room_id)

Definition at line 531 of file dungeon_editor_v2.cc.

References room_cards_.

Referenced by OnRoomSelected().

◆ IsRomLoaded()

bool yaze::editor::DungeonEditorV2::IsRomLoaded ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 83 of file dungeon_editor_v2.h.

References yaze::Rom::is_loaded(), and rom_.

Referenced by yaze::test::TEST_F().

Here is the call graph for this function:

◆ GetRomStatus()

std::string yaze::editor::DungeonEditorV2::GetRomStatus ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 84 of file dungeon_editor_v2.h.

References yaze::Rom::is_loaded(), rom_, and yaze::Rom::title().

Here is the call graph for this function:

◆ DrawLayout()

◆ DrawRoomTab()

void yaze::editor::DungeonEditorV2::DrawRoomTab ( int  room_id)
private

◆ DrawToolset()

◆ DrawRoomMatrixCard()

◆ DrawRoomsListCard()

◆ DrawEntrancesListCard()

◆ DrawRoomGraphicsCard()

◆ DrawDebugControlsCard()

◆ DrawControlPanel()

void yaze::editor::DungeonEditorV2::DrawControlPanel ( )
private

◆ ProcessDeferredTextures()

void yaze::editor::DungeonEditorV2::ProcessDeferredTextures ( )
private

Definition at line 1090 of file dungeon_editor_v2.cc.

References yaze::gfx::Arena::Get(), yaze::gfx::Arena::ProcessTextureQueue(), and renderer_.

Here is the call graph for this function:

◆ OnRoomSelected()

void yaze::editor::DungeonEditorV2::OnRoomSelected ( int  room_id)
private

◆ OnEntranceSelected()

void yaze::editor::DungeonEditorV2::OnEntranceSelected ( int  entrance_id)
private

Definition at line 515 of file dungeon_editor_v2.cc.

References entrances_, and OnRoomSelected().

Referenced by DrawEntrancesListCard().

Here is the call graph for this function:

Member Data Documentation

◆ show_room_selector_

bool yaze::editor::DungeonEditorV2::show_room_selector_ = false

◆ show_room_matrix_

bool yaze::editor::DungeonEditorV2::show_room_matrix_ = false

◆ show_entrances_list_

bool yaze::editor::DungeonEditorV2::show_entrances_list_ = false

◆ show_room_graphics_

bool yaze::editor::DungeonEditorV2::show_room_graphics_ = false

◆ show_object_editor_

bool yaze::editor::DungeonEditorV2::show_object_editor_ = false

◆ show_palette_editor_

bool yaze::editor::DungeonEditorV2::show_palette_editor_ = false

◆ show_debug_controls_

bool yaze::editor::DungeonEditorV2::show_debug_controls_ = false

◆ show_control_panel_

bool yaze::editor::DungeonEditorV2::show_control_panel_ = true

Definition at line 98 of file dungeon_editor_v2.h.

Referenced by DrawControlPanel(), Initialize(), and Update().

◆ renderer_

gfx::IRenderer* yaze::editor::DungeonEditorV2::renderer_ = nullptr
private

◆ rom_

Rom* yaze::editor::DungeonEditorV2::rom_
private

◆ rooms_

std::array<zelda3::Room, 0x128> yaze::editor::DungeonEditorV2::rooms_
private

◆ entrances_

std::array<zelda3::RoomEntrance, 0x8C> yaze::editor::DungeonEditorV2::entrances_
private

Definition at line 123 of file dungeon_editor_v2.h.

Referenced by DrawEntrancesListCard(), Load(), and OnEntranceSelected().

◆ current_entrance_id_

int yaze::editor::DungeonEditorV2::current_entrance_id_ = 0
private

Definition at line 126 of file dungeon_editor_v2.h.

Referenced by DrawEntrancesListCard().

◆ active_rooms_

ImVector<int> yaze::editor::DungeonEditorV2::active_rooms_
private

◆ room_cards_

std::unordered_map<int, std::shared_ptr<gui::EditorCard> > yaze::editor::DungeonEditorV2::room_cards_
private

Definition at line 130 of file dungeon_editor_v2.h.

Referenced by DrawDebugControlsCard(), DrawLayout(), and FocusRoom().

◆ current_room_id_

int yaze::editor::DungeonEditorV2::current_room_id_ = 0
private

◆ control_panel_minimized_

bool yaze::editor::DungeonEditorV2::control_panel_minimized_ = false
private

Definition at line 133 of file dungeon_editor_v2.h.

Referenced by DrawControlPanel(), and Update().

◆ current_palette_

gfx::SnesPalette yaze::editor::DungeonEditorV2::current_palette_
private

Definition at line 136 of file dungeon_editor_v2.h.

Referenced by Load().

◆ current_palette_group_

gfx::PaletteGroup yaze::editor::DungeonEditorV2::current_palette_group_
private

Definition at line 137 of file dungeon_editor_v2.h.

Referenced by Load().

◆ current_palette_id_

uint64_t yaze::editor::DungeonEditorV2::current_palette_id_ = 0
private

Definition at line 138 of file dungeon_editor_v2.h.

Referenced by Load().

◆ current_palette_group_id_

uint64_t yaze::editor::DungeonEditorV2::current_palette_group_id_ = 0
private

Definition at line 139 of file dungeon_editor_v2.h.

Referenced by Load().

◆ room_loader_

DungeonRoomLoader yaze::editor::DungeonEditorV2::room_loader_
private

Definition at line 142 of file dungeon_editor_v2.h.

Referenced by DrawDebugControlsCard(), DrawRoomTab(), Load(), and set_rom().

◆ room_selector_

DungeonRoomSelector yaze::editor::DungeonEditorV2::room_selector_
private

Definition at line 143 of file dungeon_editor_v2.h.

Referenced by DrawToolset(), Load(), OnRoomSelected(), and set_rom().

◆ canvas_viewer_

DungeonCanvasViewer yaze::editor::DungeonEditorV2::canvas_viewer_
private

Definition at line 144 of file dungeon_editor_v2.h.

Referenced by DrawRoomTab(), Load(), and set_rom().

◆ object_selector_

DungeonObjectSelector yaze::editor::DungeonEditorV2::object_selector_
private

Definition at line 145 of file dungeon_editor_v2.h.

Referenced by Load(), and set_rom().

◆ object_emulator_preview_

gui::DungeonObjectEmulatorPreview yaze::editor::DungeonEditorV2::object_emulator_preview_
private

Definition at line 146 of file dungeon_editor_v2.h.

Referenced by Load(), and set_rom().

◆ palette_editor_

gui::PaletteEditorWidget yaze::editor::DungeonEditorV2::palette_editor_
private

Definition at line 147 of file dungeon_editor_v2.h.

Referenced by DrawLayout(), and Load().

◆ object_editor_card_

std::unique_ptr<ObjectEditorCard> yaze::editor::DungeonEditorV2::object_editor_card_
private

Definition at line 148 of file dungeon_editor_v2.h.

Referenced by DrawLayout(), and Load().

◆ is_loaded_

bool yaze::editor::DungeonEditorV2::is_loaded_ = false
private

Definition at line 150 of file dungeon_editor_v2.h.

Referenced by Load(), and Update().

◆ room_window_class_

ImGuiWindowClass yaze::editor::DungeonEditorV2::room_window_class_
private

Definition at line 153 of file dungeon_editor_v2.h.

Referenced by DrawLayout(), Initialize(), and Update().


The documentation for this class was generated from the following files: