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

Base interface for all logical panel components. More...

#include <editor_panel.h>

Inherited by yaze::editor::AboutPanel, yaze::editor::AgentBotProfilesPanel, yaze::editor::AgentBuilderPanel, yaze::editor::AgentChatHistoryPanel, yaze::editor::AgentChatPanel, yaze::editor::AgentConfigurationPanel, yaze::editor::AgentKnowledgeBasePanel, yaze::editor::AgentMesenDebugPanel, yaze::editor::AgentMetricsDashboardPanel, yaze::editor::AgentPromptEditorPanel, yaze::editor::AgentStatusPanel, yaze::editor::AnnotationOverlayPanel, yaze::editor::AreaGraphicsPanel, yaze::editor::AssemblyBuildOutputPanel, yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblySymbolsPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::ChestEditorPanel, yaze::editor::CustomCollisionPanel, yaze::editor::CustomPalettePanel, yaze::editor::CustomSpriteEditorPanel, yaze::editor::DebugWindowPanel, yaze::editor::DictionaryPanel, yaze::editor::DungeonEmulatorPreviewPanel, yaze::editor::DungeonEntranceListPanel, yaze::editor::DungeonEntrancesPanel, yaze::editor::DungeonMapPanel, yaze::editor::DungeonMapsPanel, yaze::editor::DungeonPaletteEditorPanel, yaze::editor::DungeonRoomGraphicsPanel, yaze::editor::DungeonRoomMatrixPanel, yaze::editor::DungeonRoomSelectorPanel, yaze::editor::DungeonSettingsPanel, yaze::editor::DungeonWorkbenchPanel, yaze::editor::FeatureFlagEditorEditorPanel, yaze::editor::FontAtlasPanel, yaze::editor::GfxGroupsPanel, yaze::editor::GraphicsGfxGroupPanel, yaze::editor::GraphicsLinkSpritePanel, yaze::editor::GraphicsPaletteControlsPanel, yaze::editor::GraphicsPalettesetPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::GraphicsPolyhedralPanel, yaze::editor::GraphicsPrototypeViewerPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::InventoryMenuPanel, yaze::editor::ItemEditorPanel, yaze::editor::LinkSpritePanel, yaze::editor::ManifestEditorPanel, yaze::editor::MapPropertiesPanel, yaze::editor::MesenScreenshotEditorPanel, yaze::editor::MessageEditorPanel, yaze::editor::MessageListPanel, yaze::editor::MinecartTrackEditorPanel, yaze::editor::MusicAssemblyPanel, yaze::editor::MusicAudioDebugPanel, yaze::editor::MusicHelpPanel, yaze::editor::MusicInstrumentEditorPanel, yaze::editor::MusicPianoRollPanel, yaze::editor::MusicPlaybackControlPanel, yaze::editor::MusicSampleEditorPanel, yaze::editor::MusicSongBrowserPanel, yaze::editor::NamingScreenPanel, yaze::editor::ObjectEditorPanel, yaze::editor::ObjectTileEditorPanel, yaze::editor::OracleMenuInspectorPanel, yaze::editor::OracleRamPanel, yaze::editor::OracleStateLibraryEditorPanel, yaze::editor::OracleValidationPanel, yaze::editor::OverlayManagerPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::OverworldMapScreenPanel, yaze::editor::PaletteControlPanel, yaze::editor::PaletteControlsPanel, yaze::editor::PaletteGroupPanel, yaze::editor::PixelEditorPanel, yaze::editor::PolyhedralEditorPanel, yaze::editor::ProgressionDashboardPanel, yaze::editor::QuickAccessPalettePanel, yaze::editor::ResourcePanel, yaze::editor::RoomTagEditorPanel, yaze::editor::ScratchSpacePanel, yaze::editor::SheetBrowserPanel, yaze::editor::SpriteEditorPanel, yaze::editor::SramViewerEditorPanel, yaze::editor::StoryEventGraphPanel, yaze::editor::Tile16EditorPanel, yaze::editor::Tile16SelectorPanel, yaze::editor::Tile8SelectorPanel, yaze::editor::TitleScreenPanel, yaze::editor::UsageStatisticsPanel, yaze::editor::V3SettingsPanel, yaze::editor::VanillaSpriteEditorPanel, and yaze::editor::WaterFillPanel.

Public Member Functions

virtual ~EditorPanel ()=default
 
virtual std::string GetId () const =0
 Unique identifier for this panel.
 
virtual std::string GetDisplayName () const =0
 Human-readable name shown in menus and title bars.
 
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 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 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.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Protected Member Functions

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)
 

Private Attributes

bool lazy_init_done_ = false
 
bool cache_valid_ = false
 
std::unordered_map< std::string, std::any > cache_
 

Detailed Description

Base interface for all logical panel components.

EditorPanel represents a logical UI component that draws content within a panel window. This is distinct from PanelWindow (the ImGui wrapper that draws the window chrome/title bar).

The separation allows:

  • PanelManager to handle window creation/visibility centrally
  • Panel components to focus purely on content drawing
  • Consistent window behavior across all editors

Example

