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 | 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 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. | |
Private Member Functions | |
| void | DrawPlacementControls () |
| void | DrawSpriteSelector () |
| void | DrawRoomSprites () |
| 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_category_ = 0 |
| char | search_filter_ [64] = {0} |
| bool | placement_mode_ = false |
| std::function< void(const zelda3::Sprite &) | sprite_placed_callback_ ) |
EditorPanel for placing and managing dungeon sprites.
This panel provides sprite selection and placement functionality for dungeon rooms, similar to ObjectEditorPanel.
Definition at line 31 of file sprite_editor_panel.h.
|
inline |
Definition at line 33 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 44 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 45 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 46 of file sprite_editor_panel.h.
References ICON_MD_PERSON.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 47 of file sprite_editor_panel.h.
|
inlineoverridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 48 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 54 of file sprite_editor_panel.h.
References current_room_id_, DrawPlacementControls(), DrawRoomSprites(), DrawSpriteSelector(), and rooms_.
|
inline |
Definition at line 77 of file sprite_editor_panel.h.
References canvas_viewer_.
Referenced by yaze::editor::DungeonEditorV2::OnRoomSelected(), and yaze::editor::DungeonEditorV2::~DungeonEditorV2().
|
inline |
Definition at line 81 of file sprite_editor_panel.h.
References sprite_placed_callback_.
|
inlineprivate |
Definition at line 87 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 106 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 204 of file sprite_editor_panel.h.
References current_room_id_, yaze::editor::AgentUI::GetTheme(), ICON_MD_DELETE, ICON_MD_INFO, ICON_MD_LIST, and yaze::zelda3::ResolveSpriteName().
Referenced by Draw().
|
inlineprivate |
Definition at line 243 of file sprite_editor_panel.h.
References yaze::zelda3::ResolveSpriteName(), search_filter_, and selected_category_.
Referenced by DrawSpriteSelector().
|
inlineprivate |
Definition at line 274 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 286 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 298 of file sprite_editor_panel.h.
Referenced by DrawSpriteSelector().
|
private |
Definition at line 309 of file sprite_editor_panel.h.
Referenced by Draw(), and DrawRoomSprites().
|
private |
Definition at line 310 of file sprite_editor_panel.h.
Referenced by Draw().
|
private |
Definition at line 311 of file sprite_editor_panel.h.
Referenced by DrawPlacementControls(), DrawSpriteSelector(), and SetCanvasViewer().
|
private |
Definition at line 314 of file sprite_editor_panel.h.
Referenced by DrawPlacementControls(), and DrawSpriteSelector().
|
private |
Definition at line 315 of file sprite_editor_panel.h.
Referenced by DrawSpriteSelector(), and MatchesFilter().
|
private |
Definition at line 316 of file sprite_editor_panel.h.
Referenced by DrawSpriteSelector(), and MatchesFilter().
|
private |
Definition at line 317 of file sprite_editor_panel.h.
Referenced by DrawPlacementControls(), and DrawSpriteSelector().
|
private |
Definition at line 319 of file sprite_editor_panel.h.
Referenced by SetSpritePlacedCallback().