Handles object selection, placement, and interaction within the dungeon canvas. More...
#include <dungeon_object_interaction.h>
Private Member Functions | |
| std::pair< int, int > | CalculateObjectBounds (const zelda3::RoomObject &object) |
| void | RenderGhostPreviewBitmap () |
Private Attributes | |
| gui::Canvas * | canvas_ |
| zelda3::DungeonEditorSystem * | editor_system_ = nullptr |
| std::array< zelda3::Room, dungeon_coords::kRoomCount > * | rooms_ = nullptr |
| int | current_room_id_ = 0 |
| Rom * | rom_ = nullptr |
| std::unique_ptr< zelda3::ObjectDrawer > | object_drawer_ |
| InteractionContext | interaction_context_ |
| InteractionCoordinator | entity_coordinator_ |
| InteractionModeManager | mode_manager_ |
| zelda3::RoomObject | preview_object_ {0, 0, 0, 0, 0} |
| std::unique_ptr< gfx::BackgroundBuffer > | ghost_preview_buffer_ |
| gfx::PaletteGroup | current_palette_group_ |
| ObjectSelection | selection_ |
| size_t | hovered_object_index_ = static_cast<size_t>(-1) |
| bool | has_hovered_object_ = false |
| std::function< void(const zelda3::RoomObject &) | object_placed_callback_ ) |
| std::vector< zelda3::RoomObject > | clipboard_ |
| bool | has_clipboard_data_ = false |
| SelectedEntity | selected_entity_ |
| bool | is_entity_mode_ = false |
Handles object selection, placement, and interaction within the dungeon canvas.
This component manages mouse interactions for object selection (similar to OverworldEditor), object placement, drag operations, and multi-object selection.
Definition at line 63 of file dungeon_object_interaction.h.
|
inlineexplicit |
Definition at line 65 of file dungeon_object_interaction.h.
References yaze::editor::InteractionContext::canvas, entity_coordinator_, interaction_context_, and yaze::editor::InteractionCoordinator::SetContext().

|
inline |
Set the unified interaction context.
This is the preferred method for configuring the interaction handler. It propagates context to all sub-handlers.
Definition at line 81 of file dungeon_object_interaction.h.
References yaze::editor::InteractionContext::canvas, canvas_, entity_coordinator_, interaction_context_, and yaze::editor::InteractionCoordinator::SetContext().

|
inline |
Get the interaction coordinator for entity handling.
Use this for advanced entity operations (doors, sprites, items).
Definition at line 92 of file dungeon_object_interaction.h.
References entity_coordinator_.
|
inline |
Definition at line 93 of file dungeon_object_interaction.h.
References entity_coordinator_.
|
inline |
Definition at line 98 of file dungeon_object_interaction.h.
References entity_coordinator_, interaction_context_, yaze::editor::InteractionContext::rom, rom_, and yaze::editor::InteractionCoordinator::SetContext().
Referenced by yaze::editor::DungeonCanvasViewer::DungeonCanvasViewer(), yaze::editor::DungeonCanvasViewer::SetContext(), and yaze::editor::DungeonCanvasViewer::SetRom().

| void yaze::editor::DungeonObjectInteraction::HandleCanvasMouseInput | ( | ) |
Definition at line 18 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::BeginRectangleSelection(), CancelPlacement(), canvas_, CanvasToRoomCoordinates(), ClearEntitySelection(), yaze::editor::ObjectSelection::ClearSelection(), current_room_id_, yaze::editor::ModeState::drag_current, yaze::editor::ModeState::drag_start, yaze::editor::DraggingEntity, yaze::editor::DraggingObjects, DrawDragPreview(), yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), yaze::editor::ObjectSelection::GetSelectedIndices(), HandleEntityDrag(), HandleLayerKeyboardShortcuts(), HandleScrollWheelResize(), yaze::editor::ObjectSelection::HasSelection(), interaction_context_, yaze::gui::Canvas::IsMouseHovering(), yaze::editor::InteractionModeManager::IsPlacementActive(), mode_manager_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), yaze::editor::PlaceDoor, PlaceDoorAtPosition(), yaze::editor::PlaceItem, PlaceItemAtPosition(), yaze::editor::PlaceObject, PlaceObjectAtPosition(), yaze::editor::PlaceSprite, PlaceSpriteAtPosition(), yaze::editor::ModeState::rect_start_x, yaze::editor::RectangleSelect, rooms_, yaze::editor::Select, selection_, yaze::editor::InteractionModeManager::SetMode(), TrySelectEntityAtCursor(), TrySelectObjectAtCursor(), and yaze::gui::Canvas::zero_point().
| void yaze::editor::DungeonObjectInteraction::CheckForObjectSelection | ( | ) |
Definition at line 167 of file dungeon_object_interaction.cc.
References DrawObjectSelectRect().

| void yaze::editor::DungeonObjectInteraction::PlaceObjectAtPosition | ( | int | room_x, |
| int | room_y ) |
Definition at line 386 of file dungeon_object_interaction.cc.
References CancelPlacement(), current_room_id_, yaze::zelda3::RoomObject::id_, interaction_context_, yaze::editor::InteractionModeManager::IsObjectPlacementActive(), mode_manager_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), object_placed_callback_, preview_object_, rooms_, and yaze::zelda3::RoomObject::x_.
Referenced by HandleCanvasMouseInput().