public:
std::string GetId() const override { return "overworld.usage_stats"; }
std::string GetDisplayName() const override { return "Usage Statistics"; }
std::string GetIcon() const override { return ICON_MD_ANALYTICS; }
std::string GetEditorCategory() const override { return "Overworld"; }
void Draw(bool* p_open) override {
// Draw your content here - no ImGui::Begin/End needed
// PanelManager handles the window wrapper
DrawUsageGrid();
DrawUsageStates();
}
};
Base interface for all logical panel components.
Displays tile usage statistics across all overworld maps.
#define ICON_MD_ANALYTICS
Definition icons.h:154
See also
PanelWindow - The ImGui window wrapper (draws chrome)
PanelManager - Central registry that manages panel lifecycle
PanelDescriptor - Metadata struct for panel registration

Definition at line 90 of file editor_panel.h.

Constructor & Destructor Documentation

◆ ~EditorPanel()

virtual yaze::editor::EditorPanel::~EditorPanel ( )
virtualdefault

Member Function Documentation

◆ GetId()

virtual std::string yaze::editor::EditorPanel::GetId ( ) const
pure virtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implemented in yaze::editor::OracleRamPanel, yaze::editor::AgentConfigurationPanel, yaze::editor::AgentStatusPanel, yaze::editor::AgentPromptEditorPanel, yaze::editor::AgentBotProfilesPanel, yaze::editor::AgentChatHistoryPanel, yaze::editor::AgentMetricsDashboardPanel, yaze::editor::AgentBuilderPanel, yaze::editor::AgentMesenDebugPanel, yaze::editor::AgentKnowledgeBasePanel, yaze::editor::AgentChatPanel, yaze::editor::OracleStateLibraryEditorPanel, yaze::editor::FeatureFlagEditorEditorPanel, yaze::editor::ManifestEditorPanel, yaze::editor::SramViewerEditorPanel, yaze::editor::MesenScreenshotEditorPanel, yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblySymbolsPanel, yaze::editor::AssemblyBuildOutputPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::ChestEditorPanel, yaze::editor::CustomCollisionPanel, yaze::editor::DungeonEmulatorPreviewPanel, yaze::editor::DungeonEntranceListPanel, yaze::editor::DungeonEntrancesPanel, yaze::editor::DungeonMapPanel, yaze::editor::DungeonPaletteEditorPanel, yaze::editor::DungeonRoomGraphicsPanel, yaze::editor::DungeonRoomMatrixPanel, yaze::editor::DungeonRoomSelectorPanel, yaze::editor::DungeonSettingsPanel, yaze::editor::DungeonWorkbenchPanel, yaze::editor::ItemEditorPanel, yaze::editor::MinecartTrackEditorPanel, yaze::editor::ObjectEditorPanel, yaze::editor::ObjectTileEditorPanel, yaze::editor::OverlayManagerPanel, yaze::editor::RoomTagEditorPanel, yaze::editor::SpriteEditorPanel, yaze::editor::WaterFillPanel, yaze::editor::LinkSpritePanel, yaze::editor::PaletteControlsPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::GraphicsPaletteControlsPanel, yaze::editor::GraphicsLinkSpritePanel, yaze::editor::GraphicsPolyhedralPanel, yaze::editor::GraphicsGfxGroupPanel, yaze::editor::GraphicsPrototypeViewerPanel, yaze::editor::GraphicsPalettesetPanel, yaze::editor::DungeonMapsPanel, yaze::editor::InventoryMenuPanel, yaze::editor::OverworldMapScreenPanel, yaze::editor::TitleScreenPanel, yaze::editor::NamingScreenPanel, yaze::editor::PixelEditorPanel, yaze::editor::PolyhedralEditorPanel, yaze::editor::SheetBrowserPanel, yaze::editor::MessageListPanel, yaze::editor::MessageEditorPanel, yaze::editor::FontAtlasPanel, yaze::editor::DictionaryPanel, yaze::editor::MusicAssemblyPanel, yaze::editor::MusicAudioDebugPanel, yaze::editor::MusicHelpPanel, yaze::editor::MusicInstrumentEditorPanel, yaze::editor::MusicPianoRollPanel, yaze::editor::MusicPlaybackControlPanel, yaze::editor::MusicSampleEditorPanel, yaze::editor::MusicSongBrowserPanel, yaze::editor::AnnotationOverlayPanel, yaze::editor::OracleMenuInspectorPanel, yaze::editor::OracleValidationPanel, yaze::editor::ProgressionDashboardPanel, yaze::editor::StoryEventGraphPanel, yaze::editor::AreaGraphicsPanel, yaze::editor::DebugWindowPanel, yaze::editor::GfxGroupsPanel, yaze::editor::MapPropertiesPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::ScratchSpacePanel, yaze::editor::Tile16EditorPanel, yaze::editor::Tile16SelectorPanel, yaze::editor::Tile8SelectorPanel, yaze::editor::UsageStatisticsPanel, yaze::editor::V3SettingsPanel, yaze::editor::PaletteControlPanel, yaze::editor::QuickAccessPalettePanel, yaze::editor::CustomPalettePanel, yaze::editor::PaletteGroupPanel, yaze::editor::VanillaSpriteEditorPanel, yaze::editor::CustomSpriteEditorPanel, yaze::editor::ResourcePanel, and yaze::editor::AboutPanel.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel(), and yaze::editor::PanelManager::RegisterPanelDescriptorForSession().

