#include <dungeon_workbench_panel.h>


Public Member Functions | |
| DungeonWorkbenchPanel (DungeonRoomSelector *room_selector, int *current_room_id, std::function< void(int)> on_room_selected, std::function< void(int, RoomSelectionIntent)> on_room_selected_with_intent, std::function< void(int)> on_save_room, std::function< DungeonCanvasViewer *()> get_viewer, std::function< DungeonCanvasViewer *()> get_compare_viewer, std::function< const std::deque< int > &()> get_recent_rooms, std::function< void(int)> forget_recent_room, std::function< void(const std::string &)> show_panel, std::function< void(bool)> set_workflow_mode, Rom *rom=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 | SetRom (Rom *rom) |
| void | NotifyRoomChanged (int previous_room_id) |
| Called by the editor when the current room changes. | |
| void | SetUndoRedoProvider (std::function< bool()> can_undo, std::function< bool()> can_redo, std::function< void()> on_undo, std::function< void()> on_redo, std::function< std::string()> undo_desc, std::function< std::string()> redo_desc, std::function< int()> undo_depth) |
| void | SetToolModeProvider (std::function< const char *()> provider) |
| void | Draw (bool *p_open) override |
| Draw the panel content. | |
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 | DrawRecentRoomTabs () |
| void | DrawSplitView (DungeonCanvasViewer &primary_viewer) |
| void | DrawInspector (DungeonCanvasViewer &viewer) |
| void | DrawInspectorShelf (DungeonCanvasViewer &viewer) |
| void | DrawInspectorShelfRoom (DungeonCanvasViewer &viewer) |
| void | DrawInspectorShelfSelection (DungeonCanvasViewer &viewer) |
| void | DrawInspectorShelfView (DungeonCanvasViewer &viewer) |
| void | DrawInspectorShelfTools (DungeonCanvasViewer &viewer) |
| void | BuildRoomDungeonCache () |
Private Attributes | |
| DungeonRoomSelector * | room_selector_ = nullptr |
| int * | current_room_id_ = nullptr |
| int | previous_room_id_ = -1 |
| bool | split_view_enabled_ = false |
| int | compare_room_id_ = -1 |
| DungeonWorkbenchLayoutState | layout_state_ {} |
| std::function< void(int)> | on_room_selected_ |
| std::function< void(int, RoomSelectionIntent)> | on_room_selected_with_intent_ |
| std::function< void(int)> | on_save_room_ |
| std::function< DungeonCanvasViewer *()> | get_viewer_ |
| std::function< DungeonCanvasViewer *()> | get_compare_viewer_ |
| std::function< const std::deque< int > &()> | get_recent_rooms_ |
| std::function< void(int)> | forget_recent_room_ |
| std::function< void(const std::string &) | show_panel_ ) |
| std::function< void(bool)> | set_workflow_mode_ |
| Rom * | rom_ = nullptr |
| char | compare_search_buf_ [64] = {} |
| bool | prev_show_left_ = true |
| bool | prev_show_right_ = true |
| int | table_generation_ = 0 |
| std::unordered_map< int, std::string > | room_dungeon_cache_ |
| bool | room_dungeon_cache_built_ = false |
| std::function< bool()> | can_undo_ |
| std::function< bool()> | can_redo_ |
| std::function< void()> | on_undo_ |
| std::function< void()> | on_redo_ |
| std::function< std::string()> | undo_desc_ |
| std::function< std::string()> | redo_desc_ |
| std::function< int()> | undo_depth_ |
| std::function< const char *()> | get_tool_mode_ |
| bool | show_shortcut_legend_ = false |
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) | |
Definition at line 23 of file dungeon_workbench_panel.h.
| yaze::editor::DungeonWorkbenchPanel::DungeonWorkbenchPanel | ( | DungeonRoomSelector * | room_selector, |
| int * | current_room_id, | ||
| std::function< void(int)> | on_room_selected, | ||
| std::function< void(int, RoomSelectionIntent)> | on_room_selected_with_intent, | ||
| std::function< void(int)> | on_save_room, | ||
| std::function< DungeonCanvasViewer *()> | get_viewer, | ||
| std::function< DungeonCanvasViewer *()> | get_compare_viewer, | ||
| std::function< const std::deque< int > &()> | get_recent_rooms, | ||
| std::function< void(int)> | forget_recent_room, | ||
| std::function< void(const std::string &)> | show_panel, | ||
| std::function< void(bool)> | set_workflow_mode, | ||
| Rom * | rom = nullptr ) |
Definition at line 86 of file dungeon_workbench_panel.cc.
|
overridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::EditorPanel.
Definition at line 110 of file dungeon_workbench_panel.cc.
|
overridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::EditorPanel.
Definition at line 113 of file dungeon_workbench_panel.cc.
|
overridevirtual |
Material Design icon for this panel.
Implements yaze::editor::EditorPanel.
Definition at line 116 of file dungeon_workbench_panel.cc.
References ICON_MD_WORKSPACES.
|
overridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::EditorPanel.
Definition at line 119 of file dungeon_workbench_panel.cc.
|
overridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::EditorPanel.
Definition at line 122 of file dungeon_workbench_panel.cc.
| void yaze::editor::DungeonWorkbenchPanel::SetRom | ( | Rom * | rom | ) |
Definition at line 126 of file dungeon_workbench_panel.cc.
References rom_, room_dungeon_cache_, and room_dungeon_cache_built_.
|
inline |
Called by the editor when the current room changes.
Definition at line 47 of file dungeon_workbench_panel.h.
References previous_room_id_.
Referenced by yaze::editor::DungeonEditorV2::OnRoomSelected().
|
inline |
Definition at line 52 of file dungeon_workbench_panel.h.
References can_redo_, can_undo_, on_redo_, on_undo_, redo_desc_, undo_depth_, and undo_desc_.
Referenced by yaze::editor::DungeonEditorV2::Initialize().
|
inline |
Definition at line 69 of file dungeon_workbench_panel.h.
References get_tool_mode_.
|
overridevirtual |
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 132 of file dungeon_workbench_panel.cc.
References yaze::gui::LayoutHelpers::BeginContentChild(), yaze::editor::DungeonStatusBar::BuildState(), can_redo_, can_undo_, yaze::editor::DungeonWorkbenchToolbarParams::compare_room_id, compare_room_id_, yaze::editor::DungeonWorkbenchToolbarParams::compare_search_buf, compare_search_buf_, yaze::editor::DungeonWorkbenchToolbarParams::compare_search_buf_size, yaze::editor::DungeonWorkbenchToolbarParams::compare_viewer, yaze::editor::DungeonWorkbenchToolbarParams::current_room_id, current_room_id_, yaze::editor::DungeonStatusBar::Draw(), yaze::editor::DungeonWorkbenchToolbar::Draw(), yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas(), DrawInspector(), DrawRecentRoomTabs(), yaze::editor::DungeonRoomSelector::DrawRoomSelector(), DrawSplitView(), yaze::gui::LayoutHelpers::EndContentChild(), get_compare_viewer_, yaze::editor::DungeonWorkbenchToolbarParams::get_recent_rooms, get_recent_rooms_, get_tool_mode_, get_viewer_, yaze::gui::LayoutHelpers::GetMinTouchTarget(), yaze::editor::AgentUI::GetTheme(), yaze::gui::LayoutHelpers::GetTouchSafeWidgetHeight(), ICON_MD_CHEVRON_LEFT, ICON_MD_CHEVRON_RIGHT, ICON_MD_INFO, ICON_MD_LIST, ICON_MD_TUNE, yaze::Rom::is_loaded(), yaze::gui::UIConfig::kContentMinHeightCanvas, yaze::gui::UIConfig::kContentMinWidthSidebar, yaze::editor::DungeonWorkbenchToolbarParams::layout, layout_state_, yaze::editor::DungeonWorkbenchLayoutState::left_width, on_redo_, yaze::editor::DungeonWorkbenchToolbarParams::on_room_selected, on_room_selected_, on_undo_, prev_show_left_, prev_show_right_, yaze::editor::DungeonWorkbenchToolbarParams::previous_room_id, previous_room_id_, yaze::editor::DungeonWorkbenchToolbarParams::primary_viewer, redo_desc_, yaze::editor::DungeonWorkbenchLayoutState::right_width, rom_, room_selector_, yaze::editor::DungeonWorkbenchToolbarParams::set_workflow_mode, set_workflow_mode_, yaze::editor::DungeonWorkbenchLayoutState::show_left_sidebar, yaze::editor::DungeonWorkbenchLayoutState::show_right_inspector, yaze::editor::DungeonWorkbenchToolbarParams::split_view_enabled, split_view_enabled_, table_generation_, undo_depth_, and undo_desc_.
|
private |
Definition at line 371 of file dungeon_workbench_panel.cc.
References yaze::gui::BeginThemedTabBar(), compare_room_id_, current_room_id_, yaze::gui::EndThemedTabBar(), forget_recent_room_, get_recent_rooms_, yaze::zelda3::GetRoomLabel(), ICON_MD_CLOSE, ICON_MD_COMPARE_ARROWS, ICON_MD_OPEN_IN_NEW, yaze::gui::LayoutHelpers::IsTouchDevice(), yaze::editor::kOpenStandalone, on_room_selected_, on_room_selected_with_intent_, and split_view_enabled_.
Referenced by Draw().

