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


Public Member Functions | |
| virtual | ~ResourceWindowContent ()=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. | |
| WindowLifecycle | GetWindowLifecycle () const override |
| Resource windows use CrossEditor lifecycle 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. | |
| virtual | ~ResourceWindowContent ()=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. | |
| WindowLifecycle | GetWindowLifecycle () const override |
| Resource windows use CrossEditor lifecycle 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::WindowContent | |
| virtual | ~WindowContent ()=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 | 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 WindowContextScope | GetContextScope () const |
| Optional context binding for this window (room/selection/etc) | |
| virtual WindowScope | GetScope () const |
| Get the registration scope for this window. | |
| 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 std::string | GetWorkflowGroup () const |
| Optional workflow group for hack-centric actions. | |
| virtual std::string | GetWorkflowLabel () const |
| Optional workflow label for menus/command palette. | |
| virtual std::string | GetWorkflowDescription () const |
| Optional workflow description for menus/command palette. | |
| virtual int | GetWorkflowPriority () const |
| Optional workflow ordering priority (lower sorts first). | |
| virtual float | GetPreferredWidth () const |
| Get preferred width for this panel (optional) | |
| virtual bool | PreferAutoHideTabBar () const |
| Whether the dock node hosting this panel should auto-hide its tab bar. | |
| 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() | |
Protected Attributes | |
| size_t | session_id_ = 0 |
| Session ID for multi-ROM editing (0 = single session) | |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::WindowContent | |
| 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) | |
Base class for windows that edit specific ROM resources.
A ResourceWindowContent 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 |
|
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(), GetResourceName(), and yaze::editor::WorkspaceWindowManager::TrackResourceWindow().
|
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::WindowContent.
Definition at line 114 of file resource_panel.h.
References yaze::editor::WindowContent::GetEditorCategory(), GetResourceId(), and GetResourceType().

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

|
inlineoverridevirtual |
Resource windows use CrossEditor lifecycle 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::WindowContent.
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.
|
pure virtual |
The numeric ID of the resource.
This is the primary key for the resource within its type.
Implemented in yaze::editor::DungeonRoomPanel.
|
pure virtual |
The resource type name.
Used in panel ID generation and display.
Implemented in yaze::editor::DungeonRoomPanel.
|
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().

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

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

|
inlineoverridevirtual |
Resource windows use CrossEditor lifecycle 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::WindowContent.
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().