◆ GetDisplayName()

virtual std::string yaze::editor::EditorPanel::GetDisplayName ( ) const
pure virtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implemented in yaze::editor::OracleRamPanel, yaze::editor::AgentConfigurationPanel, yaze::editor::AgentStatusPanel, yaze::editor::AgentPromptEditorPanel, yaze::editor::AgentBotProfilesPanel, yaze::editor::AgentChatHistoryPanel, yaze::editor::AgentMetricsDashboardPanel, yaze::editor::AgentBuilderPanel, yaze::editor::AgentMesenDebugPanel, yaze::editor::AgentKnowledgeBasePanel, yaze::editor::AgentChatPanel, yaze::editor::OracleStateLibraryEditorPanel, yaze::editor::FeatureFlagEditorEditorPanel, yaze::editor::ManifestEditorPanel, yaze::editor::SramViewerEditorPanel, yaze::editor::MesenScreenshotEditorPanel, yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblySymbolsPanel, yaze::editor::AssemblyBuildOutputPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::ChestEditorPanel, yaze::editor::CustomCollisionPanel, yaze::editor::DungeonEmulatorPreviewPanel, yaze::editor::DungeonEntranceListPanel, yaze::editor::DungeonEntrancesPanel, yaze::editor::DungeonMapPanel, yaze::editor::DungeonPaletteEditorPanel, yaze::editor::DungeonRoomGraphicsPanel, yaze::editor::DungeonRoomMatrixPanel, yaze::editor::DungeonRoomSelectorPanel, yaze::editor::DungeonSettingsPanel, yaze::editor::DungeonWorkbenchPanel, yaze::editor::ItemEditorPanel, yaze::editor::MinecartTrackEditorPanel, yaze::editor::ObjectEditorPanel, yaze::editor::ObjectTileEditorPanel, yaze::editor::OverlayManagerPanel, yaze::editor::RoomTagEditorPanel, yaze::editor::SpriteEditorPanel, yaze::editor::WaterFillPanel, yaze::editor::LinkSpritePanel, yaze::editor::PaletteControlsPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::GraphicsPaletteControlsPanel, yaze::editor::GraphicsLinkSpritePanel, yaze::editor::GraphicsPolyhedralPanel, yaze::editor::GraphicsGfxGroupPanel, yaze::editor::GraphicsPrototypeViewerPanel, yaze::editor::GraphicsPalettesetPanel, yaze::editor::DungeonMapsPanel, yaze::editor::InventoryMenuPanel, yaze::editor::OverworldMapScreenPanel, yaze::editor::TitleScreenPanel, yaze::editor::NamingScreenPanel, yaze::editor::PixelEditorPanel, yaze::editor::PolyhedralEditorPanel, yaze::editor::SheetBrowserPanel, yaze::editor::MessageListPanel, yaze::editor::MessageEditorPanel, yaze::editor::FontAtlasPanel, yaze::editor::DictionaryPanel, yaze::editor::MusicAssemblyPanel, yaze::editor::MusicAudioDebugPanel, yaze::editor::MusicHelpPanel, yaze::editor::MusicInstrumentEditorPanel, yaze::editor::MusicPianoRollPanel, yaze::editor::MusicPlaybackControlPanel, yaze::editor::MusicSampleEditorPanel, yaze::editor::MusicSongBrowserPanel, yaze::editor::AnnotationOverlayPanel, yaze::editor::OracleMenuInspectorPanel, yaze::editor::OracleValidationPanel, yaze::editor::ProgressionDashboardPanel, yaze::editor::StoryEventGraphPanel, yaze::editor::AreaGraphicsPanel, yaze::editor::DebugWindowPanel, yaze::editor::GfxGroupsPanel, yaze::editor::MapPropertiesPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::ScratchSpacePanel, yaze::editor::Tile16EditorPanel, yaze::editor::Tile16SelectorPanel, yaze::editor::Tile8SelectorPanel, yaze::editor::UsageStatisticsPanel, yaze::editor::V3SettingsPanel, yaze::editor::PaletteControlPanel, yaze::editor::QuickAccessPalettePanel, yaze::editor::CustomPalettePanel, yaze::editor::PaletteGroupPanel, yaze::editor::VanillaSpriteEditorPanel, yaze::editor::CustomSpriteEditorPanel, yaze::editor::ResourcePanel, and yaze::editor::AboutPanel.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel(), and yaze::editor::PanelManager::DrawAllVisiblePanels().

◆ GetIcon()

