EditorPanel for placing and managing dungeon pot items. More...
#include <item_editor_panel.h>


Public Member Functions | |
| ItemEditorPanel (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 | SetItemPlacedCallback (std::function< void(const zelda3::PotItem &)> 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 | DrawItemSelector () |
| void | DrawRoomItems () |
| ImVec4 | GetItemTypeColor (int item_id, const AgentUITheme &theme) |
| const char * | GetItemTypeIcon (int item_id) |
Private Attributes | |
| int * | current_room_id_ = nullptr |
| std::array< zelda3::Room, 0x128 > * | rooms_ = nullptr |
| DungeonCanvasViewer * | canvas_viewer_ = nullptr |
| int | selected_item_id_ = 0 |
| bool | placement_mode_ = false |
| std::function< void(const zelda3::PotItem &) | item_placed_callback_ ) |
Static Private Attributes | |
| static constexpr const char * | kPotItemNames [] |
| static constexpr size_t | kPotItemCount = sizeof(kPotItemNames) / sizeof(kPotItemNames[0]) |
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 pot items.
This panel provides item selection and placement functionality for dungeon rooms, similar to ObjectEditorPanel and SpriteEditorPanel.
Definition at line 32 of file item_editor_panel.h.
|
inline |
Definition at line 34 of file item_editor_panel.h.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 45 of file item_editor_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 46 of file item_editor_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 47 of file item_editor_panel.h.
References ICON_MD_INVENTORY.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 48 of file item_editor_panel.h.
|
inlineoverridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 49 of file item_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 item_editor_panel.h.
References current_room_id_, DrawItemSelector(), DrawPlacementControls(), DrawRoomItems(), and rooms_.

|
inline |
Definition at line 78 of file item_editor_panel.h.
References canvas_viewer_.
Referenced by yaze::editor::DungeonEditorV2::~DungeonEditorV2().
|
inline |
Definition at line 82 of file item_editor_panel.h.
References item_placed_callback_.
|
inlineprivate |
Definition at line 121 of file item_editor_panel.h.
References canvas_viewer_, yaze::editor::AgentUI::GetTheme(), ICON_MD_CANCEL, ICON_MD_INFO, ICON_MD_PLACE, kPotItemCount, kPotItemNames, yaze::editor::DungeonCanvasViewer::object_interaction(), placement_mode_, selected_item_id_, and yaze::editor::DungeonObjectInteraction::SetItemPlacementMode().
Referenced by Draw().

|
inlineprivate |
Definition at line 142 of file item_editor_panel.h.
References canvas_viewer_, GetItemTypeColor(), GetItemTypeIcon(), yaze::editor::AgentUI::GetTheme(), ICON_MD_INVENTORY, kPotItemCount, kPotItemNames, yaze::editor::DungeonCanvasViewer::object_interaction(), placement_mode_, selected_item_id_, and yaze::editor::DungeonObjectInteraction::SetItemPlacementMode().
Referenced by Draw().
|
inlineprivate |
Definition at line 228 of file item_editor_panel.h.
References current_room_id_, yaze::editor::AgentUI::GetTheme(), ICON_MD_DELETE, ICON_MD_INFO, ICON_MD_LIST, kPotItemCount, and kPotItemNames.
Referenced by Draw().

|
inlineprivate |
Definition at line 270 of file item_editor_panel.h.
References yaze::editor::AgentUITheme::dungeon_object_chest, yaze::editor::AgentUITheme::dungeon_object_default, yaze::editor::AgentUITheme::dungeon_object_pot, yaze::editor::AgentUITheme::dungeon_object_stairs, yaze::editor::AgentUITheme::dungeon_sprite_layer0, and yaze::editor::AgentUITheme::status_error.
Referenced by DrawItemSelector().
|
inlineprivate |
Definition at line 286 of file item_editor_panel.h.
References ICON_MD_ARROW_UPWARD, ICON_MD_AUTO_AWESOME, ICON_MD_BLOCK, ICON_MD_BROKEN_IMAGE, ICON_MD_BUG_REPORT, ICON_MD_CIRCLE, ICON_MD_EGG, ICON_MD_FAVORITE, ICON_MD_FLUTTER_DASH, ICON_MD_HELP, ICON_MD_KEY, ICON_MD_LANDSCAPE, ICON_MD_MONETIZATION_ON, ICON_MD_PERSON, ICON_MD_STAIRS, ICON_MD_SWAP_HORIZ, ICON_MD_TERRAIN, ICON_MD_TOGGLE_ON, and ICON_MD_WARNING.
Referenced by DrawItemSelector().
|
staticconstexprprivate |
Definition at line 89 of file item_editor_panel.h.
Referenced by DrawItemSelector(), DrawPlacementControls(), and DrawRoomItems().
|
staticconstexprprivate |
Definition at line 119 of file item_editor_panel.h.
Referenced by DrawItemSelector(), DrawPlacementControls(), and DrawRoomItems().
|
private |
Definition at line 328 of file item_editor_panel.h.
Referenced by Draw(), and DrawRoomItems().
|
private |
Definition at line 329 of file item_editor_panel.h.
Referenced by Draw().
|
private |
Definition at line 330 of file item_editor_panel.h.
Referenced by DrawItemSelector(), DrawPlacementControls(), and SetCanvasViewer().
|
private |
Definition at line 333 of file item_editor_panel.h.
Referenced by DrawItemSelector(), and DrawPlacementControls().
|
private |
Definition at line 334 of file item_editor_panel.h.
Referenced by DrawItemSelector(), and DrawPlacementControls().
|
private |
Definition at line 336 of file item_editor_panel.h.
Referenced by SetItemPlacedCallback().