| void yaze::editor::DungeonObjectInteraction::DrawObjectSelectRect | ( | ) |
Definition at line 172 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::Add, canvas_, current_room_id_, yaze::editor::ObjectSelection::DrawRectangleSelectionBox(), yaze::editor::ObjectSelection::EndRectangleSelection(), yaze::gui::Canvas::IsMouseHovering(), yaze::editor::ObjectSelection::IsRectangleSelectionActive(), rooms_, selection_, yaze::editor::ObjectSelection::Single, yaze::editor::ObjectSelection::Toggle, yaze::editor::ObjectSelection::UpdateRectangleSelection(), and yaze::gui::Canvas::zero_point().
Referenced by CheckForObjectSelection().
| void yaze::editor::DungeonObjectInteraction::SelectObjectsInRect | ( | ) |
Definition at line 212 of file dungeon_object_interaction.cc.
| void yaze::editor::DungeonObjectInteraction::DrawSelectionHighlights | ( | ) |
Definition at line 218 of file dungeon_object_interaction.cc.
References canvas_, current_room_id_, DrawHoverHighlight(), yaze::editor::ObjectSelection::DrawSelectionHighlights(), yaze::zelda3::ObjectDimensionTable::Get(), GetEntityAtPosition(), GetHoveredObjectIndex(), yaze::zelda3::GetObjectName(), yaze::zelda3::GetObjectSubtype(), ICON_MD_DRAG_INDICATOR, ICON_MD_MOUSE, ICON_MD_TOUCH_APP, yaze::zelda3::RoomObject::id_, is_entity_mode_, yaze::gui::Canvas::IsMouseHovering(), yaze::editor::ObjectSelection::IsObjectSelected(), object_drawer_, rooms_, selection_, yaze::zelda3::RoomObject::size_, and yaze::gui::Canvas::zero_point().
| void yaze::editor::DungeonObjectInteraction::DrawHoverHighlight | ( | const std::vector< zelda3::RoomObject > & | objects | ) |
Definition at line 301 of file dungeon_object_interaction.cc.
References canvas_, yaze::zelda3::ObjectDimensionTable::Get(), GetEntityAtPosition(), GetHoveredObjectIndex(), yaze::editor::ObjectSelection::GetLayerTypeColor(), yaze::editor::AgentUI::GetTheme(), yaze::gui::Canvas::global_scale(), is_entity_mode_, yaze::gui::Canvas::IsMouseHovering(), yaze::editor::ObjectSelection::IsObjectSelected(), object_drawer_, yaze::editor::ObjectSelection::RoomToCanvasCoordinates(), selection_, and yaze::gui::Canvas::zero_point().
Referenced by DrawSelectionHighlights().
| void yaze::editor::DungeonObjectInteraction::DrawSelectBox | ( | ) |
Definition at line 416 of file dungeon_object_interaction.cc.
References canvas_, yaze::editor::ObjectSelection::DrawRectangleSelectionBox(), yaze::editor::ObjectSelection::IsRectangleSelectionActive(), and selection_.

| void yaze::editor::DungeonObjectInteraction::DrawDragPreview | ( | ) |
Definition at line 424 of file dungeon_object_interaction.cc.
References CalculateObjectBounds(), canvas_, current_room_id_, yaze::editor::DraggingObjects, yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), yaze::editor::ObjectSelection::GetSelectedIndices(), yaze::editor::AgentUI::GetTheme(), mode_manager_, rooms_, RoomToCanvasCoordinates(), selection_, and yaze::gui::Canvas::zero_point().
Referenced by HandleCanvasMouseInput().
| void yaze::editor::DungeonObjectInteraction::DrawGhostPreview | ( | ) |
Definition at line 701 of file dungeon_object_interaction.cc.
References canvas_, CanvasToRoomCoordinates(), DrawDoorGhostPreview(), DrawItemGhostPreview(), DrawSpriteGhostPreview(), yaze::editor::InteractionModeManager::GetMode(), yaze::editor::AgentUI::GetTheme(), ghost_preview_buffer_, yaze::gui::Canvas::global_scale(), yaze::zelda3::RoomObject::id_, yaze::gui::Canvas::IsMouseHovering(), mode_manager_, yaze::editor::PlaceDoor, yaze::editor::PlaceItem, yaze::editor::PlaceObject, yaze::editor::PlaceSprite, preview_object_, RoomToCanvasCoordinates(), yaze::zelda3::RoomObject::size_, and yaze::gui::Canvas::zero_point().
| void yaze::editor::DungeonObjectInteraction::UpdateSelectedObjects | ( | ) |
Definition at line 468 of file dungeon_object_interaction.cc.
| bool yaze::editor::DungeonObjectInteraction::IsObjectInSelectBox | ( | const zelda3::RoomObject & | object | ) | const |
Definition at line 473 of file dungeon_object_interaction.cc.
| std::pair< int, int > yaze::editor::DungeonObjectInteraction::RoomToCanvasCoordinates | ( | int | room_x, |
| int | room_y ) const |
Definition at line 480 of file dungeon_object_interaction.cc.
Referenced by DrawDoorGhostPreview(), DrawDragPreview(), and DrawGhostPreview().
| std::pair< int, int > yaze::editor::DungeonObjectInteraction::CanvasToRoomCoordinates | ( | int | canvas_x, |
| int | canvas_y ) const |
Definition at line 486 of file dungeon_object_interaction.cc.
Referenced by DrawGhostPreview(), GetHoveredObjectIndex(), HandleCanvasMouseInput(), and HandlePasteObjects().
| bool yaze::editor::DungeonObjectInteraction::IsWithinCanvasBounds | ( | int | canvas_x, |
| int | canvas_y, | ||
| int | margin = 32 ) const |
Definition at line 492 of file dungeon_object_interaction.cc.
References canvas_, yaze::gui::Canvas::canvas_size(), and yaze::gui::Canvas::global_scale().