virtual std::string yaze::editor::EditorPanel::GetIcon ( ) const
pure virtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implemented in yaze::editor::OracleRamPanel, yaze::editor::AgentConfigurationPanel, yaze::editor::AgentStatusPanel, yaze::editor::AgentPromptEditorPanel, yaze::editor::AgentBotProfilesPanel, yaze::editor::AgentChatHistoryPanel, yaze::editor::AgentMetricsDashboardPanel, yaze::editor::AgentBuilderPanel, yaze::editor::AgentMesenDebugPanel, yaze::editor::AgentKnowledgeBasePanel, yaze::editor::AgentChatPanel, yaze::editor::OracleStateLibraryEditorPanel, yaze::editor::FeatureFlagEditorEditorPanel, yaze::editor::ManifestEditorPanel, yaze::editor::SramViewerEditorPanel, yaze::editor::MesenScreenshotEditorPanel, yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblySymbolsPanel, yaze::editor::AssemblyBuildOutputPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::ChestEditorPanel, yaze::editor::CustomCollisionPanel, yaze::editor::DungeonEmulatorPreviewPanel, yaze::editor::DungeonEntranceListPanel, yaze::editor::DungeonEntrancesPanel, yaze::editor::DungeonMapPanel, yaze::editor::DungeonPaletteEditorPanel, yaze::editor::DungeonRoomGraphicsPanel, yaze::editor::DungeonRoomMatrixPanel, yaze::editor::DungeonRoomPanel, yaze::editor::DungeonRoomSelectorPanel, yaze::editor::DungeonSettingsPanel, yaze::editor::DungeonWorkbenchPanel, yaze::editor::ItemEditorPanel, yaze::editor::MinecartTrackEditorPanel, yaze::editor::ObjectEditorPanel, yaze::editor::ObjectTileEditorPanel, yaze::editor::OverlayManagerPanel, yaze::editor::RoomTagEditorPanel, yaze::editor::SpriteEditorPanel, yaze::editor::WaterFillPanel, yaze::editor::LinkSpritePanel, yaze::editor::PaletteControlsPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::GraphicsPaletteControlsPanel, yaze::editor::GraphicsLinkSpritePanel, yaze::editor::GraphicsPolyhedralPanel, yaze::editor::GraphicsGfxGroupPanel, yaze::editor::GraphicsPrototypeViewerPanel, yaze::editor::GraphicsPalettesetPanel, yaze::editor::DungeonMapsPanel, yaze::editor::InventoryMenuPanel, yaze::editor::OverworldMapScreenPanel, yaze::editor::TitleScreenPanel, yaze::editor::NamingScreenPanel, yaze::editor::PixelEditorPanel, yaze::editor::PolyhedralEditorPanel, yaze::editor::SheetBrowserPanel, yaze::editor::MessageListPanel, yaze::editor::MessageEditorPanel, yaze::editor::FontAtlasPanel, yaze::editor::DictionaryPanel, yaze::editor::MusicAssemblyPanel, yaze::editor::MusicAudioDebugPanel, yaze::editor::MusicHelpPanel, yaze::editor::MusicInstrumentEditorPanel, yaze::editor::MusicPianoRollPanel, yaze::editor::MusicPlaybackControlPanel, yaze::editor::MusicSampleEditorPanel, yaze::editor::MusicSongBrowserPanel, yaze::editor::AnnotationOverlayPanel, yaze::editor::OracleMenuInspectorPanel, yaze::editor::OracleValidationPanel, yaze::editor::ProgressionDashboardPanel, yaze::editor::StoryEventGraphPanel, yaze::editor::AreaGraphicsPanel, yaze::editor::DebugWindowPanel, yaze::editor::GfxGroupsPanel, yaze::editor::MapPropertiesPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::ScratchSpacePanel, yaze::editor::Tile16EditorPanel, yaze::editor::Tile16SelectorPanel, yaze::editor::Tile8SelectorPanel, yaze::editor::UsageStatisticsPanel, yaze::editor::V3SettingsPanel, yaze::editor::PaletteControlPanel, yaze::editor::QuickAccessPalettePanel, yaze::editor::CustomPalettePanel, yaze::editor::PaletteGroupPanel, yaze::editor::OverworldMainPalettePanel, yaze::editor::OverworldAnimatedPalettePanel, yaze::editor::DungeonMainPalettePanel, yaze::editor::SpritePalettePanel, yaze::editor::SpritesAux1PalettePanel, yaze::editor::SpritesAux2PalettePanel, yaze::editor::SpritesAux3PalettePanel, yaze::editor::EquipmentPalettePanel, yaze::editor::VanillaSpriteEditorPanel, yaze::editor::CustomSpriteEditorPanel, and yaze::editor::AboutPanel.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel(), and yaze::editor::PanelManager::DrawAllVisiblePanels().

◆ GetEditorCategory()

virtual std::string yaze::editor::EditorPanel::GetEditorCategory ( ) const
pure virtual

Editor category this panel belongs to.

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