|
private |
Definition at line 458 of file dungeon_workbench_panel.cc.
References yaze::gui::LayoutHelpers::BeginContentChild(), yaze::editor::DungeonCanvasViewer::canvas(), compare_room_id_, current_room_id_, yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas(), yaze::gui::LayoutHelpers::EndContentChild(), get_compare_viewer_, get_recent_rooms_, yaze::gui::Canvas::GetConfig(), yaze::gui::UIConfig::kContentMinHeightCanvas, layout_state_, split_view_enabled_, and yaze::editor::DungeonWorkbenchLayoutState::sync_split_view.
Referenced by Draw().
|
private |
Definition at line 579 of file dungeon_workbench_panel.cc.
References DrawInspectorShelf().
Referenced by Draw().

|
private |
Definition at line 583 of file dungeon_workbench_panel.cc.
References yaze::gui::BeginThemedTabBar(), DrawInspectorShelfRoom(), DrawInspectorShelfSelection(), DrawInspectorShelfTools(), DrawInspectorShelfView(), yaze::gui::EndThemedTabBar(), ICON_MD_BUILD, ICON_MD_CASTLE, ICON_MD_SELECT_ALL, and ICON_MD_VISIBILITY.
Referenced by DrawInspector().
|
private |
Definition at line 613 of file dungeon_workbench_panel.cc.
References BuildRoomDungeonCache(), yaze::editor::DungeonCanvasViewer::CanNavigateRooms(), yaze::editor::DungeonCanvasViewer::current_room_id(), current_room_id_, get_recent_rooms_, yaze::zelda3::GetRoomLabel(), yaze::editor::AgentUI::GetTheme(), ICON_MD_CASTLE, ICON_MD_CLOSE, ICON_MD_CONTENT_COPY, ICON_MD_HISTORY, ICON_MD_IMAGE, ICON_MD_ROOM, ICON_MD_SAVE, ICON_MD_SETTINGS, ICON_MD_TRAIN, yaze::gui::InputHexByteEx(), yaze::Rom::is_loaded(), yaze::editor::InteractionModeManager::IsPlacementActive(), yaze::editor::DungeonObjectInteraction::mode_manager(), yaze::editor::DungeonCanvasViewer::NavigateToRoom(), yaze::editor::DungeonCanvasViewer::object_interaction(), on_room_selected_, on_save_room_, yaze::gui::LayoutHelpers::PropertyRow(), rom_, room_dungeon_cache_, room_dungeon_cache_built_, yaze::editor::DungeonCanvasViewer::rooms(), yaze::gui::InputHexResult::ShouldApply(), and show_panel_.
Referenced by DrawInspectorShelf().
|
private |
Definition at line 866 of file dungeon_workbench_panel.cc.
References yaze::editor::DungeonCanvasViewer::current_room_id(), yaze::editor::Door, yaze::zelda3::GetDoorDirectionName(), yaze::zelda3::GetDoorTypeName(), yaze::zelda3::GetObjectName(), yaze::zelda3::GetObjectSubtype(), yaze::zelda3::GetOverlordLabel(), yaze::zelda3::GetSpriteLabel(), yaze::editor::AgentUI::GetTheme(), ICON_MD_CLEAR, ICON_MD_DELETE, ICON_MD_DOOR_FRONT, ICON_MD_INFO, ICON_MD_INVENTORY_2, ICON_MD_PERSON, ICON_MD_STAR, ICON_MD_WIDGETS, yaze::gui::InputHexByteEx(), yaze::gui::InputHexWordEx(), yaze::editor::Item, yaze::editor::DungeonCanvasViewer::object_interaction(), yaze::gui::LayoutHelpers::PropertyRow(), yaze::editor::DungeonCanvasViewer::rooms(), yaze::gui::InputHexResult::ShouldApply(), and yaze::editor::Sprite.
Referenced by DrawInspectorShelf().
|
private |
Definition at line 1077 of file dungeon_workbench_panel.cc.
References yaze::editor::DungeonCanvasViewer::set_show_camera_quadrant_overlay(), yaze::editor::DungeonCanvasViewer::set_show_coordinate_overlay(), yaze::editor::DungeonCanvasViewer::set_show_custom_collision_overlay(), yaze::editor::DungeonCanvasViewer::set_show_custom_objects_overlay(), yaze::editor::DungeonCanvasViewer::set_show_grid(), yaze::editor::DungeonCanvasViewer::set_show_minecart_sprite_overlay(), yaze::editor::DungeonCanvasViewer::set_show_object_bounds(), yaze::editor::DungeonCanvasViewer::set_show_track_collision_overlay(), yaze::editor::DungeonCanvasViewer::set_show_track_gap_overlay(), yaze::editor::DungeonCanvasViewer::set_show_track_route_overlay(), yaze::editor::DungeonCanvasViewer::set_show_water_fill_overlay(), yaze::editor::DungeonCanvasViewer::show_camera_quadrant_overlay(), yaze::editor::DungeonCanvasViewer::show_coordinate_overlay(), yaze::editor::DungeonCanvasViewer::show_custom_collision_overlay(), yaze::editor::DungeonCanvasViewer::show_custom_objects_overlay(), yaze::editor::DungeonCanvasViewer::show_grid(), yaze::editor::DungeonCanvasViewer::show_minecart_sprite_overlay(), yaze::editor::DungeonCanvasViewer::show_object_bounds(), yaze::editor::DungeonCanvasViewer::show_track_collision_overlay(), yaze::editor::DungeonCanvasViewer::show_track_gap_overlay(), yaze::editor::DungeonCanvasViewer::show_track_route_overlay(), and yaze::editor::DungeonCanvasViewer::show_water_fill_overlay().
Referenced by DrawInspectorShelf().
|
private |
Definition at line 1139 of file dungeon_workbench_panel.cc.
References yaze::editor::ShortcutLegendPanel::Draw(), ICON_MD_INVENTORY, ICON_MD_KEYBOARD, ICON_MD_PERSON, ICON_MD_SETTINGS, ICON_MD_WIDGETS, show_panel_, and show_shortcut_legend_.
Referenced by DrawInspectorShelf().