| void yaze::editor::DungeonObjectInteraction::SetCurrentRoom | ( | std::array< zelda3::Room, dungeon_coords::kRoomCount > * | rooms, |
| int | room_id ) |
Definition at line 504 of file dungeon_object_interaction.cc.
References yaze::editor::InteractionContext::current_room_id, current_room_id_, entity_coordinator_, interaction_context_, yaze::editor::InteractionContext::rooms, rooms_, and yaze::editor::InteractionCoordinator::SetContext().

| void yaze::editor::DungeonObjectInteraction::SetPreviewObject | ( | const zelda3::RoomObject & | object, |
| bool | loaded ) |
Definition at line 513 of file dungeon_object_interaction.cc.
References yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), ghost_preview_buffer_, mode_manager_, yaze::editor::PlaceObject, yaze::editor::ModeState::preview_object, preview_object_, RenderGhostPreviewBitmap(), yaze::editor::Select, and yaze::editor::InteractionModeManager::SetMode().
Referenced by yaze::editor::DungeonCanvasViewer::ClearPreviewObject(), and yaze::editor::DungeonCanvasViewer::SetPreviewObject().

|
inline |
Definition at line 131 of file dungeon_object_interaction.h.
References yaze::editor::InteractionContext::current_palette_group, current_palette_group_, entity_coordinator_, interaction_context_, and yaze::editor::InteractionCoordinator::SetContext().
Referenced by yaze::editor::DungeonCanvasViewer::SetPreviewObject().

|
inline |
Definition at line 138 of file dungeon_object_interaction.h.
References mode_manager_.
|
inline |
Definition at line 139 of file dungeon_object_interaction.h.
References mode_manager_.
|
inline |
Definition at line 142 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetMode(), mode_manager_, and yaze::editor::PlaceObject.
Referenced by yaze::editor::ObjectEditorPanel::Draw(), and yaze::editor::ObjectEditorPanel::HandleKeyboardShortcuts().

|
inline |
Definition at line 146 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::CancelCurrentMode(), ghost_preview_buffer_, and mode_manager_.
Referenced by yaze::editor::ObjectEditorPanel::CancelPlacement(), HandleCanvasMouseInput(), and PlaceObjectAtPosition().

| void yaze::editor::DungeonObjectInteraction::SetDoorPlacementMode | ( | bool | enabled, |
| zelda3::DoorType | type = zelda3::DoorType::NormalDoor ) |
Definition at line 1259 of file dungeon_object_interaction.cc.
References yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), ghost_preview_buffer_, mode_manager_, yaze::editor::PlaceDoor, yaze::editor::ModeState::preview_door_type, yaze::editor::Select, and yaze::editor::InteractionModeManager::SetMode().
Referenced by yaze::editor::ObjectEditorPanel::DrawDoorSection(), and yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 153 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetMode(), mode_manager_, and yaze::editor::PlaceDoor.
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 156 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetModeState(), mode_manager_, and yaze::editor::ModeState::preview_door_type.

|
inline |
Definition at line 159 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetModeState(), mode_manager_, yaze::zelda3::NormalDoor, and yaze::editor::ModeState::preview_door_type.
Referenced by DrawDoorGhostPreview(), and PlaceDoorAtPosition().

| void yaze::editor::DungeonObjectInteraction::DrawDoorGhostPreview | ( | ) |
Definition at line 1272 of file dungeon_object_interaction.cc.
References canvas_, yaze::editor::ModeState::detected_door_direction, yaze::zelda3::DoorPositionManager::DetectWallFromPosition(), yaze::zelda3::GetDoorDimensions(), yaze::zelda3::GetDoorDirectionName(), yaze::zelda3::GetDoorTypeName(), yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), GetPreviewDoorType(), yaze::editor::AgentUI::GetTheme(), yaze::gui::Canvas::global_scale(), yaze::gui::Canvas::IsMouseHovering(), mode_manager_, yaze::editor::PlaceDoor, yaze::zelda3::DoorPositionManager::PositionToTileCoords(), RoomToCanvasCoordinates(), yaze::zelda3::DoorPositionManager::SnapToNearestPosition(), and yaze::gui::Canvas::zero_point().
Referenced by DrawGhostPreview().
| void yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition | ( | int | canvas_x, |
| int | canvas_y ) |
Definition at line 1353 of file dungeon_object_interaction.cc.
References yaze::zelda3::Room::Door::byte1, yaze::zelda3::Room::Door::byte2, current_room_id_, yaze::zelda3::DoorPositionManager::DetectWallFromPosition(), yaze::zelda3::Room::Door::direction, yaze::zelda3::Room::Door::EncodeBytes(), yaze::editor::InteractionModeManager::GetMode(), GetPreviewDoorType(), interaction_context_, yaze::zelda3::DoorPositionManager::IsValidPosition(), mode_manager_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), yaze::editor::PlaceDoor, yaze::zelda3::Room::Door::position, rooms_, yaze::zelda3::DoorPositionManager::SnapToNearestPosition(), and yaze::zelda3::Room::Door::type.
Referenced by HandleCanvasMouseInput().
|
inline |
Definition at line 165 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::CancelCurrentMode(), yaze::editor::InteractionModeManager::GetMode(), mode_manager_, and yaze::editor::PlaceDoor.