Implemented in yaze::editor::OracleRamPanel, yaze::editor::AgentConfigurationPanel, yaze::editor::AgentStatusPanel, yaze::editor::AgentPromptEditorPanel, yaze::editor::AgentBotProfilesPanel, yaze::editor::AgentChatHistoryPanel, yaze::editor::AgentMetricsDashboardPanel, yaze::editor::AgentBuilderPanel, yaze::editor::AgentMesenDebugPanel, yaze::editor::AgentKnowledgeBasePanel, yaze::editor::AgentChatPanel, yaze::editor::OracleStateLibraryEditorPanel, yaze::editor::FeatureFlagEditorEditorPanel, yaze::editor::ManifestEditorPanel, yaze::editor::SramViewerEditorPanel, yaze::editor::MesenScreenshotEditorPanel, yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblySymbolsPanel, yaze::editor::AssemblyBuildOutputPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::ChestEditorPanel, yaze::editor::CustomCollisionPanel, yaze::editor::DungeonEmulatorPreviewPanel, yaze::editor::DungeonEntranceListPanel, yaze::editor::DungeonEntrancesPanel, yaze::editor::DungeonMapPanel, yaze::editor::DungeonPaletteEditorPanel, yaze::editor::DungeonRoomGraphicsPanel, yaze::editor::DungeonRoomMatrixPanel, yaze::editor::DungeonRoomPanel, yaze::editor::DungeonRoomSelectorPanel, yaze::editor::DungeonSettingsPanel, yaze::editor::DungeonWorkbenchPanel, yaze::editor::ItemEditorPanel, yaze::editor::MinecartTrackEditorPanel, yaze::editor::ObjectEditorPanel, yaze::editor::ObjectTileEditorPanel, yaze::editor::OverlayManagerPanel, yaze::editor::RoomTagEditorPanel, yaze::editor::SpriteEditorPanel, yaze::editor::WaterFillPanel, yaze::editor::LinkSpritePanel, yaze::editor::PaletteControlsPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::GraphicsPaletteControlsPanel, yaze::editor::GraphicsLinkSpritePanel, yaze::editor::GraphicsPolyhedralPanel, yaze::editor::GraphicsGfxGroupPanel, yaze::editor::GraphicsPrototypeViewerPanel, yaze::editor::GraphicsPalettesetPanel, yaze::editor::DungeonMapsPanel, yaze::editor::InventoryMenuPanel, yaze::editor::OverworldMapScreenPanel, yaze::editor::TitleScreenPanel, yaze::editor::NamingScreenPanel, yaze::editor::PixelEditorPanel, yaze::editor::PolyhedralEditorPanel, yaze::editor::SheetBrowserPanel, yaze::editor::MessageListPanel, yaze::editor::MessageEditorPanel, yaze::editor::FontAtlasPanel, yaze::editor::DictionaryPanel, yaze::editor::MusicAssemblyPanel, yaze::editor::MusicAudioDebugPanel, yaze::editor::MusicHelpPanel, yaze::editor::MusicInstrumentEditorPanel, yaze::editor::MusicPianoRollPanel, yaze::editor::MusicPlaybackControlPanel, yaze::editor::MusicSampleEditorPanel, yaze::editor::MusicSongBrowserPanel, yaze::editor::AnnotationOverlayPanel, yaze::editor::OracleMenuInspectorPanel, yaze::editor::OracleValidationPanel, yaze::editor::ProgressionDashboardPanel, yaze::editor::StoryEventGraphPanel, yaze::editor::AreaGraphicsPanel, yaze::editor::DebugWindowPanel, yaze::editor::GfxGroupsPanel, yaze::editor::MapPropertiesPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::ScratchSpacePanel, yaze::editor::Tile16EditorPanel, yaze::editor::Tile16SelectorPanel, yaze::editor::Tile8SelectorPanel, yaze::editor::UsageStatisticsPanel, yaze::editor::V3SettingsPanel, yaze::editor::PaletteControlPanel, yaze::editor::QuickAccessPalettePanel, yaze::editor::CustomPalettePanel, yaze::editor::PaletteGroupPanel, yaze::editor::VanillaSpriteEditorPanel, yaze::editor::CustomSpriteEditorPanel, and yaze::editor::AboutPanel.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel(), yaze::editor::PanelManager::DrawAllVisiblePanels(), and yaze::editor::ResourcePanel::GetId().

◆ Draw()

virtual void yaze::editor::EditorPanel::Draw ( bool * p_open)
pure virtual

Draw the panel content.

Parameters
p_openPointer 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.

