EditorPanel for displaying multiple rooms in a spatial dungeon layout. More...
#include <dungeon_map_panel.h>


Public Member Functions | |
| DungeonMapPanel (int *current_room_id, ImVector< int > *active_rooms, std::function< void(int)> on_room_selected, std::array< zelda3::Room, 0x128 > *rooms=nullptr) | |
| Construct a dungeon map panel. | |
| std::string | GetId () const override |
| Unique identifier for this panel. | |
| std::string | GetDisplayName () const override |
| Human-readable name shown in menus and title bars. | |
| std::string | GetIcon () const override |
| Material Design icon for this panel. | |
| std::string | GetEditorCategory () const override |
| Editor category this panel belongs to. | |
| int | GetPriority () const override |
| Get display priority for menu ordering. | |
| void | SetRoomIntentCallback (std::function< void(int, RoomSelectionIntent)> callback) |
| void | SetDungeonRooms (const std::vector< int > &room_ids) |
| Set which rooms to display in this dungeon map. | |
| void | AddRoom (int room_id) |
| Add a single room to the dungeon map. | |
| void | ClearRooms () |
| Clear all rooms from the dungeon map. | |
| void | SetRoomPosition (int room_id, int grid_x, int grid_y) |
| Manually set a room's position in the grid. | |
| void | SetRooms (std::array< zelda3::Room, 0x128 > *rooms) |
| void | SetHackManifest (const core::HackManifest *manifest) |
| Set the hack manifest for project registry access. | |
| void | LoadFromRegistry (const core::DungeonEntry &dungeon) |
| Load rooms and connections from a DungeonEntry in the project registry. | |
| void | Draw (bool *p_open) override |
| Draw the panel content. | |
Public Member Functions inherited from yaze::editor::EditorPanel | |
| virtual | ~EditorPanel ()=default |
| virtual void | OnFirstDraw () |
| Called once before the first Draw() in a session. | |
| virtual bool | RequiresLazyInit () const |
| Whether this panel uses lazy initialization. | |
| void | InvalidateLazyInit () |
| Reset lazy init state so OnFirstDraw() runs again. | |
| virtual void | OnOpen () |
| Called when panel becomes visible. | |
| virtual void | OnClose () |
| Called when panel is hidden. | |
| virtual void | OnFocus () |
| Called when panel receives focus. | |
| virtual PanelCategory | GetPanelCategory () const |
| Get the lifecycle category for this panel. | |
| virtual PanelContextScope | GetContextScope () const |
| Optional context binding for this panel (room/selection/etc) | |
| virtual PanelScope | GetScope () const |
| Get the registration scope for this panel. | |
| virtual bool | IsEnabled () const |
| Check if this panel is currently enabled. | |
| virtual std::string | GetDisabledTooltip () const |
| Get tooltip text when panel is disabled. | |
| virtual std::string | GetShortcutHint () const |
| Get keyboard shortcut hint for display. | |
| virtual float | GetPreferredWidth () const |
| Get preferred width for this panel (optional) | |
| virtual bool | IsVisibleByDefault () const |
| Whether this panel should be visible by default. | |
| virtual std::string | GetParentPanelId () const |
| Get parent panel ID for cascade behavior. | |
| virtual bool | CascadeCloseChildren () const |
| Whether closing this panel should close child panels. | |
| void | DrawWithLazyInit (bool *p_open) |
| Execute lazy initialization if needed, then call Draw() | |
Private Member Functions | |
| void | AutoLayoutRooms () |
| Auto-layout rooms in a grid based on their IDs. | |
| void | DrawDungeonSelector () |
| Draw dungeon preset selector — uses project registry if available, falls back to vanilla ALTTP presets. | |
| void | DrawRegistrySelector () |
| Selector using Oracle project registry dungeon entries. | |
| void | DrawVanillaPresetSelector () |
| Fallback selector using vanilla ALTTP dungeon presets. | |
Static Private Member Functions | |
| static void | DrawDashedLine (ImDrawList *dl, ImVec2 from, ImVec2 to, ImU32 color, float thickness, float dash_len) |
| Draw a dashed line between two points. | |
| static void | DrawArrowhead (ImDrawList *dl, ImVec2 from, ImVec2 to, ImU32 color, float size) |
| Draw a small triangle arrowhead at the 'to' end of a line. | |
Private Attributes | |
| int * | current_room_id_ = nullptr |
| ImVector< int > * | active_rooms_ = nullptr |
| std::array< zelda3::Room, 0x128 > * | rooms_ = nullptr |
| std::function< void(int)> | on_room_selected_ |
| std::function< void(int, RoomSelectionIntent)> | on_room_intent_ |
| std::vector< int > | dungeon_room_ids_ |
| std::map< int, ImVec2 > | room_positions_ |
| std::map< int, std::string > | room_types_ |
| int | selected_preset_ = -1 |
| const core::HackManifest * | hack_manifest_ = nullptr |
| std::vector< core::DungeonConnection > | stair_connections_ |
| std::vector< core::DungeonConnection > | holewarp_connections_ |
| std::string | current_dungeon_name_ = "Select Dungeon..." |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::EditorPanel | |
| void | InvalidateCache () |
| Invalidate all cached computations. | |
| template<typename T > | |
| T & | GetCached (const std::string &key, std::function< T()> compute) |
| Get or compute a cached value. | |
| bool | IsCacheValid () const |
| Check if cache has been invalidated. | |
| void | ClearCache () |
| Clear all cached values (more aggressive than InvalidateCache) | |
EditorPanel for displaying multiple rooms in a spatial dungeon layout.
This panel provides an overview of multiple dungeon rooms arranged spatially, allowing users to see room connections and navigate between rooms quickly. Unlike the 16x19 Room Matrix which shows ALL rooms, this panel shows a focused subset of rooms that belong to a specific dungeon or user selection.
Features:
Definition at line 42 of file dungeon_map_panel.h.
|
inline |
Construct a dungeon map panel.
| current_room_id | Pointer to the current room ID (for highlighting) |
| active_rooms | Pointer to list of currently open rooms |
| on_room_selected | Callback when a room is clicked |
| rooms | Pointer to room data array |
Definition at line 51 of file dungeon_map_panel.h.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 63 of file dungeon_map_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 64 of file dungeon_map_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 65 of file dungeon_map_panel.h.
References ICON_MD_MAP.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 66 of file dungeon_map_panel.h.
|
inlineoverridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 67 of file dungeon_map_panel.h.
|
inline |
Definition at line 69 of file dungeon_map_panel.h.
References on_room_intent_.
|
inline |
Set which rooms to display in this dungeon map.
| room_ids | Vector of room IDs to include |
Definition at line 82 of file dungeon_map_panel.h.
References AutoLayoutRooms(), and dungeon_room_ids_.