| void yaze::editor::DungeonObjectInteraction::SetSpritePlacementMode | ( | bool | enabled, |
| uint8_t | sprite_id = 0 ) |
Definition at line 1401 of file dungeon_object_interaction.cc.
References yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), ghost_preview_buffer_, mode_manager_, yaze::editor::PlaceSprite, yaze::editor::ModeState::preview_sprite_id, yaze::editor::Select, and yaze::editor::InteractionModeManager::SetMode().
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas(), yaze::editor::SpriteEditorPanel::DrawPlacementControls(), and yaze::editor::SpriteEditorPanel::DrawSpriteSelector().

|
inline |
Definition at line 173 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetMode(), mode_manager_, and yaze::editor::PlaceSprite.
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 176 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetModeState(), mode_manager_, and yaze::editor::ModeState::preview_sprite_id.

|
inline |
Definition at line 179 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetModeState(), mode_manager_, and yaze::editor::ModeState::preview_sprite_id.
Referenced by DrawSpriteGhostPreview(), and PlaceSpriteAtPosition().

| void yaze::editor::DungeonObjectInteraction::DrawSpriteGhostPreview | ( | ) |
Definition at line 1413 of file dungeon_object_interaction.cc.
References canvas_, yaze::gui::Canvas::draw_list(), yaze::editor::InteractionModeManager::GetMode(), GetPreviewSpriteId(), yaze::gui::Canvas::global_scale(), yaze::gui::Canvas::IsMouseHovering(), mode_manager_, yaze::editor::PlaceSprite, and yaze::gui::Canvas::zero_point().
Referenced by DrawGhostPreview().
| void yaze::editor::DungeonObjectInteraction::PlaceSpriteAtPosition | ( | int | canvas_x, |
| int | canvas_y ) |
Definition at line 1450 of file dungeon_object_interaction.cc.
References canvas_, current_room_id_, yaze::editor::InteractionModeManager::GetMode(), GetPreviewSpriteId(), yaze::gui::Canvas::global_scale(), interaction_context_, mode_manager_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), yaze::editor::PlaceSprite, and rooms_.
Referenced by HandleCanvasMouseInput().
|
inline |
Definition at line 184 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::CancelCurrentMode(), yaze::editor::InteractionModeManager::GetMode(), mode_manager_, and yaze::editor::PlaceSprite.

| void yaze::editor::DungeonObjectInteraction::SetItemPlacementMode | ( | bool | enabled, |
| uint8_t | item_id = 0 ) |
Definition at line 1488 of file dungeon_object_interaction.cc.
References yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), ghost_preview_buffer_, mode_manager_, yaze::editor::PlaceItem, yaze::editor::ModeState::preview_item_id, yaze::editor::Select, and yaze::editor::InteractionModeManager::SetMode().
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas(), yaze::editor::ItemEditorPanel::DrawItemSelector(), and yaze::editor::ItemEditorPanel::DrawPlacementControls().

|
inline |
Definition at line 192 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetMode(), mode_manager_, and yaze::editor::PlaceItem.
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 195 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetModeState(), mode_manager_, and yaze::editor::ModeState::preview_item_id.

|
inline |
Definition at line 198 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::GetModeState(), mode_manager_, and yaze::editor::ModeState::preview_item_id.
Referenced by DrawItemGhostPreview(), and PlaceItemAtPosition().

| void yaze::editor::DungeonObjectInteraction::DrawItemGhostPreview | ( | ) |
Definition at line 1500 of file dungeon_object_interaction.cc.
References canvas_, yaze::gui::Canvas::draw_list(), yaze::editor::InteractionModeManager::GetMode(), GetPreviewItemId(), yaze::gui::Canvas::global_scale(), yaze::gui::Canvas::IsMouseHovering(), mode_manager_, yaze::editor::PlaceItem, and yaze::gui::Canvas::zero_point().
Referenced by DrawGhostPreview().
| void yaze::editor::DungeonObjectInteraction::PlaceItemAtPosition | ( | int | canvas_x, |
| int | canvas_y ) |
Definition at line 1537 of file dungeon_object_interaction.cc.
References canvas_, current_room_id_, yaze::editor::InteractionModeManager::GetMode(), GetPreviewItemId(), yaze::gui::Canvas::global_scale(), interaction_context_, yaze::zelda3::PotItem::item, mode_manager_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), yaze::editor::PlaceItem, yaze::zelda3::PotItem::position, and rooms_.
Referenced by HandleCanvasMouseInput().
|
inline |
Definition at line 203 of file dungeon_object_interaction.h.
References yaze::editor::InteractionModeManager::CancelCurrentMode(), yaze::editor::InteractionModeManager::GetMode(), mode_manager_, and yaze::editor::PlaceItem.

|
inline |
Definition at line 210 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::GetSelectedIndices(), and selection_.
Referenced by yaze::editor::ObjectEditorPanel::CopySelectedObjects(), yaze::editor::ObjectEditorPanel::CycleObjectSelection(), yaze::editor::ObjectEditorPanel::DeleteSelectedObjects(), yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas(), yaze::editor::ObjectEditorPanel::DrawSelectedObjectInfo(), yaze::editor::ObjectEditorPanel::DuplicateSelectedObjects(), yaze::editor::ObjectEditorPanel::NudgeSelectedObjects(), and yaze::editor::ObjectEditorPanel::PerformDelete().

|
inline |
Definition at line 213 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::Add, yaze::editor::ObjectSelection::ClearSelection(), selection_, and yaze::editor::ObjectSelection::SelectObject().
Referenced by yaze::editor::ObjectEditorPanel::PasteObjects(), and yaze::editor::ObjectEditorPanel::SelectAllObjects().

