EditorPanel for placing and managing dungeon sprites. More...
#include <sprite_editor_panel.h>
Public Member Functions | |
| SpriteEditorPanel (int *current_room_id, std::array< zelda3::Room, 0x128 > *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. | |
| void | Draw (bool *p_open) override |
| Draw the panel content. | |
| void | SetCanvasViewer (DungeonCanvasViewer *viewer) |
| void | SetSpritePlacedCallback (std::function< void(const zelda3::Sprite &)> callback) |
Public Member Functions inherited from yaze::editor::EditorPanel | |
| virtual | ~EditorPanel ()=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 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 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() | |
Private Member Functions | |
| void | DrawPlacementControls () |
| void | DrawSpriteSelector () |
| void | DrawRoomSprites () |
| void | DrawSpriteProperties () |
| bool | MatchesFilter (int sprite_id) |
| ImVec4 | GetSpriteTypeColor (int sprite_id, const AgentUITheme &theme) |
| const char * | GetSpriteTypeIcon (int sprite_id) |
| const char * | GetSpriteCategoryName (int sprite_id) |
Private Attributes | |
| int * | current_room_id_ = nullptr |
| std::array< zelda3::Room, 0x128 > * | rooms_ = nullptr |
| DungeonCanvasViewer * | canvas_viewer_ = nullptr |
| int | selected_sprite_id_ = 0 |
| int | selected_sprite_list_index_ = -1 |
| int | selected_category_ = 0 |
| char | search_filter_ [64] = {0} |
| bool | placement_mode_ = false |
| std::function< void(const zelda3::Sprite &) | sprite_placed_callback_ ) |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::EditorPanel | |
| 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) | |
EditorPanel for placing and managing dungeon sprites.
This panel provides sprite selection and placement functionality for dungeon rooms, similar to ObjectEditorPanel.
Definition at line 32 of file sprite_editor_panel.h.
|
inline |
Definition at line 34 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 45 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 46 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 47 of file sprite_editor_panel.h.
References ICON_MD_PERSON.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 48 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 49 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Draw the panel content.
| p_open | Pointer 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.
Implements yaze::editor::EditorPanel.
Definition at line 55 of file sprite_editor_panel.h.
References current_room_id_, DrawPlacementControls(), DrawRoomSprites(), DrawSpriteSelector(), and rooms_.
|
inline |
Definition at line 78 of file sprite_editor_panel.h.
References canvas_viewer_.
Referenced by yaze::editor::DungeonEditorV2::~DungeonEditorV2().
|
inline |
Definition at line 82 of file sprite_editor_panel.h.
References sprite_placed_callback_.
|
inlineprivate |
Definition at line 88 of file sprite_editor_panel.h.
References canvas_viewer_, yaze::editor::AgentUI::GetTheme(), ICON_MD_CANCEL, ICON_MD_INFO, ICON_MD_PLACE, yaze::editor::DungeonCanvasViewer::object_interaction(), placement_mode_, yaze::zelda3::ResolveSpriteName(), selected_sprite_id_, and yaze::editor::DungeonObjectInteraction::SetSpritePlacementMode().
Referenced by Draw().
|
inlineprivate |
Definition at line 107 of file sprite_editor_panel.h.
References canvas_viewer_, GetSpriteCategoryName(), GetSpriteTypeColor(), GetSpriteTypeIcon(), yaze::editor::AgentUI::GetTheme(), ICON_MD_PERSON, MatchesFilter(), yaze::editor::DungeonCanvasViewer::object_interaction(), placement_mode_, yaze::zelda3::ResolveSpriteName(), search_filter_, selected_category_, selected_sprite_id_, and yaze::editor::DungeonObjectInteraction::SetSpritePlacementMode().
Referenced by Draw().
|
inlineprivate |
Definition at line 207 of file sprite_editor_panel.h.
References current_room_id_, DrawSpriteProperties(), yaze::editor::AgentUI::GetTheme(), ICON_MD_INFO, ICON_MD_KEY, ICON_MD_LIST, ICON_MD_STAR, ICON_MD_VPN_KEY, ICON_MD_WARNING, yaze::zelda3::ResolveSpriteName(), and selected_sprite_list_index_.
Referenced by Draw().
|
inlineprivate |
Definition at line 278 of file sprite_editor_panel.h.
References current_room_id_, yaze::editor::AgentUI::GetTheme(), ICON_MD_CONTENT_COPY, ICON_MD_DELETE, ICON_MD_EDIT, ICON_MD_INFO, ICON_MD_KEY, ICON_MD_STAR, ICON_MD_VPN_KEY, yaze::zelda3::ResolveSpriteName(), and selected_sprite_list_index_.
Referenced by DrawRoomSprites().
|
inlineprivate |
Definition at line 385 of file sprite_editor_panel.h.
References yaze::zelda3::ResolveSpriteName(), search_filter_, and selected_category_.
Referenced by DrawSpriteSelector().
|
inlineprivate |
Definition at line 416 of file sprite_editor_panel.h.
References yaze::editor::AgentUITheme::dungeon_object_chest, yaze::editor::AgentUITheme::dungeon_sprite_layer0, yaze::editor::AgentUITheme::dungeon_sprite_layer1, and yaze::editor::AgentUITheme::status_error.
Referenced by DrawSpriteSelector().
|
inlineprivate |
Definition at line 428 of file sprite_editor_panel.h.
References ICON_MD_DANGEROUS, ICON_MD_PERSON, ICON_MD_PEST_CONTROL, and ICON_MD_STAR.
Referenced by DrawSpriteSelector().
|
inlineprivate |
Definition at line 440 of file sprite_editor_panel.h.
Referenced by DrawSpriteSelector().
|
private |
Definition at line 451 of file sprite_editor_panel.h.
Referenced by Draw(), DrawRoomSprites(), and DrawSpriteProperties().
|
private |
Definition at line 452 of file sprite_editor_panel.h.
Referenced by Draw().
|
private |
Definition at line 453 of file sprite_editor_panel.h.
Referenced by DrawPlacementControls(), DrawSpriteSelector(), and SetCanvasViewer().
|
private |
Definition at line 456 of file sprite_editor_panel.h.
Referenced by DrawPlacementControls(), and DrawSpriteSelector().
|
private |
Definition at line 457 of file sprite_editor_panel.h.
Referenced by DrawRoomSprites(), and DrawSpriteProperties().
|
private |
Definition at line 458 of file sprite_editor_panel.h.
Referenced by DrawSpriteSelector(), and MatchesFilter().
|
private |
Definition at line 459 of file sprite_editor_panel.h.
Referenced by DrawSpriteSelector(), and MatchesFilter().
|
private |
Definition at line 460 of file sprite_editor_panel.h.
Referenced by DrawPlacementControls(), and DrawSpriteSelector().
|
private |
Definition at line 462 of file sprite_editor_panel.h.
Referenced by SetSpritePlacedCallback().