|
private |
Definition at line 530 of file dungeon_workbench_panel.cc.
References yaze::zelda3::RoomEntrance::dungeon_id_, yaze::Rom::is_loaded(), rom_, yaze::zelda3::RoomEntrance::room_, room_dungeon_cache_, and room_dungeon_cache_built_.
Referenced by DrawInspectorShelfRoom().

|
private |
Definition at line 89 of file dungeon_workbench_panel.h.
Referenced by Draw().
|
private |
Definition at line 90 of file dungeon_workbench_panel.h.
Referenced by Draw(), DrawInspectorShelfRoom(), DrawRecentRoomTabs(), and DrawSplitView().
|
private |
Definition at line 93 of file dungeon_workbench_panel.h.
Referenced by Draw(), and NotifyRoomChanged().
|
private |
Definition at line 94 of file dungeon_workbench_panel.h.
Referenced by Draw(), DrawRecentRoomTabs(), and DrawSplitView().
|
private |
Definition at line 95 of file dungeon_workbench_panel.h.
Referenced by Draw(), DrawRecentRoomTabs(), and DrawSplitView().
|
private |
Definition at line 96 of file dungeon_workbench_panel.h.
Referenced by Draw(), and DrawSplitView().
|
private |
Definition at line 97 of file dungeon_workbench_panel.h.
Referenced by Draw(), DrawInspectorShelfRoom(), and DrawRecentRoomTabs().
|
private |
Definition at line 98 of file dungeon_workbench_panel.h.
Referenced by DrawRecentRoomTabs().
|
private |
Definition at line 99 of file dungeon_workbench_panel.h.
Referenced by DrawInspectorShelfRoom().
|
private |
Definition at line 100 of file dungeon_workbench_panel.h.
Referenced by Draw().
|
private |
Definition at line 101 of file dungeon_workbench_panel.h.
Referenced by Draw(), and DrawSplitView().
|
private |
Definition at line 102 of file dungeon_workbench_panel.h.
Referenced by Draw(), DrawInspectorShelfRoom(), DrawRecentRoomTabs(), and DrawSplitView().
|
private |
Definition at line 103 of file dungeon_workbench_panel.h.
Referenced by DrawRecentRoomTabs().
|
private |
Definition at line 104 of file dungeon_workbench_panel.h.
Referenced by DrawInspectorShelfRoom(), and DrawInspectorShelfTools().
|
private |
Definition at line 105 of file dungeon_workbench_panel.h.
Referenced by Draw().
|
private |
Definition at line 106 of file dungeon_workbench_panel.h.
Referenced by BuildRoomDungeonCache(), Draw(), DrawInspectorShelfRoom(), and SetRom().
|
private |
Definition at line 108 of file dungeon_workbench_panel.h.
Referenced by Draw().
|
private |
Definition at line 111 of file dungeon_workbench_panel.h.
Referenced by Draw().
|
private |
Definition at line 112 of file dungeon_workbench_panel.h.
Referenced by Draw().
|
private |
Definition at line 113 of file dungeon_workbench_panel.h.
Referenced by Draw().
|
private |
Definition at line 116 of file dungeon_workbench_panel.h.
Referenced by BuildRoomDungeonCache(), DrawInspectorShelfRoom(), and SetRom().
|
private |
Definition at line 117 of file dungeon_workbench_panel.h.
Referenced by BuildRoomDungeonCache(), DrawInspectorShelfRoom(), and SetRom().
|
private |
Definition at line 120 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetUndoRedoProvider().
|
private |
Definition at line 121 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetUndoRedoProvider().
|
private |
Definition at line 122 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetUndoRedoProvider().
|
private |
Definition at line 123 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetUndoRedoProvider().
|
private |
Definition at line 124 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetUndoRedoProvider().
|
private |
Definition at line 125 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetUndoRedoProvider().
|
private |
Definition at line 126 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetUndoRedoProvider().
|
private |
Definition at line 129 of file dungeon_workbench_panel.h.
Referenced by Draw(), and SetToolModeProvider().
|
private |
Definition at line 132 of file dungeon_workbench_panel.h.
Referenced by DrawInspectorShelfTools().