WindowContent for placing and managing dungeon sprites. More...
#include <sprite_editor_panel.h>
Public Member Functions | |
| SpriteEditorPanel (int *current_room_id, DungeonRoomStore *rooms, DungeonCanvasViewer *canvas_viewer=nullptr) | |
| 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. | |
| std::string | GetWorkflowGroup () const override |
| Optional workflow group for hack-centric actions. | |
| void | Draw (bool *p_open) override |
| Draw the panel content. | |
| void | DrawInWorkbench () |
| void | SetCanvasViewer (DungeonCanvasViewer *viewer) |
| void | SetSpritePlacedCallback (std::function< void(const zelda3::Sprite &)> callback) |
| void | SetOpenSelectionInspectorCallback (std::function< void()> callback) |
Public Member Functions inherited from yaze::editor::WindowContent | |
| virtual | ~WindowContent ()=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 WindowLifecycle | GetWindowLifecycle () const |
| Get the lifecycle category for this window. | |
| 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 WindowPresentationPolicy | GetPresentationPolicy () const |
| How this content is hosted and advertised by workspace chrome. | |
| 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 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 | HasExactPreferredWidth () const |
| Whether GetPreferredWidth() is an exact content width. | |
| virtual float | GetPreferredHeight () const |
| Get preferred height for this panel (optional) | |
| virtual bool | PrefersFloating () const |
| 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() | |
Private Member Functions | |
| void | DrawContent (bool show_room_sprites) |
| void | DrawPlacementControls () |
| void | DrawSpriteSelector (bool show_room_sprites) |
| void | DrawRoomSprites () |
| std::string | SpriteName (int sprite_id) const |
| bool | MatchesFilter (int sprite_id) const |
Private Attributes | |
| int * | current_room_id_ = nullptr |
| DungeonRoomStore * | rooms_ = nullptr |
| DungeonCanvasViewer * | canvas_viewer_ = nullptr |
| int | selected_sprite_id_ = 0 |
| char | search_filter_ [64] = {0} |
| std::function< void(const zelda3::Sprite &) | sprite_placed_callback_ ) |
| std::function< void()> | open_selection_inspector_callback_ |
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) | |
WindowContent for placing and managing dungeon sprites.
Panel layout, filtering, and placement behavior live in the matching .cc file. Room edits continue through DungeonCanvasViewer's interaction handlers.
Definition at line 25 of file sprite_editor_panel.h.
| yaze::editor::SpriteEditorPanel::SpriteEditorPanel | ( | int * | current_room_id, |
| DungeonRoomStore * | rooms, | ||
| DungeonCanvasViewer * | canvas_viewer = nullptr ) |
Definition at line 24 of file sprite_editor_panel.cc.
|
overridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::WindowContent.
Definition at line 31 of file sprite_editor_panel.cc.
|
overridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::WindowContent.
Definition at line 35 of file sprite_editor_panel.cc.
|
overridevirtual |
Material Design icon for this panel.
Implements yaze::editor::WindowContent.
Definition at line 39 of file sprite_editor_panel.cc.
References ICON_MD_PERSON.
|
overridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::WindowContent.
Definition at line 43 of file sprite_editor_panel.cc.
|
overridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::WindowContent.
Definition at line 47 of file sprite_editor_panel.cc.
|
overridevirtual |
Optional workflow group for hack-centric actions.
Reimplemented from yaze::editor::WindowContent.
Definition at line 51 of file sprite_editor_panel.cc.
|
overridevirtual |
Draw the panel content.
| p_open | Pointer to visibility flag (nullptr if not closable) |
Called by WorkspaceWindowManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.
Implements yaze::editor::WindowContent.
Definition at line 55 of file sprite_editor_panel.cc.
References DrawContent().
| void yaze::editor::SpriteEditorPanel::DrawInWorkbench | ( | ) |
Definition at line 59 of file sprite_editor_panel.cc.
References DrawContent().
| void yaze::editor::SpriteEditorPanel::SetCanvasViewer | ( | DungeonCanvasViewer * | viewer | ) |
Definition at line 89 of file sprite_editor_panel.cc.
References canvas_viewer_.
Referenced by yaze::editor::DungeonEditorV2::PrepareForSessionTeardown().
| void yaze::editor::SpriteEditorPanel::SetSpritePlacedCallback | ( | std::function< void(const zelda3::Sprite &)> | callback | ) |
Definition at line 93 of file sprite_editor_panel.cc.
References sprite_placed_callback_.
| void yaze::editor::SpriteEditorPanel::SetOpenSelectionInspectorCallback | ( | std::function< void()> | callback | ) |
Definition at line 98 of file sprite_editor_panel.cc.
References open_selection_inspector_callback_.
|
private |
Definition at line 63 of file sprite_editor_panel.cc.
References canvas_viewer_, yaze::editor::DungeonCanvasViewer::current_room_id(), current_room_id_, yaze::editor::DrawDungeonEntityInspector(), DrawPlacementControls(), DrawRoomSprites(), DrawSpriteSelector(), yaze::editor::DungeonObjectInteraction::entity_coordinator(), yaze::editor::InteractionCoordinator::GetSelectedEntities(), yaze::editor::DungeonCanvasViewer::object_interaction(), rooms_, and yaze::editor::DungeonRoomStore::size().
Referenced by Draw(), and DrawInWorkbench().
|
private |
Definition at line 103 of file sprite_editor_panel.cc.
References yaze::gui::AutoRegisterLastItem(), yaze::editor::DungeonObjectInteraction::CancelPlacement(), canvas_viewer_, yaze::editor::DungeonCanvasViewer::current_room_id(), current_room_id_, yaze::editor::DungeonObjectInteraction::entity_coordinator(), yaze::editor::SpriteInteractionHandler::GetSpriteId(), yaze::editor::DungeonObjectInteraction::IsSpritePlacementActive(), yaze::editor::DungeonCanvasViewer::object_interaction(), selected_sprite_id_, yaze::editor::InteractionCoordinator::sprite_handler(), and SpriteName().
Referenced by DrawContent().
|
private |
Definition at line 126 of file sprite_editor_panel.cc.
References yaze::gui::AutoRegisterLastItem(), canvas_viewer_, yaze::editor::DungeonCanvasViewer::current_room_id(), current_room_id_, yaze::editor::DungeonCanvasViewer::header_read_only(), yaze::editor::DungeonCanvasViewer::IsObjectInteractionEnabled(), MatchesFilter(), yaze::editor::DungeonCanvasViewer::object_interaction(), search_filter_, selected_sprite_id_, yaze::editor::DungeonObjectInteraction::SetSpritePlacementMode(), and SpriteName().
Referenced by DrawContent().
|
private |
Definition at line 168 of file sprite_editor_panel.cc.
References yaze::gui::AutoRegisterLastItem(), canvas_viewer_, current_room_id_, yaze::editor::DungeonObjectInteraction::entity_coordinator(), yaze::editor::InteractionCoordinator::GetSelectedEntities(), yaze::editor::AgentUI::GetTheme(), ICON_MD_INFO, ICON_MD_KEY, ICON_MD_LIST, ICON_MD_OPEN_IN_NEW, ICON_MD_STAR, ICON_MD_VPN_KEY, ICON_MD_WARNING, yaze::editor::DungeonCanvasViewer::object_interaction(), open_selection_inspector_callback_, yaze::editor::DungeonObjectInteraction::SelectEntity(), and SpriteName().
Referenced by DrawContent().
|
private |
Definition at line 261 of file sprite_editor_panel.cc.
References canvas_viewer_, yaze::zelda3::ResourceLabelProvider::GetLabel(), yaze::zelda3::kSprite, yaze::editor::dungeon_project_labels::LabelsForProject(), and yaze::editor::DungeonCanvasViewer::project().
Referenced by DrawPlacementControls(), DrawRoomSprites(), DrawSpriteSelector(), and MatchesFilter().
|
private |
Definition at line 267 of file sprite_editor_panel.cc.
References search_filter_, and SpriteName().
Referenced by DrawSpriteSelector().
|
private |
Definition at line 54 of file sprite_editor_panel.h.
Referenced by DrawContent(), DrawPlacementControls(), DrawRoomSprites(), and DrawSpriteSelector().
|
private |
Definition at line 55 of file sprite_editor_panel.h.
Referenced by DrawContent().
|
private |
Definition at line 56 of file sprite_editor_panel.h.
Referenced by DrawContent(), DrawPlacementControls(), DrawRoomSprites(), DrawSpriteSelector(), SetCanvasViewer(), and SpriteName().
|
private |
Definition at line 59 of file sprite_editor_panel.h.
Referenced by DrawPlacementControls(), and DrawSpriteSelector().
|
private |
Definition at line 60 of file sprite_editor_panel.h.
Referenced by DrawSpriteSelector(), and MatchesFilter().
|
private |
Definition at line 62 of file sprite_editor_panel.h.
Referenced by SetSpritePlacedCallback().
|
private |
Definition at line 63 of file sprite_editor_panel.h.
Referenced by DrawRoomSprites(), and SetOpenSelectionInspectorCallback().