|
inline |
Definition at line 219 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::HasSelection(), yaze::editor::ObjectSelection::IsRectangleSelectionActive(), and selection_.

| void yaze::editor::DungeonObjectInteraction::ClearSelection | ( | ) |
Definition at line 582 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::ClearSelection(), yaze::editor::DraggingObjects, yaze::editor::InteractionModeManager::GetMode(), mode_manager_, yaze::editor::Select, selection_, and yaze::editor::InteractionModeManager::SetMode().
Referenced by yaze::editor::ObjectEditorPanel::DeselectAllObjects().

|
inline |
Definition at line 223 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::IsObjectSelected(), and selection_.

|
inline |
Definition at line 226 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::GetSelectionCount(), and selection_.
Referenced by yaze::editor::ObjectEditorPanel::OnSelectionChanged().

|
inline |
Definition at line 229 of file dungeon_object_interaction.h.
References selection_, and yaze::editor::ObjectSelection::SetSelectionChangedCallback().
Referenced by yaze::editor::ObjectEditorPanel::SetupSelectionCallbacks().

| bool yaze::editor::DungeonObjectInteraction::TrySelectObjectAtCursor | ( | ) |
Definition at line 589 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::Add, GetHoveredObjectIndex(), is_entity_mode_, selection_, yaze::editor::ObjectSelection::SelectObject(), yaze::editor::ObjectSelection::Single, and yaze::editor::ObjectSelection::Toggle.
Referenced by HandleCanvasMouseInput().

| void yaze::editor::DungeonObjectInteraction::HandleScrollWheelResize | ( | ) |
Definition at line 849 of file dungeon_object_interaction.cc.
References current_room_id_, GetHoveredObjectIndex(), yaze::editor::ObjectSelection::GetSelectedIndices(), yaze::editor::ObjectSelection::HasSelection(), interaction_context_, yaze::editor::ObjectSelection::IsObjectSelected(), yaze::editor::InteractionModeManager::IsPlacementActive(), mode_manager_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, and selection_.
Referenced by HandleCanvasMouseInput().
| size_t yaze::editor::DungeonObjectInteraction::GetHoveredObjectIndex | ( | ) | const |
Definition at line 943 of file dungeon_object_interaction.cc.
References CalculateObjectBounds(), canvas_, CanvasToRoomCoordinates(), current_room_id_, rooms_, and yaze::gui::Canvas::zero_point().
Referenced by DrawHoverHighlight(), DrawSelectionHighlights(), HandleScrollWheelResize(), and TrySelectObjectAtCursor().

| void yaze::editor::DungeonObjectInteraction::HandleDeleteSelected | ( | ) |
Definition at line 611 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::ClearSelection(), current_room_id_, yaze::editor::ObjectSelection::GetSelectedIndices(), interaction_context_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, and selection_.
Referenced by yaze::editor::DungeonCanvasViewer::DeleteSelectedObjects().

| void yaze::editor::DungeonObjectInteraction::HandleCopySelected | ( | ) |
Definition at line 637 of file dungeon_object_interaction.cc.
References clipboard_, current_room_id_, yaze::editor::ObjectSelection::GetSelectedIndices(), has_clipboard_data_, rooms_, and selection_.

| void yaze::editor::DungeonObjectInteraction::HandlePasteObjects | ( | ) |
Definition at line 658 of file dungeon_object_interaction.cc.
References canvas_, CanvasToRoomCoordinates(), clipboard_, current_room_id_, has_clipboard_data_, interaction_context_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, and yaze::gui::Canvas::zero_point().

|
inline |
Definition at line 243 of file dungeon_object_interaction.h.
References has_clipboard_data_.
| void yaze::editor::DungeonObjectInteraction::SendSelectedToLayer | ( | int | target_layer | ) |
Definition at line 1003 of file dungeon_object_interaction.cc.
References current_room_id_, yaze::editor::ObjectSelection::GetSelectedIndices(), interaction_context_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, and selection_.
Referenced by HandleLayerKeyboardShortcuts().

| void yaze::editor::DungeonObjectInteraction::SendSelectedToFront | ( | ) |
Definition at line 1034 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::Add, yaze::editor::ObjectSelection::ClearSelection(), current_room_id_, yaze::editor::ObjectSelection::GetSelectedIndices(), interaction_context_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, selection_, and yaze::editor::ObjectSelection::SelectObject().
Referenced by HandleLayerKeyboardShortcuts().
| void yaze::editor::DungeonObjectInteraction::SendSelectedToBack | ( | ) |
Definition at line 1075 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::Add, yaze::editor::ObjectSelection::ClearSelection(), current_room_id_, yaze::editor::ObjectSelection::GetSelectedIndices(), interaction_context_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, selection_, and yaze::editor::ObjectSelection::SelectObject().
Referenced by HandleLayerKeyboardShortcuts().
| void yaze::editor::DungeonObjectInteraction::BringSelectedForward | ( | ) |
Definition at line 1115 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::Add, yaze::editor::ObjectSelection::ClearSelection(), current_room_id_, yaze::editor::ObjectSelection::GetSelectedIndices(), interaction_context_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, selection_, and yaze::editor::ObjectSelection::SelectObject().
Referenced by HandleLayerKeyboardShortcuts().
| void yaze::editor::DungeonObjectInteraction::SendSelectedBackward | ( | ) |
Definition at line 1167 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::Add, yaze::editor::ObjectSelection::ClearSelection(), current_room_id_, yaze::editor::ObjectSelection::GetSelectedIndices(), interaction_context_, yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, selection_, and yaze::editor::ObjectSelection::SelectObject().
Referenced by HandleLayerKeyboardShortcuts().
|
inline |
Definition at line 256 of file dungeon_object_interaction.h.
References selection_, and yaze::editor::ObjectSelection::SetLayerFilter().
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 257 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::GetLayerFilter(), and selection_.
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 258 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::IsLayerFilterActive(), and selection_.
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 259 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::IsMaskModeActive(), and selection_.