Implemented in yaze::editor::AnnotationOverlayPanel, yaze::editor::StoryEventGraphPanel, yaze::editor::OracleRamPanel, yaze::editor::AgentConfigurationPanel, yaze::editor::AgentStatusPanel, yaze::editor::AgentPromptEditorPanel, yaze::editor::AgentBotProfilesPanel, yaze::editor::AgentChatHistoryPanel, yaze::editor::AgentMetricsDashboardPanel, yaze::editor::AgentBuilderPanel, yaze::editor::AgentMesenDebugPanel, yaze::editor::AgentKnowledgeBasePanel, yaze::editor::AgentChatPanel, yaze::editor::OracleStateLibraryEditorPanel, yaze::editor::FeatureFlagEditorEditorPanel, yaze::editor::ManifestEditorPanel, yaze::editor::SramViewerEditorPanel, yaze::editor::MesenScreenshotEditorPanel, yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblySymbolsPanel, yaze::editor::AssemblyBuildOutputPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::ChestEditorPanel, yaze::editor::CustomCollisionPanel, yaze::editor::DungeonEmulatorPreviewPanel, yaze::editor::DungeonEntranceListPanel, yaze::editor::DungeonEntrancesPanel, yaze::editor::DungeonMapPanel, yaze::editor::DungeonPaletteEditorPanel, yaze::editor::DungeonRoomGraphicsPanel, yaze::editor::DungeonRoomMatrixPanel, yaze::editor::DungeonRoomPanel, yaze::editor::DungeonRoomSelectorPanel, yaze::editor::DungeonSettingsPanel, yaze::editor::DungeonWorkbenchPanel, yaze::editor::ItemEditorPanel, yaze::editor::MinecartTrackEditorPanel, yaze::editor::ObjectEditorPanel, yaze::editor::ObjectTileEditorPanel, yaze::editor::OverlayManagerPanel, yaze::editor::RoomTagEditorPanel, yaze::editor::SpriteEditorPanel, yaze::editor::WaterFillPanel, yaze::editor::LinkSpritePanel, yaze::editor::PaletteControlsPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::GraphicsPaletteControlsPanel, yaze::editor::GraphicsLinkSpritePanel, yaze::editor::GraphicsPolyhedralPanel, yaze::editor::GraphicsGfxGroupPanel, yaze::editor::GraphicsPrototypeViewerPanel, yaze::editor::GraphicsPalettesetPanel, yaze::editor::DungeonMapsPanel, yaze::editor::InventoryMenuPanel, yaze::editor::OverworldMapScreenPanel, yaze::editor::TitleScreenPanel, yaze::editor::NamingScreenPanel, yaze::editor::PixelEditorPanel, yaze::editor::PolyhedralEditorPanel, yaze::editor::SheetBrowserPanel, yaze::editor::MessageListPanel, yaze::editor::MessageEditorPanel, yaze::editor::FontAtlasPanel, yaze::editor::DictionaryPanel, yaze::editor::MusicAssemblyPanel, yaze::editor::MusicAudioDebugPanel, yaze::editor::MusicHelpPanel, yaze::editor::MusicInstrumentEditorPanel, yaze::editor::MusicPianoRollPanel, yaze::editor::MusicPlaybackControlPanel, yaze::editor::MusicSampleEditorPanel, yaze::editor::MusicSongBrowserPanel, yaze::editor::OracleMenuInspectorPanel, yaze::editor::OracleValidationPanel, yaze::editor::ProgressionDashboardPanel, yaze::editor::AreaGraphicsPanel, yaze::editor::DebugWindowPanel, yaze::editor::GfxGroupsPanel, yaze::editor::MapPropertiesPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::ScratchSpacePanel, yaze::editor::Tile16EditorPanel, yaze::editor::Tile16SelectorPanel, yaze::editor::Tile8SelectorPanel, yaze::editor::UsageStatisticsPanel, yaze::editor::V3SettingsPanel, yaze::editor::PaletteControlPanel, yaze::editor::QuickAccessPalettePanel, yaze::editor::CustomPalettePanel, yaze::editor::PaletteGroupPanel, yaze::editor::VanillaSpriteEditorPanel, yaze::editor::CustomSpriteEditorPanel, and yaze::editor::AboutPanel.

Referenced by DrawWithLazyInit().

◆ OnFirstDraw()

virtual void yaze::editor::EditorPanel::OnFirstDraw ( )
inlinevirtual

Called once before the first Draw() in a session.

Use this for expensive one-time initialization that should be deferred until the panel is actually visible. This avoids loading resources for panels that may never be opened.

Note
Reset via InvalidateLazyInit() on session switches if needed.
See also
RequiresLazyInit()

Definition at line 155 of file editor_panel.h.

Referenced by DrawWithLazyInit().

◆ RequiresLazyInit()

virtual bool yaze::editor::EditorPanel::RequiresLazyInit ( ) const
inlinevirtual

Whether this panel uses lazy initialization.

Returns
true if OnFirstDraw() should be called before first Draw()

Override to return true if your panel has expensive setup in OnFirstDraw(). When false (default), OnFirstDraw() is skipped for performance.

Definition at line 164 of file editor_panel.h.

Referenced by DrawWithLazyInit().

◆ InvalidateLazyInit()

void yaze::editor::EditorPanel::InvalidateLazyInit ( )
inline

Reset lazy init state so OnFirstDraw() runs again.

Call this when panel state needs to be reinitialized (e.g., session switch). The next Draw() will trigger OnFirstDraw() again.

Definition at line 383 of file editor_panel.h.

References lazy_init_done_.

◆ OnOpen()

virtual void yaze::editor::EditorPanel::OnOpen ( )
inlinevirtual

Called when panel becomes visible.

Use this to initialize state, load resources, or start animations. Called after the panel is shown but before first Draw().

Reimplemented in yaze::editor::OracleRamPanel, and yaze::editor::ObjectEditorPanel.

Definition at line 180 of file editor_panel.h.

◆ OnClose()

virtual void yaze::editor::EditorPanel::OnClose ( )
inlinevirtual

Called when panel is hidden.

Use this to cleanup state, release resources, or save state. Called after the panel is hidden.

Reimplemented in yaze::editor::DungeonEmulatorPreviewPanel, and yaze::editor::ObjectEditorPanel.

Definition at line 188 of file editor_panel.h.

Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().

◆ OnFocus()

virtual void yaze::editor::EditorPanel::OnFocus ( )
inlinevirtual

Called when panel receives focus.

Use this to update state based on becoming the active panel.

Definition at line 195 of file editor_panel.h.

◆ GetPanelCategory()

virtual PanelCategory yaze::editor::EditorPanel::GetPanelCategory ( ) const
inlinevirtual

◆ GetContextScope()

virtual PanelContextScope yaze::editor::EditorPanel::GetContextScope ( ) const
inlinevirtual

Optional context binding for this panel (room/selection/etc)

