Base class for panels that edit specific ROM resources. More...
#include <resource_panel.h>


Public Member Functions | |
| virtual | ~ResourcePanel ()=default |
| virtual int | GetResourceId () const =0 |
| The numeric ID of the resource. | |
| virtual std::string | GetResourceType () const =0 |
| The resource type name. | |
| virtual std::string | GetResourceName () const |
| Human-readable resource name. | |
| 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 | OnResourceModified () |
| Called when resource data changes externally. | |
| virtual void | OnResourceDeleted () |
| Called when resource is deleted from ROM. | |
Public Member Functions inherited from yaze::editor::EditorPanel | |
| virtual | ~EditorPanel ()=default |
| virtual std::string | GetIcon () const =0 |
| Material Design icon for this panel. | |
| virtual std::string | GetEditorCategory () const =0 |
| Editor category this panel belongs to. | |
| virtual void | Draw (bool *p_open)=0 |
| Draw the panel content. | |
| 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 int | GetPriority () const |
| Get display priority for menu ordering. | |
| 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. | |
Protected Attributes | |
| size_t | session_id_ = 0 |
| Session ID for multi-ROM editing (0 = single session) | |
Base class for panels that edit specific ROM resources.
A ResourcePanel represents a window for editing a specific piece of data within a ROM, such as a dungeon room, a song, or a graphics sheet.
Key Features:
Resource panel IDs follow a specific format:
Typical subclasses include:
Definition at line 71 of file resource_panel.h.
|
virtualdefault |
|
pure virtual |
The numeric ID of the resource.
This is the primary key for the resource within its type.
Implemented in yaze::editor::DungeonRoomPanel.
Referenced by GetId(), and GetResourceName().
|
pure virtual |
The resource type name.
Used in panel ID generation and display.
Implemented in yaze::editor::DungeonRoomPanel.
Referenced by GetId(), and GetResourceName().
|
inlinevirtual |
Human-readable resource name.
Default implementation returns "{type} {id}". Override to provide game-specific names from ROM data.
Reimplemented in yaze::editor::DungeonRoomPanel.
Definition at line 102 of file resource_panel.h.
References GetResourceId(), and GetResourceType().
Referenced by GetDisplayName().

|
inlineoverridevirtual |
Generated panel ID from resource type and ID.
Implements yaze::editor::EditorPanel.
Definition at line 114 of file resource_panel.h.
References yaze::editor::EditorPanel::GetEditorCategory(), GetResourceId(), and GetResourceType().

|
inlineoverridevirtual |
Generated display name from resource name.
Implements yaze::editor::EditorPanel.
Definition at line 123 of file resource_panel.h.
References GetResourceName().

|
inlineoverridevirtual |
Resource panels use CrossEditor category for opt-in persistence.
Resource panels (rooms, songs, etc.) can be pinned to persist across editor switches. By default, they're NOT pinned and will be hidden (but not closed) when switching to another editor.
Pin behavior:
The drawing loops in each editor handle the category filtering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 145 of file resource_panel.h.
References yaze::editor::CrossEditor.
|
inlinevirtual |
Whether multiple instances of this resource type can be open.
Definition at line 153 of file resource_panel.h.
|
inlinevirtual |
Get the session ID this resource belongs to.
In multi-ROM editing mode, each loaded ROM gets a session ID. This allows the same resource (e.g., room 42) to be open for different ROMs simultaneously.
Definition at line 167 of file resource_panel.h.
References session_id_.
|
inline |
Set the session ID for this resource panel.
| session_id | The session ID to set |
Definition at line 173 of file resource_panel.h.
References session_id_.
|
inlinevirtual |
Called when resource data changes externally.
Override to refresh panel state when the underlying ROM data is modified by another editor or operation.
Reimplemented in yaze::editor::DungeonRoomPanel.
Definition at line 185 of file resource_panel.h.
|
inlinevirtual |
Called when resource is deleted from ROM.
Default behavior: the panel should be closed. Override to implement custom cleanup or warnings.
Definition at line 193 of file resource_panel.h.
|
protected |
Session ID for multi-ROM editing (0 = single session)
Definition at line 199 of file resource_panel.h.
Referenced by yaze::editor::DungeonRoomPanel::DungeonRoomPanel(), GetSessionId(), and SetSessionId().