|
inline |
Definition at line 260 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::GetLayerFilterName(), and selection_.

|
inline |
Definition at line 261 of file dungeon_object_interaction.h.
References selection_, and yaze::editor::ObjectSelection::SetLayersMerged().
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas().

|
inline |
Definition at line 262 of file dungeon_object_interaction.h.
References yaze::editor::ObjectSelection::AreLayersMerged(), and selection_.

| void yaze::editor::DungeonObjectInteraction::HandleLayerKeyboardShortcuts | ( | ) |
Definition at line 1218 of file dungeon_object_interaction.cc.
References BringSelectedForward(), yaze::editor::ObjectSelection::HasSelection(), selection_, SendSelectedBackward(), SendSelectedToBack(), SendSelectedToFront(), and SendSelectedToLayer().
Referenced by HandleCanvasMouseInput().
|
inline |
Definition at line 268 of file dungeon_object_interaction.h.
References object_placed_callback_.
|
inline |
Definition at line 272 of file dungeon_object_interaction.h.
References entity_coordinator_, interaction_context_, yaze::editor::InteractionContext::on_invalidate_cache, and yaze::editor::InteractionCoordinator::SetContext().

|
inline |
Definition at line 276 of file dungeon_object_interaction.h.
References entity_coordinator_, interaction_context_, yaze::editor::InteractionContext::on_mutation, and yaze::editor::InteractionCoordinator::SetContext().
Referenced by SetMutationHook().

|
inline |
Definition at line 282 of file dungeon_object_interaction.h.
References SetMutationCallback().

|
inline |
Definition at line 286 of file dungeon_object_interaction.h.
References editor_system_.
Referenced by yaze::editor::DungeonCanvasViewer::SetEditorSystem().
| void yaze::editor::DungeonObjectInteraction::SelectEntity | ( | EntityType | type, |
| size_t | index ) |
Definition at line 1580 of file dungeon_object_interaction.cc.
References yaze::editor::ObjectSelection::ClearSelection(), yaze::editor::SelectedEntity::index, interaction_context_, is_entity_mode_, yaze::editor::None, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::Object, selected_entity_, selection_, and yaze::editor::SelectedEntity::type.
Referenced by TrySelectEntityAtCursor().

| void yaze::editor::DungeonObjectInteraction::ClearEntitySelection | ( | ) |
Definition at line 1595 of file dungeon_object_interaction.cc.
References yaze::editor::DraggingEntity, yaze::editor::InteractionModeManager::GetMode(), yaze::editor::SelectedEntity::index, is_entity_mode_, mode_manager_, yaze::editor::None, yaze::editor::Select, selected_entity_, yaze::editor::InteractionModeManager::SetMode(), and yaze::editor::SelectedEntity::type.
Referenced by yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas(), HandleCanvasMouseInput(), and TrySelectEntityAtCursor().

|
inline |
Definition at line 293 of file dungeon_object_interaction.h.
References yaze::editor::None, selected_entity_, and yaze::editor::SelectedEntity::type.
|
inline |
Definition at line 294 of file dungeon_object_interaction.h.
References selected_entity_.
| std::optional< SelectedEntity > yaze::editor::DungeonObjectInteraction::GetEntityAtPosition | ( | int | canvas_x, |
| int | canvas_y ) const |
Definition at line 1604 of file dungeon_object_interaction.cc.
References canvas_, current_room_id_, yaze::editor::Door, yaze::zelda3::GetDoorDimensions(), yaze::gui::Canvas::global_scale(), yaze::editor::Item, rooms_, and yaze::editor::Sprite.
Referenced by DrawHoverHighlight(), DrawSelectionHighlights(), and TrySelectEntityAtCursor().

