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

ResourcePanel for editing individual dungeon rooms. More...

#include <dungeon_room_panel.h>

Inheritance diagram for yaze::editor::DungeonRoomPanel:
Collaboration diagram for yaze::editor::DungeonRoomPanel:

Public Member Functions

 DungeonRoomPanel (size_t session_id, int room_id, zelda3::Room *room, DungeonCanvasViewer *canvas_viewer, DungeonRoomLoader *room_loader)
 Construct a room panel.
 
int GetResourceId () const override
 The numeric ID of the resource.
 
std::string GetResourceType () const override
 The resource type name.
 
std::string GetResourceName () const override
 Human-readable resource name.
 
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 Draw (bool *p_open) override
 Draw the panel content.
 
void OnResourceModified () override
 Called when resource data changes externally.
 
zelda3::Roomroom () const
 
int room_id () const
 
- Public Member Functions inherited from yaze::editor::ResourcePanel
virtual ~ResourcePanel ()=default
 
std::string GetId () const override
 Generated panel ID from resource type and ID.
 
std::string GetDisplayName () const override
 Generated display name from resource name.
 
PanelCategory GetPanelCategory () const override
 Resource panels use CrossEditor category for opt-in persistence.
 
virtual bool AllowMultipleInstances () const
 Whether multiple instances of this resource type can be open.
 
virtual size_t GetSessionId () const
 Get the session ID this resource belongs to.
 
void SetSessionId (size_t session_id)
 Set the session ID for this resource panel.
 
virtual void OnResourceDeleted ()
 Called when resource is deleted from ROM.
 
- Public Member Functions inherited from yaze::editor::EditorPanel
virtual ~EditorPanel ()=default
 
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 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.
 

Private Attributes

int room_id_ = 0
 
zelda3::Roomroom_ = nullptr
 
DungeonCanvasViewercanvas_viewer_ = nullptr
 
DungeonRoomLoaderroom_loader_ = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from yaze::editor::ResourcePanel
size_t session_id_ = 0
 Session ID for multi-ROM editing (0 = single session)
 

Detailed Description

ResourcePanel for editing individual dungeon rooms.

This panel provides a tabbed view for editing a specific dungeon room. Multiple rooms can be open simultaneously (up to kMaxRoomPanels). Each panel shows the room canvas with objects, sprites, and layers.

Features

  • Room canvas with pan/zoom
  • Object selection and manipulation
  • Sprite editing
  • Layer visibility toggles
  • Lazy loading of room data
See also
ResourcePanel - Base class for resource-bound panels
DungeonCanvasViewer - The canvas rendering component

Definition at line 37 of file dungeon_room_panel.h.

Constructor & Destructor Documentation

◆ DungeonRoomPanel()

yaze::editor::DungeonRoomPanel::DungeonRoomPanel ( size_t session_id,
int room_id,
zelda3::Room * room,
DungeonCanvasViewer * canvas_viewer,
DungeonRoomLoader * room_loader )
inline

Construct a room panel.

Parameters
session_idThe session this room belongs to
room_idThe room ID (0-295)
roomPointer to the room data (must outlive panel)
canvas_viewerPointer to canvas viewer for rendering
room_loaderPointer to room loader for lazy loading

Definition at line 47 of file dungeon_room_panel.h.

References yaze::editor::ResourcePanel::session_id_.

Member Function Documentation

◆ GetResourceId()

int yaze::editor::DungeonRoomPanel::GetResourceId ( ) const
inlineoverridevirtual

The numeric ID of the resource.

Returns
Resource ID (room_id, song_index, sheet_id, map_id, etc.)

This is the primary key for the resource within its type.

Implements yaze::editor::ResourcePanel.

Definition at line 61 of file dungeon_room_panel.h.

References room_id_.

◆ GetResourceType()

std::string yaze::editor::DungeonRoomPanel::GetResourceType ( ) const
inlineoverridevirtual

The resource type name.

Returns
Type string (e.g., "room", "song", "sheet", "map")

Used in panel ID generation and display.

Implements yaze::editor::ResourcePanel.

Definition at line 62 of file dungeon_room_panel.h.

◆ GetResourceName()

std::string yaze::editor::DungeonRoomPanel::GetResourceName ( ) const
inlineoverridevirtual

Human-readable resource name.

Returns
Friendly name (e.g., "Hyrule Castle Entrance", "Overworld Theme")

Default implementation returns "{type} {id}". Override to provide game-specific names from ROM data.

Reimplemented from yaze::editor::ResourcePanel.

Definition at line 64 of file dungeon_room_panel.h.

References yaze::zelda3::GetRoomLabel(), and room_id_.

Here is the call graph for this function:

◆ GetIcon()

std::string yaze::editor::DungeonRoomPanel::GetIcon ( ) const
inlineoverridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::EditorPanel.

Definition at line 70 of file dungeon_room_panel.h.

References ICON_MD_GRID_ON.

◆ GetEditorCategory()

std::string yaze::editor::DungeonRoomPanel::GetEditorCategory ( ) const
inlineoverridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::EditorPanel.

Definition at line 71 of file dungeon_room_panel.h.

◆ GetPriority()

int yaze::editor::DungeonRoomPanel::GetPriority ( ) const
inlineoverridevirtual

Get display priority for menu ordering.

Returns
Priority value (lower = higher in list, default 50)

Reimplemented from yaze::editor::EditorPanel.

Definition at line 72 of file dungeon_room_panel.h.

References room_id_.

◆ Draw()

◆ OnResourceModified()

void yaze::editor::DungeonRoomPanel::OnResourceModified ( )
inlineoverridevirtual

Called when resource data changes externally.

Override to refresh panel state when the underlying ROM data is modified by another editor or operation.

Reimplemented from yaze::editor::ResourcePanel.

Definition at line 173 of file dungeon_room_panel.h.

References yaze::zelda3::Room::IsLoaded(), yaze::zelda3::Room::RenderRoomGraphics(), and room_.

Here is the call graph for this function:

◆ room()

zelda3::Room * yaze::editor::DungeonRoomPanel::room ( ) const
inline

Definition at line 184 of file dungeon_room_panel.h.

References room_.

◆ room_id()

int yaze::editor::DungeonRoomPanel::room_id ( ) const
inline

Definition at line 185 of file dungeon_room_panel.h.

References room_id_.

Member Data Documentation

◆ room_id_

int yaze::editor::DungeonRoomPanel::room_id_ = 0
private

Definition at line 188 of file dungeon_room_panel.h.

Referenced by Draw(), GetPriority(), GetResourceId(), GetResourceName(), and room_id().

◆ room_

zelda3::Room* yaze::editor::DungeonRoomPanel::room_ = nullptr
private

Definition at line 189 of file dungeon_room_panel.h.

Referenced by Draw(), OnResourceModified(), and room().

◆ canvas_viewer_

DungeonCanvasViewer* yaze::editor::DungeonRoomPanel::canvas_viewer_ = nullptr
private

Definition at line 190 of file dungeon_room_panel.h.

Referenced by Draw().

◆ room_loader_

DungeonRoomLoader* yaze::editor::DungeonRoomPanel::room_loader_ = nullptr
private

Definition at line 191 of file dungeon_room_panel.h.

Referenced by Draw().


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