Returns
PanelContextScope used by PanelManager policy (default: none)

Definition at line 215 of file editor_panel.h.

References yaze::editor::kNone.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel().

◆ GetScope()

virtual PanelScope yaze::editor::EditorPanel::GetScope ( ) const
inlinevirtual

Get the registration scope for this panel.

Returns
PanelScope indicating session or global scope

Default is session-scoped.

Reimplemented in yaze::editor::AboutPanel.

Definition at line 225 of file editor_panel.h.

References yaze::editor::kSession.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel(), and yaze::editor::PanelManager::RegisterPanelDescriptorForSession().

◆ IsEnabled()

virtual bool yaze::editor::EditorPanel::IsEnabled ( ) const
inlinevirtual

Check if this panel is currently enabled.

Returns
true if panel can be shown, false if disabled

Disabled panels appear grayed out in menus. Override to implement conditional availability (e.g., requires ROM loaded).

Definition at line 234 of file editor_panel.h.

◆ GetDisabledTooltip()

virtual std::string yaze::editor::EditorPanel::GetDisabledTooltip ( ) const
inlinevirtual

Get tooltip text when panel is disabled.

Returns
Explanation of why panel is disabled (e.g., "Requires ROM to be loaded")

Definition at line 240 of file editor_panel.h.

◆ GetShortcutHint()

virtual std::string yaze::editor::EditorPanel::GetShortcutHint ( ) const
inlinevirtual

Get keyboard shortcut hint for display.

Returns
Shortcut string (e.g., "Ctrl+Shift+R")

Reimplemented in yaze::editor::AgentMesenDebugPanel, yaze::editor::OracleStateLibraryEditorPanel, and yaze::editor::OverworldCanvasPanel.

Definition at line 246 of file editor_panel.h.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel().

◆ GetPriority()

virtual int yaze::editor::EditorPanel::GetPriority ( ) const
inlinevirtual

Get display priority for menu ordering.

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

Reimplemented in yaze::editor::AgentConfigurationPanel, yaze::editor::AgentStatusPanel, yaze::editor::AgentPromptEditorPanel, yaze::editor::AgentBotProfilesPanel, yaze::editor::AgentChatHistoryPanel, yaze::editor::AgentMetricsDashboardPanel, yaze::editor::AgentBuilderPanel, yaze::editor::AgentMesenDebugPanel, yaze::editor::AgentKnowledgeBasePanel, yaze::editor::AgentChatPanel, yaze::editor::OracleStateLibraryEditorPanel, yaze::editor::FeatureFlagEditorEditorPanel, yaze::editor::ManifestEditorPanel, yaze::editor::SramViewerEditorPanel, yaze::editor::MesenScreenshotEditorPanel, yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblySymbolsPanel, yaze::editor::AssemblyBuildOutputPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::ChestEditorPanel, yaze::editor::DungeonEmulatorPreviewPanel, yaze::editor::DungeonEntranceListPanel, yaze::editor::DungeonEntrancesPanel, yaze::editor::DungeonMapPanel, yaze::editor::DungeonPaletteEditorPanel, yaze::editor::DungeonRoomGraphicsPanel, yaze::editor::DungeonRoomMatrixPanel, yaze::editor::DungeonRoomPanel, yaze::editor::DungeonRoomSelectorPanel, yaze::editor::DungeonWorkbenchPanel, yaze::editor::ItemEditorPanel, yaze::editor::ObjectEditorPanel, yaze::editor::ObjectTileEditorPanel, yaze::editor::OverlayManagerPanel, yaze::editor::RoomTagEditorPanel, yaze::editor::SpriteEditorPanel, yaze::editor::LinkSpritePanel, yaze::editor::PaletteControlsPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::GraphicsPaletteControlsPanel, yaze::editor::GraphicsLinkSpritePanel, yaze::editor::GraphicsPolyhedralPanel, yaze::editor::GraphicsGfxGroupPanel, yaze::editor::GraphicsPrototypeViewerPanel, yaze::editor::GraphicsPalettesetPanel, yaze::editor::DungeonMapsPanel, yaze::editor::InventoryMenuPanel, yaze::editor::OverworldMapScreenPanel, yaze::editor::TitleScreenPanel, yaze::editor::NamingScreenPanel, yaze::editor::PixelEditorPanel, yaze::editor::PolyhedralEditorPanel, yaze::editor::SheetBrowserPanel, yaze::editor::MessageListPanel, yaze::editor::MessageEditorPanel, yaze::editor::FontAtlasPanel, yaze::editor::DictionaryPanel, yaze::editor::MusicAssemblyPanel, yaze::editor::MusicAudioDebugPanel, yaze::editor::MusicHelpPanel, yaze::editor::MusicInstrumentEditorPanel, yaze::editor::MusicPianoRollPanel, yaze::editor::MusicPlaybackControlPanel, yaze::editor::MusicSampleEditorPanel, yaze::editor::MusicSongBrowserPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::Tile16EditorPanel, yaze::editor::PaletteControlPanel, yaze::editor::QuickAccessPalettePanel, yaze::editor::CustomPalettePanel, yaze::editor::PaletteGroupPanel, yaze::editor::OverworldMainPalettePanel, yaze::editor::OverworldAnimatedPalettePanel, yaze::editor::DungeonMainPalettePanel, yaze::editor::SpritePalettePanel, yaze::editor::SpritesAux1PalettePanel, yaze::editor::SpritesAux2PalettePanel, yaze::editor::SpritesAux3PalettePanel, yaze::editor::EquipmentPalettePanel, yaze::editor::VanillaSpriteEditorPanel, and yaze::editor::CustomSpriteEditorPanel.