|
inline |
Add a single room to the dungeon map.
Definition at line 90 of file dungeon_map_panel.h.
References AutoLayoutRooms(), and dungeon_room_ids_.
Referenced by DrawDungeonSelector().

|
inline |
Clear all rooms from the dungeon map.
Definition at line 102 of file dungeon_map_panel.h.
References dungeon_room_ids_, and room_positions_.
Referenced by DrawDungeonSelector(), and LoadFromRegistry().
|
inline |
Manually set a room's position in the grid.
Definition at line 110 of file dungeon_map_panel.h.
References room_positions_.
|
inline |
Definition at line 115 of file dungeon_map_panel.h.
References rooms_.
|
inline |
Set the hack manifest for project registry access.
Definition at line 120 of file dungeon_map_panel.h.
References hack_manifest_.
|
inline |
Load rooms and connections from a DungeonEntry in the project registry.
Definition at line 127 of file dungeon_map_panel.h.
References ClearRooms(), current_dungeon_name_, dungeon_room_ids_, holewarp_connections_, yaze::core::DungeonEntry::holewarps, yaze::core::DungeonEntry::name, room_positions_, room_types_, yaze::core::DungeonEntry::rooms, stair_connections_, and yaze::core::DungeonEntry::stairs.
Referenced by DrawRegistrySelector().