| void yaze::editor::DungeonObjectInteraction::DrawEntitySelectionHighlights | ( | ) |
Definition at line 1795 of file dungeon_object_interaction.cc.
References canvas_, current_room_id_, yaze::zelda3::DoorPositionManager::DetectWallSection(), yaze::editor::Door, yaze::editor::DraggingEntity, DrawDoorSnapIndicators(), yaze::zelda3::GetDoorDimensions(), yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), yaze::editor::AgentUI::GetTheme(), yaze::gui::Canvas::global_scale(), yaze::editor::SelectedEntity::index, yaze::editor::Item, mode_manager_, yaze::editor::None, yaze::zelda3::DoorPositionManager::PositionToTileCoords(), rooms_, selected_entity_, yaze::zelda3::DoorPositionManager::SnapToNearestPosition(), yaze::editor::Sprite, yaze::editor::SelectedEntity::type, and yaze::gui::Canvas::zero_point().
| void yaze::editor::DungeonObjectInteraction::DrawDoorSnapIndicators | ( | ) |
Definition at line 1913 of file dungeon_object_interaction.cc.
References canvas_, yaze::zelda3::DoorPositionManager::DetectWallSection(), yaze::editor::Door, yaze::editor::DraggingEntity, yaze::zelda3::GetDoorDimensions(), yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), yaze::zelda3::DoorPositionManager::GetSectionStartPosition(), yaze::editor::AgentUI::GetTheme(), yaze::gui::Canvas::global_scale(), mode_manager_, yaze::zelda3::DoorPositionManager::PositionToTileCoords(), selected_entity_, yaze::zelda3::DoorPositionManager::SnapToNearestPosition(), yaze::editor::SelectedEntity::type, and yaze::gui::Canvas::zero_point().
Referenced by DrawEntitySelectionHighlights().
| bool yaze::editor::DungeonObjectInteraction::TrySelectEntityAtCursor | ( | ) |
Definition at line 1678 of file dungeon_object_interaction.cc.
References canvas_, ClearEntitySelection(), yaze::editor::ObjectSelection::ClearSelection(), yaze::editor::DraggingEntity, yaze::editor::ModeState::entity_drag_start, GetEntityAtPosition(), yaze::editor::InteractionModeManager::GetModeState(), yaze::gui::Canvas::IsMouseHovering(), mode_manager_, SelectEntity(), selection_, yaze::editor::InteractionModeManager::SetMode(), and yaze::gui::Canvas::zero_point().
Referenced by HandleCanvasMouseInput().
| void yaze::editor::DungeonObjectInteraction::HandleEntityDrag | ( | ) |
Definition at line 1709 of file dungeon_object_interaction.cc.
References canvas_, current_room_id_, yaze::zelda3::DoorPositionManager::DetectWallFromPosition(), yaze::editor::Door, yaze::editor::DraggingEntity, yaze::editor::InteractionModeManager::GetMode(), yaze::editor::InteractionModeManager::GetModeState(), yaze::editor::SelectedEntity::index, interaction_context_, yaze::zelda3::DoorPositionManager::IsValidPosition(), mode_manager_, yaze::editor::None, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), rooms_, yaze::editor::Select, selected_entity_, yaze::editor::InteractionModeManager::SetMode(), yaze::zelda3::DoorPositionManager::SnapToNearestPosition(), yaze::editor::Sprite, yaze::editor::SelectedEntity::type, and yaze::gui::Canvas::zero_point().
Referenced by HandleCanvasMouseInput().
|
inline |
Definition at line 308 of file dungeon_object_interaction.h.
References entity_coordinator_, interaction_context_, yaze::editor::InteractionContext::on_entity_changed, and yaze::editor::InteractionCoordinator::SetContext().

|
private |
Definition at line 909 of file dungeon_object_interaction.cc.
References current_room_id_, yaze::zelda3::ObjectDimensionTable::Get(), object_drawer_, and rom_.
Referenced by DrawDragPreview(), GetHoveredObjectIndex(), and RenderGhostPreviewBitmap().