Definition at line 252 of file editor_panel.h.

Referenced by yaze::editor::anonymous_namespace{panel_manager.cc}::BuildDescriptorFromPanel().

◆ GetPreferredWidth()

◆ IsVisibleByDefault()

virtual bool yaze::editor::EditorPanel::IsVisibleByDefault ( ) const
inlinevirtual

Whether this panel should be visible by default.

Returns
true if panel should be visible when editor first opens

Override this to set panels as visible by default. Most panels default to hidden to reduce UI clutter.

Reimplemented in yaze::editor::AssemblyCodeEditorPanel, yaze::editor::AssemblyFileBrowserPanel, yaze::editor::AssemblyToolbarPanel, yaze::editor::GraphicsSheetBrowserPanel, yaze::editor::GraphicsPixelEditorPanel, yaze::editor::OverworldCanvasPanel, yaze::editor::Tile16SelectorPanel, and yaze::editor::VanillaSpriteEditorPanel.

Definition at line 270 of file editor_panel.h.

Referenced by yaze::editor::PanelManager::RegisterPanelDescriptorForSession().

◆ GetParentPanelId()

virtual std::string yaze::editor::EditorPanel::GetParentPanelId ( ) const
inlinevirtual

Get parent panel ID for cascade behavior.

Returns
Parent panel ID, or empty string if no parent

If set, this panel may be automatically closed when parent closes (depending on parent's CascadeCloseChildren() setting).

Definition at line 283 of file editor_panel.h.

◆ CascadeCloseChildren()

virtual bool yaze::editor::EditorPanel::CascadeCloseChildren ( ) const
inlinevirtual

Whether closing this panel should close child panels.

Returns
true to cascade close to children, false to leave children open

Only affects panels that have this panel as their parent.

Definition at line 291 of file editor_panel.h.

◆ DrawWithLazyInit()

void yaze::editor::EditorPanel::DrawWithLazyInit ( bool * p_open)
inline

Execute lazy initialization if needed, then call Draw()

Parameters
p_openPointer to visibility flag

Called by PanelManager. Handles OnFirstDraw() invocation automatically.

Definition at line 303 of file editor_panel.h.

References Draw(), lazy_init_done_, OnFirstDraw(), and RequiresLazyInit().

Referenced by yaze::editor::PanelManager::DrawAllVisiblePanels().

Here is the call graph for this function:

◆ InvalidateCache()

void yaze::editor::EditorPanel::InvalidateCache ( )
inlineprotected

Invalidate all cached computations.

Call this when the underlying data changes and cached values are stale. Common triggers:

  • Session switch (data context changes)
  • ROM data modification
  • Settings changes that affect computed values

Definition at line 325 of file editor_panel.h.

References cache_valid_.

◆ GetCached()

template<typename T >
T & yaze::editor::EditorPanel::GetCached ( const std::string & key,
std::function< T()> compute )
inlineprotected

Get or compute a cached value.

Template Parameters
TThe type of the cached value
Parameters
keyUnique identifier for this cached value
computeFunction to compute the value if not cached
Returns
Reference to the cached value

Example usage:

int GetExpensiveResult() {
return GetCached<int>("expensive_result", [this]() {
// Expensive computation here
return ComputeExpensiveValue();
});
}
Note
The cache is invalidated when InvalidateCache() is called.
Values are stored using std::any, so complex types work fine.

Definition at line 348 of file editor_panel.h.

References cache_, and cache_valid_.

◆ IsCacheValid()

bool yaze::editor::EditorPanel::IsCacheValid ( ) const
inlineprotected

Check if cache has been invalidated.

Returns
true if cache is valid, false if InvalidateCache() was called

Definition at line 360 of file editor_panel.h.

References cache_valid_.

◆ ClearCache()

void yaze::editor::EditorPanel::ClearCache ( )
inlineprotected

Clear all cached values (more aggressive than InvalidateCache)

Use this when you need to free memory, not just mark values as stale. InvalidateCache() just marks the cache as invalid but keeps values for potential debugging or lazy re-computation.

Definition at line 369 of file editor_panel.h.

References cache_, and cache_valid_.

Member Data Documentation

◆ lazy_init_done_

bool yaze::editor::EditorPanel::lazy_init_done_ = false
private

Definition at line 375 of file editor_panel.h.

Referenced by DrawWithLazyInit(), and InvalidateLazyInit().

◆ cache_valid_

bool yaze::editor::EditorPanel::cache_valid_ = false
private

Definition at line 378 of file editor_panel.h.

Referenced by ClearCache(), GetCached(), InvalidateCache(), and IsCacheValid().

◆ cache_

std::unordered_map<std::string, std::any> yaze::editor::EditorPanel::cache_
private

Definition at line 379 of file editor_panel.h.

Referenced by ClearCache(), and GetCached().


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