|
inlineoverridevirtual |
Draw the panel content.
| p_open | Pointer to visibility flag (nullptr if not closable) |
Called by PanelManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.
Implements yaze::editor::EditorPanel.
Definition at line 145 of file dungeon_map_panel.h.
References active_rooms_, current_room_id_, DrawArrowhead(), DrawDashedLine(), DrawDungeonSelector(), dungeon_room_ids_, yaze::zelda3::GetRoomLabel(), yaze::editor::AgentUI::GetTheme(), holewarp_connections_, yaze::editor::kOpenStandalone, on_room_intent_, on_room_selected_, room_positions_, room_types_, rooms_, and stair_connections_.
|
inlineprivate |
Auto-layout rooms in a grid based on their IDs.
Definition at line 390 of file dungeon_map_panel.h.
References dungeon_room_ids_, and room_positions_.
Referenced by AddRoom(), DrawVanillaPresetSelector(), and SetDungeonRooms().
|
inlineprivate |
Draw dungeon preset selector — uses project registry if available, falls back to vanilla ALTTP presets.
Definition at line 410 of file dungeon_map_panel.h.
References AddRoom(), ClearRooms(), current_dungeon_name_, current_room_id_, DrawRegistrySelector(), DrawVanillaPresetSelector(), hack_manifest_, yaze::core::HackManifest::HasProjectRegistry(), holewarp_connections_, ICON_MD_ADD, ICON_MD_CLEAR, room_types_, selected_preset_, and stair_connections_.
Referenced by Draw().
|
inlineprivate |
Selector using Oracle project registry dungeon entries.
Definition at line 443 of file dungeon_map_panel.h.
References current_dungeon_name_, yaze::core::ProjectRegistry::dungeons, hack_manifest_, LoadFromRegistry(), yaze::core::HackManifest::project_registry(), and selected_preset_.
Referenced by DrawDungeonSelector().

|
inlineprivate |
Fallback selector using vanilla ALTTP dungeon presets.
Definition at line 473 of file dungeon_map_panel.h.
References AutoLayoutRooms(), dungeon_room_ids_, and selected_preset_.
Referenced by DrawDungeonSelector().

|
inlinestaticprivate |
Draw a dashed line between two points.
Definition at line 519 of file dungeon_map_panel.h.
Referenced by Draw().
|
inlinestaticprivate |
Draw a small triangle arrowhead at the 'to' end of a line.
Definition at line 546 of file dungeon_map_panel.h.
Referenced by Draw().
|
private |
Definition at line 566 of file dungeon_map_panel.h.
Referenced by Draw(), and DrawDungeonSelector().
|
private |
Definition at line 567 of file dungeon_map_panel.h.
Referenced by Draw().
|
private |
Definition at line 568 of file dungeon_map_panel.h.
Referenced by Draw(), and SetRooms().
|
private |
Definition at line 569 of file dungeon_map_panel.h.
Referenced by Draw().
|
private |
Definition at line 570 of file dungeon_map_panel.h.
Referenced by Draw(), and SetRoomIntentCallback().
|
private |
Definition at line 573 of file dungeon_map_panel.h.
Referenced by AddRoom(), AutoLayoutRooms(), ClearRooms(), Draw(), DrawVanillaPresetSelector(), LoadFromRegistry(), and SetDungeonRooms().
|
private |
Definition at line 574 of file dungeon_map_panel.h.
Referenced by AutoLayoutRooms(), ClearRooms(), Draw(), LoadFromRegistry(), and SetRoomPosition().
|
private |
Definition at line 575 of file dungeon_map_panel.h.
Referenced by Draw(), DrawDungeonSelector(), and LoadFromRegistry().
|
private |
Definition at line 576 of file dungeon_map_panel.h.
Referenced by DrawDungeonSelector(), DrawRegistrySelector(), and DrawVanillaPresetSelector().
|
private |
Definition at line 579 of file dungeon_map_panel.h.
Referenced by DrawDungeonSelector(), DrawRegistrySelector(), and SetHackManifest().
|
private |
Definition at line 580 of file dungeon_map_panel.h.
Referenced by Draw(), DrawDungeonSelector(), and LoadFromRegistry().
|
private |
Definition at line 581 of file dungeon_map_panel.h.
Referenced by Draw(), DrawDungeonSelector(), and LoadFromRegistry().
|
private |
Definition at line 582 of file dungeon_map_panel.h.
Referenced by DrawDungeonSelector(), DrawRegistrySelector(), and LoadFromRegistry().