#include <custom_collision_panel.h>


Public Member Functions | |
| CustomCollisionPanel (DungeonCanvasViewer *viewer, DungeonObjectInteraction *interaction) | |
| std::string | GetId () const override |
| Unique identifier for this panel. | |
| std::string | GetWorkflowGroup () const override |
| Optional workflow group for hack-centric actions. | |
| 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. | |
| void | SetCanvasViewer (DungeonCanvasViewer *viewer) |
| void | SetInteraction (DungeonObjectInteraction *interaction) |
| void | Draw (bool *p_open) override |
| Draw the panel content. | |
| absl::Status | ImportCollisionRooms (const std::vector< zelda3::CustomCollisionRoomEntry > &entries, std::string_view source_label="import") |
| absl::Status | ImportCollisionJson (std::string_view json_content, std::string_view source_label="import") |
| absl::Status | ExportCollisionToFile (const DungeonRoomStore &rooms, const std::string &path) |
| const std::string & | last_io_status () const |
| const std::string & | last_io_error () const |
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 int | GetPriority () const |
| Get display priority for menu ordering. | |
| 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() | |
Static Public Member Functions | |
| static absl::StatusOr< std::vector< zelda3::CustomCollisionRoomEntry > > | CollectRoomEntries (const DungeonRoomStore &rooms) |
| static void | ApplyRoomEntry (const zelda3::CustomCollisionRoomEntry &entry, zelda3::Room *room) |
Private Attributes | |
| DungeonCanvasViewer * | viewer_ = nullptr |
| DungeonObjectInteraction * | interaction_ = nullptr |
| std::string | last_io_status_ |
| std::string | last_io_error_ |
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) | |
Definition at line 19 of file custom_collision_panel.h.
|
inline |
Definition at line 21 of file custom_collision_panel.h.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::WindowContent.
Definition at line 25 of file custom_collision_panel.h.
|
inlineoverridevirtual |
Optional workflow group for hack-centric actions.
Reimplemented from yaze::editor::WindowContent.
Definition at line 26 of file custom_collision_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::WindowContent.
Definition at line 27 of file custom_collision_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::WindowContent.
Definition at line 28 of file custom_collision_panel.h.
References ICON_MD_GRID_ON.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::WindowContent.
Definition at line 29 of file custom_collision_panel.h.
|
inline |
Definition at line 31 of file custom_collision_panel.h.
References viewer_.
Referenced by yaze::editor::DungeonWorkbenchContent::DrawWorkbenchTool(), and yaze::editor::DungeonEditorV2::PrepareForSessionTeardown().
|
inline |
Definition at line 32 of file custom_collision_panel.h.
References interaction_.
Referenced by yaze::editor::DungeonWorkbenchContent::DrawWorkbenchTool(), and yaze::editor::DungeonEditorV2::PrepareForSessionTeardown().
|
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 23 of file custom_collision_panel.cc.
References yaze::gui::AutoRegisterLastItem(), yaze::editor::DungeonObjectInteraction::BeginCustomCollisionMutation(), CollectRoomEntries(), yaze::editor::DungeonCanvasViewer::current_room_id(), yaze::editor::DungeonObjectInteraction::EndCustomCollisionMutation(), ExportCollisionToFile(), yaze::util::FileDialogOptions::filters, yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), yaze::editor::AgentUI::GetTheme(), yaze::zelda3::Zelda3Labels::GetTileTypeNames(), yaze::zelda3::HasCustomCollisionDataRegion(), yaze::zelda3::HasCustomCollisionPointerTable(), yaze::zelda3::HasCustomCollisionWriteSupport(), yaze::editor::DungeonCanvasViewer::HasRooms(), ICON_MD_CHECK_CIRCLE, ICON_MD_DOWNLOAD, ICON_MD_ERROR, ICON_MD_INFO, ICON_MD_UPLOAD, ICON_MD_WARNING, ImportCollisionJson(), interaction_, yaze::Rom::is_loaded(), yaze::zelda3::kCustomCollisionDataSoftEnd, yaze::zelda3::kCustomCollisionRoomPointers, yaze::zelda3::kNumberOfRooms, last_io_error_, last_io_status_, yaze::util::LoadFile(), yaze::editor::DungeonObjectInteraction::mode_manager(), yaze::editor::ModeState::paint_collision_value, yaze::editor::PaintCollision, yaze::editor::DungeonCanvasViewer::rom(), yaze::editor::DungeonCanvasViewer::rooms(), yaze::editor::Select, yaze::editor::DungeonCanvasViewer::set_show_custom_collision_overlay(), yaze::editor::InteractionModeManager::SetMode(), yaze::editor::DungeonCanvasViewer::show_custom_collision_overlay(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::util::FileDialogWrapper::ShowSaveFileDialog(), yaze::Rom::vector(), and viewer_.
Referenced by yaze::editor::DungeonWorkbenchContent::DrawWorkbenchTool().
|
static |
Definition at line 390 of file custom_collision_panel.cc.
References yaze::zelda3::Room::custom_collision(), yaze::zelda3::Room::custom_collision_dirty(), yaze::editor::DungeonRoomStore::GetIfMaterialized(), yaze::zelda3::Room::has_custom_collision(), yaze::zelda3::CustomCollisionMap::has_data, yaze::zelda3::HasCustomCollisionPointerTable(), yaze::zelda3::CustomCollisionMap::HasOverride(), yaze::Rom::is_loaded(), yaze::zelda3::Room::IsLoaded(), yaze::zelda3::LoadCustomCollisionMap(), yaze::editor::DungeonRoomStore::rom(), yaze::zelda3::CustomCollisionRoomEntry::room_id, yaze::editor::DungeonRoomStore::size(), yaze::zelda3::CustomCollisionMap::tiles, yaze::zelda3::CustomCollisionRoomEntry::tiles, and yaze::Rom::vector().
Referenced by Draw(), and ExportCollisionToFile().
|
static |
Definition at line 441 of file custom_collision_panel.cc.
References yaze::zelda3::Room::custom_collision(), yaze::zelda3::Room::MarkCustomCollisionDirty(), yaze::zelda3::CustomCollisionMap::SetOverride(), yaze::zelda3::CustomCollisionMap::tiles, and yaze::zelda3::CustomCollisionRoomEntry::tiles.
Referenced by ImportCollisionRooms().

| absl::Status yaze::editor::CustomCollisionPanel::ImportCollisionRooms | ( | const std::vector< zelda3::CustomCollisionRoomEntry > & | entries, |
| std::string_view | source_label = "import" ) |
Definition at line 297 of file custom_collision_panel.cc.
References yaze::editor::DungeonObjectInteraction::ApplyCustomCollisionImportBatch(), ApplyRoomEntry(), yaze::editor::DungeonObjectInteraction::BeginCustomCollisionMutation(), yaze::editor::DungeonCanvasViewer::current_room_id(), yaze::editor::DungeonObjectInteraction::EndCustomCollisionMutation(), yaze::editor::DungeonObjectInteraction::HasCollisionBatchImportCallback(), interaction_, yaze::Rom::is_loaded(), last_io_error_, last_io_status_, yaze::editor::DungeonCanvasViewer::rom(), yaze::editor::DungeonCanvasViewer::rooms(), yaze::editor::DungeonCanvasViewer::set_show_custom_collision_overlay(), and viewer_.
Referenced by ImportCollisionJson().
| absl::Status yaze::editor::CustomCollisionPanel::ImportCollisionJson | ( | std::string_view | json_content, |
| std::string_view | source_label = "import" ) |
Definition at line 344 of file custom_collision_panel.cc.
References ImportCollisionRooms(), last_io_error_, last_io_status_, and yaze::zelda3::LoadCustomCollisionRoomsFromJsonString().
Referenced by Draw().

| absl::Status yaze::editor::CustomCollisionPanel::ExportCollisionToFile | ( | const DungeonRoomStore & | rooms, |
| const std::string & | path ) |
Definition at line 356 of file custom_collision_panel.cc.
References CollectRoomEntries(), yaze::zelda3::DumpCustomCollisionRoomsToJsonString(), last_io_error_, and last_io_status_.
Referenced by Draw().

|
inline |
Definition at line 51 of file custom_collision_panel.h.
References last_io_status_.
|
inline |
Definition at line 52 of file custom_collision_panel.h.
References last_io_error_.
|
private |
Definition at line 55 of file custom_collision_panel.h.
Referenced by Draw(), ImportCollisionRooms(), and SetCanvasViewer().
|
private |
Definition at line 56 of file custom_collision_panel.h.
Referenced by Draw(), ImportCollisionRooms(), and SetInteraction().
|
private |
Definition at line 58 of file custom_collision_panel.h.
Referenced by Draw(), ExportCollisionToFile(), ImportCollisionJson(), ImportCollisionRooms(), and last_io_status().
|
private |
Definition at line 59 of file custom_collision_panel.h.
Referenced by Draw(), ExportCollisionToFile(), ImportCollisionJson(), ImportCollisionRooms(), and last_io_error().