|
private |
Definition at line 531 of file dungeon_object_interaction.cc.
References CalculateObjectBounds(), yaze::gfx::Arena::CREATE, current_palette_group_, current_room_id_, yaze::zelda3::ObjectDrawer::DrawObject(), yaze::gfx::Arena::Get(), ghost_preview_buffer_, yaze::zelda3::ObjectDrawer::InitializeDrawRoutines(), yaze::Rom::is_loaded(), preview_object_, yaze::gfx::Arena::ProcessTextureQueue(), yaze::gfx::Arena::QueueTextureCommand(), rom_, and rooms_.
Referenced by SetPreviewObject().
|
private |
Definition at line 314 of file dungeon_object_interaction.h.
Referenced by DrawDoorGhostPreview(), DrawDoorSnapIndicators(), DrawDragPreview(), DrawEntitySelectionHighlights(), DrawGhostPreview(), DrawHoverHighlight(), DrawItemGhostPreview(), DrawObjectSelectRect(), DrawSelectBox(), DrawSelectionHighlights(), DrawSpriteGhostPreview(), GetEntityAtPosition(), GetHoveredObjectIndex(), HandleCanvasMouseInput(), HandleEntityDrag(), HandlePasteObjects(), IsWithinCanvasBounds(), PlaceItemAtPosition(), PlaceSpriteAtPosition(), SetContext(), and TrySelectEntityAtCursor().
|
private |
Definition at line 315 of file dungeon_object_interaction.h.
Referenced by SetEditorSystem().
|
private |
Definition at line 316 of file dungeon_object_interaction.h.
Referenced by BringSelectedForward(), DrawDragPreview(), DrawEntitySelectionHighlights(), DrawObjectSelectRect(), DrawSelectionHighlights(), GetEntityAtPosition(), GetHoveredObjectIndex(), HandleCanvasMouseInput(), HandleCopySelected(), HandleDeleteSelected(), HandleEntityDrag(), HandlePasteObjects(), HandleScrollWheelResize(), PlaceDoorAtPosition(), PlaceItemAtPosition(), PlaceObjectAtPosition(), PlaceSpriteAtPosition(), RenderGhostPreviewBitmap(), SendSelectedBackward(), SendSelectedToBack(), SendSelectedToFront(), SendSelectedToLayer(), and SetCurrentRoom().
|
private |
Definition at line 317 of file dungeon_object_interaction.h.
Referenced by BringSelectedForward(), CalculateObjectBounds(), DrawDragPreview(), DrawEntitySelectionHighlights(), DrawObjectSelectRect(), DrawSelectionHighlights(), GetEntityAtPosition(), GetHoveredObjectIndex(), HandleCanvasMouseInput(), HandleCopySelected(), HandleDeleteSelected(), HandleEntityDrag(), HandlePasteObjects(), HandleScrollWheelResize(), PlaceDoorAtPosition(), PlaceItemAtPosition(), PlaceObjectAtPosition(), PlaceSpriteAtPosition(), RenderGhostPreviewBitmap(), SendSelectedBackward(), SendSelectedToBack(), SendSelectedToFront(), SendSelectedToLayer(), and SetCurrentRoom().
|
private |
Definition at line 318 of file dungeon_object_interaction.h.
Referenced by CalculateObjectBounds(), RenderGhostPreviewBitmap(), and SetRom().
|
private |
Definition at line 319 of file dungeon_object_interaction.h.
Referenced by CalculateObjectBounds(), DrawHoverHighlight(), and DrawSelectionHighlights().
|
private |
Definition at line 322 of file dungeon_object_interaction.h.
Referenced by BringSelectedForward(), DungeonObjectInteraction(), HandleCanvasMouseInput(), HandleDeleteSelected(), HandleEntityDrag(), HandlePasteObjects(), HandleScrollWheelResize(), PlaceDoorAtPosition(), PlaceItemAtPosition(), PlaceObjectAtPosition(), PlaceSpriteAtPosition(), SelectEntity(), SendSelectedBackward(), SendSelectedToBack(), SendSelectedToFront(), SendSelectedToLayer(), SetCacheInvalidationCallback(), SetContext(), SetCurrentPaletteGroup(), SetCurrentRoom(), SetEntityChangedCallback(), SetMutationCallback(), and SetRom().
|
private |
Definition at line 323 of file dungeon_object_interaction.h.
Referenced by DungeonObjectInteraction(), entity_coordinator(), entity_coordinator(), SetCacheInvalidationCallback(), SetContext(), SetCurrentPaletteGroup(), SetCurrentRoom(), SetEntityChangedCallback(), SetMutationCallback(), and SetRom().
|
private |
Definition at line 326 of file dungeon_object_interaction.h.
Referenced by CancelDoorPlacement(), CancelItemPlacement(), CancelPlacement(), CancelSpritePlacement(), ClearEntitySelection(), ClearSelection(), DrawDoorGhostPreview(), DrawDoorSnapIndicators(), DrawDragPreview(), DrawEntitySelectionHighlights(), DrawGhostPreview(), DrawItemGhostPreview(), DrawSpriteGhostPreview(), GetPreviewDoorType(), GetPreviewItemId(), GetPreviewSpriteId(), HandleCanvasMouseInput(), HandleEntityDrag(), HandleScrollWheelResize(), IsDoorPlacementActive(), IsItemPlacementActive(), IsObjectLoaded(), IsSpritePlacementActive(), mode_manager(), mode_manager(), PlaceDoorAtPosition(), PlaceItemAtPosition(), PlaceObjectAtPosition(), PlaceSpriteAtPosition(), SetDoorPlacementMode(), SetItemPlacementMode(), SetPreviewDoorType(), SetPreviewItemId(), SetPreviewObject(), SetPreviewSpriteId(), SetSpritePlacementMode(), and TrySelectEntityAtCursor().
|
private |
Definition at line 332 of file dungeon_object_interaction.h.
Referenced by DrawGhostPreview(), PlaceObjectAtPosition(), RenderGhostPreviewBitmap(), and SetPreviewObject().
|
private |
Definition at line 335 of file dungeon_object_interaction.h.
Referenced by CancelPlacement(), DrawGhostPreview(), RenderGhostPreviewBitmap(), SetDoorPlacementMode(), SetItemPlacementMode(), SetPreviewObject(), and SetSpritePlacementMode().
|
private |
Definition at line 336 of file dungeon_object_interaction.h.
Referenced by RenderGhostPreviewBitmap(), and SetCurrentPaletteGroup().
|
private |
Definition at line 340 of file dungeon_object_interaction.h.
Referenced by AreLayersMerged(), BringSelectedForward(), ClearSelection(), DrawDragPreview(), DrawHoverHighlight(), DrawObjectSelectRect(), DrawSelectBox(), DrawSelectionHighlights(), GetLayerFilter(), GetLayerFilterName(), GetSelectedObjectIndices(), GetSelectionCount(), HandleCanvasMouseInput(), HandleCopySelected(), HandleDeleteSelected(), HandleLayerKeyboardShortcuts(), HandleScrollWheelResize(), IsLayerFilterActive(), IsMaskModeActive(), IsObjectSelectActive(), IsObjectSelected(), SelectEntity(), SendSelectedBackward(), SendSelectedToBack(), SendSelectedToFront(), SendSelectedToLayer(), SetLayerFilter(), SetLayersMerged(), SetSelectedObjects(), SetSelectionChangeCallback(), TrySelectEntityAtCursor(), and TrySelectObjectAtCursor().
|
private |
Definition at line 343 of file dungeon_object_interaction.h.
|
private |
Definition at line 344 of file dungeon_object_interaction.h.
|
private |
Definition at line 347 of file dungeon_object_interaction.h.
Referenced by PlaceObjectAtPosition(), and SetObjectPlacedCallback().
|
private |
Definition at line 350 of file dungeon_object_interaction.h.
Referenced by HandleCopySelected(), and HandlePasteObjects().
|
private |
Definition at line 351 of file dungeon_object_interaction.h.
Referenced by HandleCopySelected(), HandlePasteObjects(), and HasClipboardData().
|
private |
Definition at line 354 of file dungeon_object_interaction.h.
Referenced by ClearEntitySelection(), DrawDoorSnapIndicators(), DrawEntitySelectionHighlights(), GetSelectedEntity(), HandleEntityDrag(), HasEntitySelection(), and SelectEntity().
|
private |
Definition at line 355 of file dungeon_object_interaction.h.
Referenced by ClearEntitySelection(), DrawHoverHighlight(), DrawSelectionHighlights(), SelectEntity(), and TrySelectObjectAtCursor().