Coordinates interaction mode switching and dispatches to handlers. More...
#include <interaction_coordinator.h>
Public Types | |
| enum class | Mode { Select , PlaceDoor , PlaceSprite , PlaceItem } |
| Available interaction modes. More... | |
Public Member Functions | |
| InteractionCoordinator () | |
| void | SetContext (InteractionContext *ctx) |
| Set the shared interaction context. | |
| Mode | GetCurrentMode () const |
| Get current interaction mode. | |
| void | SetMode (Mode mode) |
| Set interaction mode. | |
| void | CancelCurrentMode () |
| Cancel current mode and return to select mode. | |
| bool | IsPlacementActive () const |
| Check if any placement mode is active. | |
| DoorInteractionHandler & | door_handler () |
| const DoorInteractionHandler & | door_handler () const |
| SpriteInteractionHandler & | sprite_handler () |
| const SpriteInteractionHandler & | sprite_handler () const |
| ItemInteractionHandler & | item_handler () |
| const ItemInteractionHandler & | item_handler () const |
| TileObjectHandler & | tile_handler () |
| const TileObjectHandler & | tile_handler () const |
| bool | HandleClick (int canvas_x, int canvas_y) |
| Handle click at canvas position. | |
| bool | HandleMouseWheel (float delta) |
| void | SelectEntity (EntityType type, size_t index) |
| void | SetSelectedEntities (std::vector< SelectedEntity > entities) |
| void | ClearEntitySelection () |
| bool | HasEntitySelection () const |
| bool | NudgeSelected (int delta_x, int delta_y) |
| absl::Status | CommitSelectionEdit (const DungeonSelectionEditRequest &request, bool continuous=false) |
| std::vector< SelectedEntity > | SelectedEntitiesForEdit () const |
| int | SelectionMoveStepPixels () const |
| void | FinishSelectionGesture () |
| const absl::Status & | selection_edit_status () const |
| absl::Status | ReportSelectionEditStatus (absl::Status status) |
| void | CancelPlacement () |
| const std::vector< SelectedEntity > & | GetSelectedEntities () const |
| void | SelectEntitiesInRect (const std::tuple< int, int, int, int > &bounds, bool additive, bool toggle) |
| void | BeginSelectionDrag (ImVec2 start_pos) |
| std::optional< SelectedEntity > | GetEntityAtPosition (int canvas_x, int canvas_y) const |
| std::vector< SelectedEntity > | GetEntitiesAtPosition (int canvas_x, int canvas_y) const |
| SelectedEntity | GetSelectedEntity () const |
| void | HandleDrag (ImVec2 current_pos, ImVec2 delta) |
| Handle drag operation. | |
| void | HandleRelease () |
| Handle mouse release. | |
| void | DrawGhostPreviews () |
| Draw ghost previews for active placement mode. | |
| void | DrawSelectionHighlights () |
| Draw selection highlights for all entity types. | |
| void | DrawPostPlacementOverlays () |
| Draw post-placement success toasts for all handlers (unconditional) | |
| bool | TrySelectEntityAtCursor (int canvas_x, int canvas_y) |
| Try to select entity at cursor position. | |
| void | ClearAllEntitySelections () |
| Clear all entity selections. | |
| absl::Status | DeleteSelectedEntity () |
| Delete currently selected entity. | |
| Mode | GetSelectedEntityType () const |
| Get the type of currently selected entity. | |
Private Member Functions | |
| BaseEntityHandler * | GetActiveHandler () |
| Get active handler based on current mode. | |
| bool | ApplySelection (SelectedEntity entity) |
| bool | UpdateEntitySelection (SelectedEntity entity, bool additive, bool toggle) |
| bool | IsSelectionHitSelected (SelectedEntity entity) const |
| bool | HasGroupDragSelection () const |
| void | ResetEntityGroupDragState () |
| void | FinishEntityGroupDrag () |
| void | HandleEntityGroupDrag (ImVec2 current_pos) |
| bool | SameCycleTarget (int canvas_x, int canvas_y, const std::vector< SelectedEntity > &hits) const |
| void | UpdateSelectionCycleHudPreview () |
| std::optional< size_t > | FindSelectedCycleIndex (const std::vector< SelectedEntity > &hits) const |
| void | DrawSelectionCycleHud () |
| void | DrawMultiEntitySelectionHighlights () |
| std::string | DescribeEntity (SelectedEntity entity) const |
| std::string | DescribeCycleHudEntity (SelectedEntity entity) const |
Private Attributes | |
| absl::Status | selection_edit_status_ |
| Mode | current_mode_ = Mode::Select |
| InteractionContext * | ctx_ = nullptr |
| DoorInteractionHandler | door_handler_ |
| SpriteInteractionHandler | sprite_handler_ |
| ItemInteractionHandler | item_handler_ |
| TileObjectHandler | tile_handler_ |
| std::vector< SelectedEntity > | selected_entities_ |
| int | cycle_last_x_ = -1 |
| int | cycle_last_y_ = -1 |
| size_t | cycle_next_index_ = 0 |
| size_t | cycle_active_index_ = 0 |
| ImVec2 | cycle_hud_screen_pos_ {0.0f, 0.0f} |
| double | cycle_hud_start_time_ = -1.0 |
| std::vector< SelectedEntity > | cycle_last_hits_ |
| bool | entity_group_drag_active_ = false |
| ImVec2 | entity_group_drag_start_ {0.0f, 0.0f} |
| ImVec2 | entity_group_drag_current_ {0.0f, 0.0f} |
| int | entity_group_drag_last_dx_ = 0 |
| int | entity_group_drag_last_dy_ = 0 |
Coordinates interaction mode switching and dispatches to handlers.
The coordinator manages the current interaction mode and ensures only one handler is active at a time. It provides a unified interface for the DungeonObjectInteraction facade to delegate to.
Definition at line 26 of file interaction_coordinator.h.
|
strong |
Available interaction modes.
| Enumerator | |
|---|---|
| Select | |
| PlaceDoor | |
| PlaceSprite | |
| PlaceItem | |
Definition at line 31 of file interaction_coordinator.h.
|
inline |
Definition at line 38 of file interaction_coordinator.h.
| void yaze::editor::InteractionCoordinator::SetContext | ( | InteractionContext * | ctx | ) |
Set the shared interaction context.
This propagates the context to all handlers.
Definition at line 102 of file interaction_coordinator.cc.
References ctx_, door_handler_, item_handler_, yaze::editor::BaseEntityHandler::SetContext(), sprite_handler_, and tile_handler_.
Referenced by yaze::editor::DungeonObjectInteraction::DungeonObjectInteraction(), yaze::editor::DungeonObjectInteraction::SetCacheInvalidationCallback(), yaze::editor::DungeonObjectInteraction::SetContext(), yaze::editor::DungeonObjectInteraction::SetCurrentPaletteGroup(), yaze::editor::DungeonObjectInteraction::SetDoorPairNavigationCallback(), yaze::editor::DungeonObjectInteraction::SetEntityChangedCallback(), yaze::editor::DungeonObjectInteraction::SetMutationCallback(), yaze::editor::DungeonObjectInteraction::SetObjectSelectionVisibilityPredicate(), and yaze::editor::DungeonObjectInteraction::SetRom().

|
inline |
Get current interaction mode.
Definition at line 50 of file interaction_coordinator.h.
References current_mode_.
| void yaze::editor::InteractionCoordinator::SetMode | ( | Mode | mode | ) |
Set interaction mode.
Cancels any active placement in the previous mode.
Definition at line 110 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::BeginPlacement(), yaze::editor::ItemInteractionHandler::BeginPlacement(), yaze::editor::SpriteInteractionHandler::BeginPlacement(), CancelCurrentMode(), current_mode_, door_handler_, item_handler_, PlaceDoor, PlaceItem, PlaceSprite, Select, and sprite_handler_.

| void yaze::editor::InteractionCoordinator::CancelCurrentMode | ( | ) |
Cancel current mode and return to select mode.
Definition at line 133 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::CancelPlacement(), yaze::editor::ItemInteractionHandler::CancelPlacement(), yaze::editor::SpriteInteractionHandler::CancelPlacement(), yaze::editor::TileObjectHandler::CancelPlacement(), current_mode_, door_handler_, item_handler_, Select, sprite_handler_, and tile_handler_.
Referenced by SetMode().

| bool yaze::editor::InteractionCoordinator::IsPlacementActive | ( | ) | const |
Check if any placement mode is active.
Definition at line 143 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::DoorInteractionHandler::IsPlacementActive(), yaze::editor::ItemInteractionHandler::IsPlacementActive(), yaze::editor::SpriteInteractionHandler::IsPlacementActive(), yaze::editor::TileObjectHandler::IsPlacementActive(), item_handler_, sprite_handler_, and tile_handler_.
Referenced by yaze::editor::DungeonObjectInteraction::HandleCanvasMouseInput(), yaze::editor::DungeonObjectInteraction::HandleLeftClick(), and yaze::editor::DungeonCanvasViewer::HandleRoomCanvasNavigation().

|
inline |
Definition at line 73 of file interaction_coordinator.h.
References door_handler_.
Referenced by yaze::editor::DungeonEditorV2::ConfigureViewerUndoHooks(), yaze::editor::DoorEditorContent::DrawContent(), and yaze::editor::anonymous_namespace{dungeon_entity_inspector.cc}::DrawDoor().
|
inline |
Definition at line 74 of file interaction_coordinator.h.
References door_handler_.
|
inline |
Definition at line 76 of file interaction_coordinator.h.
References sprite_handler_.
Referenced by yaze::editor::DungeonEditorV2::ConfigureViewerUndoHooks(), yaze::editor::SpriteEditorPanel::DrawPlacementControls(), yaze::editor::anonymous_namespace{dungeon_entity_inspector.cc}::DrawSprite(), and yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets().
|
inline |
Definition at line 77 of file interaction_coordinator.h.
References sprite_handler_.
|
inline |
Definition at line 81 of file interaction_coordinator.h.
References item_handler_.
Referenced by yaze::editor::DungeonEditorV2::ConfigureViewerUndoHooks(), yaze::editor::anonymous_namespace{dungeon_entity_inspector.cc}::DrawItem(), yaze::editor::ItemEditorPanel::DrawPlacementControls(), and yaze::editor::ItemEditorPanel::DrawRoomItems().
|
inline |
Definition at line 82 of file interaction_coordinator.h.
References item_handler_.
|
inline |
Definition at line 84 of file interaction_coordinator.h.
References tile_handler_.
Referenced by yaze::editor::DungeonCanvasViewer::ApplyDoorConnection(), yaze::editor::DungeonCanvasViewer::ApplyRoomTransfer(), yaze::editor::DungeonEditorV2::ConfigureViewerUndoHooks(), yaze::editor::ObjectSelectorContent::DrawContent(), yaze::editor::DrawDungeonEntityInspector(), yaze::editor::DungeonWorkbenchContent::DrawSelectedObjectActions(), yaze::editor::DungeonObjectInteraction::DungeonObjectInteraction(), yaze::editor::DungeonCanvasViewer::GetObjectUnderContextCursor(), yaze::editor::DungeonObjectInteraction::GetPlacementPolicy(), yaze::editor::DungeonObjectInteraction::GetPlacementPreview(), yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets(), yaze::editor::DungeonCanvasViewer::HandleTouchLongPressContextMenu(), yaze::editor::DoorEditorContent::HasMatchingViewer(), yaze::editor::ItemEditorPanel::HasMatchingViewer(), yaze::editor::DungeonCanvasViewer::PreviewDoorConnection(), yaze::editor::DungeonCanvasViewer::PreviewRoomTransfer(), yaze::editor::DungeonEditorV2::RefreshRoomMetadataViews(), yaze::editor::DungeonObjectInteraction::SetCurrentPaletteGroup(), yaze::editor::DungeonObjectInteraction::SetPlacementPolicy(), yaze::editor::DungeonObjectInteraction::SetPlacementPreviewLayer(), and yaze::editor::DungeonObjectInteraction::SetPlacementPreviewSize().
|
inline |
Definition at line 85 of file interaction_coordinator.h.
References tile_handler_.
| bool yaze::editor::InteractionCoordinator::HandleClick | ( | int | canvas_x, |
| int | canvas_y ) |
Handle click at canvas position.
Dispatches to appropriate handler based on current mode.
Definition at line 149 of file interaction_coordinator.cc.
References ApplySelection(), ClearAllEntitySelections(), yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), yaze::editor::ObjectSelection::ClearSelection(), ctx_, cycle_active_index_, cycle_hud_screen_pos_, cycle_hud_start_time_, cycle_last_hits_, cycle_last_x_, cycle_last_y_, cycle_next_index_, door_handler_, GetEntitiesAtPosition(), yaze::editor::ObjectSelection::GetSelectionCount(), yaze::editor::DoorInteractionHandler::HandleClick(), yaze::editor::ItemInteractionHandler::HandleClick(), yaze::editor::SpriteInteractionHandler::HandleClick(), yaze::editor::TileObjectHandler::HandleClick(), yaze::editor::DoorInteractionHandler::HandleOverlayClick(), HasEntitySelection(), HasGroupDragSelection(), yaze::editor::ObjectSelection::HasSelection(), yaze::editor::DoorInteractionHandler::IsPlacementActive(), yaze::editor::ItemInteractionHandler::IsPlacementActive(), yaze::editor::SpriteInteractionHandler::IsPlacementActive(), yaze::editor::TileObjectHandler::IsPlacementActive(), IsSelectionHitSelected(), yaze::editor::dungeon_coords::IsWithinBounds(), item_handler_, yaze::editor::InteractionContext::NotifyEntityChanged(), SameCycleTarget(), selected_entities_, yaze::editor::InteractionContext::selection, sprite_handler_, tile_handler_, and UpdateEntitySelection().
Referenced by yaze::editor::DungeonObjectInteraction::HandleLeftClick().
| bool yaze::editor::InteractionCoordinator::HandleMouseWheel | ( | float | delta | ) |
Definition at line 342 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::BaseEntityHandler::HandleMouseWheel(), yaze::editor::TileObjectHandler::HandleMouseWheel(), yaze::editor::DoorInteractionHandler::IsPlacementActive(), yaze::editor::ItemInteractionHandler::IsPlacementActive(), yaze::editor::SpriteInteractionHandler::IsPlacementActive(), yaze::editor::TileObjectHandler::IsPlacementActive(), item_handler_, sprite_handler_, and tile_handler_.
| void yaze::editor::InteractionCoordinator::SelectEntity | ( | EntityType | type, |
| size_t | index ) |
Definition at line 269 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), yaze::editor::ObjectSelection::ClearSelection(), ctx_, door_handler_, item_handler_, yaze::editor::DoorInteractionHandler::SelectDoor(), selected_entities_, yaze::editor::InteractionContext::selection, yaze::editor::ItemInteractionHandler::SelectItem(), yaze::editor::SpriteInteractionHandler::SelectSprite(), and sprite_handler_.
| void yaze::editor::InteractionCoordinator::SetSelectedEntities | ( | std::vector< SelectedEntity > | entities | ) |
Definition at line 299 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), ctx_, door_handler_, yaze::editor::SelectedEntity::index, item_handler_, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::DoorInteractionHandler::SelectDoor(), selected_entities_, yaze::editor::ItemInteractionHandler::SelectItem(), yaze::editor::SpriteInteractionHandler::SelectSprite(), sprite_handler_, and yaze::editor::SelectedEntity::type.
Referenced by CommitSelectionEdit().
| void yaze::editor::InteractionCoordinator::ClearEntitySelection | ( | ) |
Definition at line 355 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), ctx_, HasEntitySelection(), and yaze::editor::InteractionContext::NotifyEntityChanged().
Referenced by yaze::editor::DungeonObjectInteraction::SetSelectedObjects().

| bool yaze::editor::InteractionCoordinator::HasEntitySelection | ( | ) | const |
Definition at line 537 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::DoorInteractionHandler::HasSelection(), yaze::editor::ItemInteractionHandler::HasSelection(), yaze::editor::SpriteInteractionHandler::HasSelection(), item_handler_, selected_entities_, and sprite_handler_.
Referenced by ClearEntitySelection(), yaze::editor::DungeonObjectInteraction::HandleCanvasMouseInput(), HandleClick(), and yaze::editor::DungeonObjectInteraction::HasEntitySelection().

| bool yaze::editor::InteractionCoordinator::NudgeSelected | ( | int | delta_x, |
| int | delta_y ) |
Definition at line 633 of file interaction_coordinator.cc.
References CommitSelectionEdit(), ctx_, yaze::editor::DungeonSelectionEditRequest::delta_x_pixels, yaze::editor::DungeonSelectionEditRequest::delta_y_pixels, yaze::editor::DungeonSelectionEditRequest::entities, yaze::editor::InteractionContext::GetCurrentRoomConst(), yaze::editor::ObjectSelection::GetSelectedIndices(), yaze::zelda3::DoorPositionManager::IsValidPosition(), yaze::editor::DungeonSelectionEditRequest::kind, yaze::zelda3::DoorPositionManager::kMaxDoorPositions, yaze::editor::kMove, yaze::zelda3::North, yaze::editor::DungeonSelectionEditRequest::objects, ReportSelectionEditStatus(), SelectedEntitiesForEdit(), yaze::editor::InteractionContext::selection, SelectionMoveStepPixels(), and yaze::zelda3::South.
| absl::Status yaze::editor::InteractionCoordinator::CommitSelectionEdit | ( | const DungeonSelectionEditRequest & | request, |
| bool | continuous = false ) |
Definition at line 573 of file interaction_coordinator.cc.
References yaze::editor::ObjectSelection::Add, yaze::editor::ApplyDungeonSelectionEditState(), yaze::editor::ObjectSelection::ClearSelection(), ctx_, FinishSelectionGesture(), yaze::editor::InteractionContext::GetCurrentRoom(), yaze::editor::kDoors, yaze::editor::kItems, yaze::editor::kSelectionDoors, yaze::editor::kSelectionItems, yaze::editor::kSelectionObjects, yaze::editor::kSelectionSprites, yaze::editor::kSprites, yaze::editor::kTileObjects, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), yaze::editor::InteractionContext::on_selection_edit, yaze::editor::PlanDungeonSelectionEdit(), ReportSelectionEditStatus(), yaze::editor::InteractionContext::selection, yaze::editor::ObjectSelection::SelectObject(), and SetSelectedEntities().
Referenced by DeleteSelectedEntity(), HandleEntityGroupDrag(), and NudgeSelected().
| std::vector< SelectedEntity > yaze::editor::InteractionCoordinator::SelectedEntitiesForEdit | ( | ) | const |
Definition at line 542 of file interaction_coordinator.cc.
References GetSelectedEntity(), and selected_entities_.
Referenced by DeleteSelectedEntity(), HandleEntityGroupDrag(), NudgeSelected(), and SelectionMoveStepPixels().

| int yaze::editor::InteractionCoordinator::SelectionMoveStepPixels | ( | ) | const |
Definition at line 553 of file interaction_coordinator.cc.
References yaze::editor::dungeon_coords::kSpriteTileSize, yaze::editor::dungeon_coords::kTileSize, and SelectedEntitiesForEdit().
Referenced by HandleEntityGroupDrag(), and NudgeSelected().

| void yaze::editor::InteractionCoordinator::FinishSelectionGesture | ( | ) |
Definition at line 461 of file interaction_coordinator.cc.
References FinishEntityGroupDrag().
Referenced by CommitSelectionEdit(), and yaze::editor::DungeonObjectInteraction::FinishSelectionGesture().

|
inline |
Definition at line 110 of file interaction_coordinator.h.
References selection_edit_status_.
Referenced by yaze::editor::DungeonObjectInteraction::selection_edit_status().
| absl::Status yaze::editor::InteractionCoordinator::ReportSelectionEditStatus | ( | absl::Status | status | ) |
Definition at line 563 of file interaction_coordinator.cc.
References ctx_, yaze::editor::InteractionContext::on_selection_edit_error, and selection_edit_status_.
Referenced by CommitSelectionEdit(), and NudgeSelected().
| void yaze::editor::InteractionCoordinator::CancelPlacement | ( | ) |
Definition at line 363 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::CancelPlacement(), yaze::editor::ItemInteractionHandler::CancelPlacement(), yaze::editor::SpriteInteractionHandler::CancelPlacement(), yaze::editor::TileObjectHandler::CancelPlacement(), door_handler_, item_handler_, sprite_handler_, and tile_handler_.

|
inline |
Definition at line 115 of file interaction_coordinator.h.
References selected_entities_.
Referenced by yaze::editor::BuildDungeonSelectionSnapshot(), yaze::editor::DungeonCanvasViewer::DrawChangePingOverlay(), yaze::editor::SpriteEditorPanel::DrawContent(), yaze::editor::SpriteEditorPanel::DrawRoomSprites(), yaze::editor::DungeonCanvasViewer::RenderPotItems(), and yaze::editor::DungeonCanvasViewer::RenderSprites().
| void yaze::editor::InteractionCoordinator::SelectEntitiesInRect | ( | const std::tuple< int, int, int, int > & | bounds, |
| bool | additive, | ||
| bool | toggle ) |
Definition at line 897 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), ctx_, door_handler_, yaze::editor::InteractionContext::GetCurrentRoomConst(), item_handler_, yaze::editor::InteractionContext::NotifyEntityChanged(), selected_entities_, sprite_handler_, and UpdateEntitySelection().
| void yaze::editor::InteractionCoordinator::BeginSelectionDrag | ( | ImVec2 | start_pos | ) |
Definition at line 853 of file interaction_coordinator.cc.
References entity_group_drag_active_, entity_group_drag_current_, entity_group_drag_last_dx_, entity_group_drag_last_dy_, entity_group_drag_start_, HasGroupDragSelection(), ResetEntityGroupDragState(), and yaze::editor::snapping::SnapToTileGrid().

| std::optional< SelectedEntity > yaze::editor::InteractionCoordinator::GetEntityAtPosition | ( | int | canvas_x, |
| int | canvas_y ) const |
Definition at line 370 of file interaction_coordinator.cc.
References GetEntitiesAtPosition().

| std::vector< SelectedEntity > yaze::editor::InteractionCoordinator::GetEntitiesAtPosition | ( | int | canvas_x, |
| int | canvas_y ) const |
Definition at line 379 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::DoorInteractionHandler::GetEntityAtPosition(), yaze::editor::ItemInteractionHandler::GetEntityAtPosition(), yaze::editor::SpriteInteractionHandler::GetEntityAtPosition(), yaze::editor::TileObjectHandler::GetEntityAtPosition(), yaze::editor::dungeon_coords::IsWithinBounds(), item_handler_, sprite_handler_, and tile_handler_.
Referenced by GetEntityAtPosition(), HandleClick(), and UpdateSelectionCycleHudPreview().
| SelectedEntity yaze::editor::InteractionCoordinator::GetSelectedEntity | ( | ) | const |
Definition at line 400 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::DoorInteractionHandler::GetSelectedIndex(), yaze::editor::ItemInteractionHandler::GetSelectedIndex(), yaze::editor::SpriteInteractionHandler::GetSelectedIndex(), item_handler_, selected_entities_, and sprite_handler_.
Referenced by FindSelectedCycleIndex(), yaze::editor::DungeonObjectInteraction::GetSelectedEntity(), IsSelectionHitSelected(), and SelectedEntitiesForEdit().

| void yaze::editor::InteractionCoordinator::HandleDrag | ( | ImVec2 | current_pos, |
| ImVec2 | delta ) |
Handle drag operation.
Definition at line 416 of file interaction_coordinator.cc.
References ctx_, door_handler_, entity_group_drag_active_, yaze::editor::DoorInteractionHandler::HandleDrag(), yaze::editor::ItemInteractionHandler::HandleDrag(), yaze::editor::SpriteInteractionHandler::HandleDrag(), yaze::editor::TileObjectHandler::HandleDrag(), HandleEntityGroupDrag(), yaze::editor::DoorInteractionHandler::HasSelection(), yaze::editor::ItemInteractionHandler::HasSelection(), yaze::editor::SpriteInteractionHandler::HasSelection(), yaze::editor::ObjectSelection::HasSelection(), yaze::editor::TileObjectHandler::IsPlacementActive(), item_handler_, yaze::editor::InteractionContext::selection, sprite_handler_, and tile_handler_.
Referenced by yaze::editor::DungeonObjectInteraction::HandleCanvasMouseInput().
| void yaze::editor::InteractionCoordinator::HandleRelease | ( | ) |
Handle mouse release.
Definition at line 438 of file interaction_coordinator.cc.
References door_handler_, FinishEntityGroupDrag(), yaze::editor::DoorInteractionHandler::HandleRelease(), yaze::editor::ItemInteractionHandler::HandleRelease(), yaze::editor::SpriteInteractionHandler::HandleRelease(), yaze::editor::TileObjectHandler::HandleRelease(), item_handler_, sprite_handler_, and tile_handler_.
| void yaze::editor::InteractionCoordinator::DrawGhostPreviews | ( | ) |
Draw ghost previews for active placement mode.
Definition at line 465 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::DoorInteractionHandler::DrawGhostPreview(), yaze::editor::ItemInteractionHandler::DrawGhostPreview(), yaze::editor::SpriteInteractionHandler::DrawGhostPreview(), yaze::editor::TileObjectHandler::DrawGhostPreview(), yaze::editor::DoorInteractionHandler::IsPlacementActive(), yaze::editor::ItemInteractionHandler::IsPlacementActive(), yaze::editor::SpriteInteractionHandler::IsPlacementActive(), yaze::editor::TileObjectHandler::IsPlacementActive(), item_handler_, sprite_handler_, and tile_handler_.
| void yaze::editor::InteractionCoordinator::DrawSelectionHighlights | ( | ) |
Draw selection highlights for all entity types.
Definition at line 481 of file interaction_coordinator.cc.
References door_handler_, DrawMultiEntitySelectionHighlights(), DrawSelectionCycleHud(), yaze::editor::DoorInteractionHandler::DrawSelectionHighlight(), yaze::editor::ItemInteractionHandler::DrawSelectionHighlight(), yaze::editor::SpriteInteractionHandler::DrawSelectionHighlight(), yaze::editor::DoorInteractionHandler::DrawSnapIndicators(), yaze::editor::DoorInteractionHandler::HasSelection(), yaze::editor::DoorInteractionHandler::IsPlacementActive(), item_handler_, selected_entities_, and sprite_handler_.
| void yaze::editor::InteractionCoordinator::DrawPostPlacementOverlays | ( | ) |
Draw post-placement success toasts for all handlers (unconditional)
Called every frame so toasts remain visible even after the user exits placement mode immediately after a successful placement.
Definition at line 499 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::BaseEntityHandler::DrawPostPlacementToast(), item_handler_, sprite_handler_, and tile_handler_.

| bool yaze::editor::InteractionCoordinator::TrySelectEntityAtCursor | ( | int | canvas_x, |
| int | canvas_y ) |
Try to select entity at cursor position.
Checks all entity types (doors, sprites, items) and selects if found.
Definition at line 508 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), door_handler_, yaze::editor::DoorInteractionHandler::GetSelectedIndex(), yaze::editor::ItemInteractionHandler::GetSelectedIndex(), yaze::editor::SpriteInteractionHandler::GetSelectedIndex(), yaze::editor::DoorInteractionHandler::HandleClick(), yaze::editor::ItemInteractionHandler::HandleClick(), yaze::editor::SpriteInteractionHandler::HandleClick(), item_handler_, selected_entities_, and sprite_handler_.
| void yaze::editor::InteractionCoordinator::ClearAllEntitySelections | ( | ) |
Clear all entity selections.
Definition at line 686 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), door_handler_, entity_group_drag_active_, FinishEntityGroupDrag(), item_handler_, ResetEntityGroupDragState(), selected_entities_, and sprite_handler_.
Referenced by ApplySelection(), ClearEntitySelection(), yaze::editor::DungeonCanvasViewer::DrawDungeonCanvas(), yaze::editor::DungeonCanvasViewer::DrawMinecartCanvas(), HandleClick(), yaze::editor::DungeonCanvasViewer::RefreshRomBackedState(), SelectEntity(), and TrySelectEntityAtCursor().
| absl::Status yaze::editor::InteractionCoordinator::DeleteSelectedEntity | ( | ) |
Delete currently selected entity.
Definition at line 699 of file interaction_coordinator.cc.
References CommitSelectionEdit(), yaze::editor::DungeonSelectionEditRequest::entities, yaze::editor::kDelete, yaze::editor::DungeonSelectionEditRequest::kind, and SelectedEntitiesForEdit().

| InteractionCoordinator::Mode yaze::editor::InteractionCoordinator::GetSelectedEntityType | ( | ) | const |
Get the type of currently selected entity.
Definition at line 706 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::DoorInteractionHandler::HasSelection(), yaze::editor::ItemInteractionHandler::HasSelection(), yaze::editor::SpriteInteractionHandler::HasSelection(), item_handler_, PlaceDoor, PlaceItem, PlaceSprite, Select, selected_entities_, and sprite_handler_.

|
private |
Get active handler based on current mode.
Definition at line 734 of file interaction_coordinator.cc.
References current_mode_, door_handler_, item_handler_, PlaceDoor, PlaceItem, PlaceSprite, Select, and sprite_handler_.
|
private |
Definition at line 748 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), yaze::editor::ObjectSelection::ClearSelection(), ctx_, door_handler_, yaze::editor::SelectedEntity::index, item_handler_, yaze::editor::DoorInteractionHandler::SelectDoor(), selected_entities_, yaze::editor::InteractionContext::selection, yaze::editor::ItemInteractionHandler::SelectItem(), yaze::editor::ObjectSelection::SelectObject(), yaze::editor::SpriteInteractionHandler::SelectSprite(), yaze::editor::ObjectSelection::Single, sprite_handler_, and yaze::editor::SelectedEntity::type.
Referenced by HandleClick().
|
private |
Definition at line 785 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), ctx_, door_handler_, item_handler_, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::DoorInteractionHandler::SelectDoor(), selected_entities_, yaze::editor::ItemInteractionHandler::SelectItem(), yaze::editor::SpriteInteractionHandler::SelectSprite(), sprite_handler_, and yaze::editor::SelectedEntity::type.
Referenced by HandleClick(), and SelectEntitiesInRect().
|
private |
Definition at line 835 of file interaction_coordinator.cc.
References ctx_, GetSelectedEntity(), yaze::editor::SelectedEntity::index, yaze::editor::ObjectSelection::IsObjectSelected(), selected_entities_, yaze::editor::InteractionContext::selection, and yaze::editor::SelectedEntity::type.
Referenced by HandleClick().

|
private |
Definition at line 846 of file interaction_coordinator.cc.
References ctx_, yaze::editor::ObjectSelection::HasSelection(), selected_entities_, and yaze::editor::InteractionContext::selection.
Referenced by BeginSelectionDrag(), and HandleClick().

|
private |
Definition at line 446 of file interaction_coordinator.cc.
References entity_group_drag_active_, entity_group_drag_last_dx_, and entity_group_drag_last_dy_.
Referenced by BeginSelectionDrag(), ClearAllEntitySelections(), and FinishEntityGroupDrag().
|
private |
Definition at line 452 of file interaction_coordinator.cc.
References ctx_, entity_group_drag_active_, yaze::editor::InteractionContext::on_selection_edit_finished, and ResetEntityGroupDragState().
Referenced by ClearAllEntitySelections(), FinishSelectionGesture(), and HandleRelease().

|
private |
Definition at line 866 of file interaction_coordinator.cc.
References CommitSelectionEdit(), ctx_, yaze::editor::DungeonSelectionEditRequest::delta_x_pixels, yaze::editor::DungeonSelectionEditRequest::delta_y_pixels, yaze::editor::DungeonSelectionEditRequest::entities, entity_group_drag_active_, entity_group_drag_current_, entity_group_drag_last_dx_, entity_group_drag_last_dy_, entity_group_drag_start_, yaze::editor::ObjectSelection::GetSelectedIndices(), yaze::editor::DungeonSelectionEditRequest::kind, yaze::editor::kMove, yaze::editor::DungeonSelectionEditRequest::objects, SelectedEntitiesForEdit(), yaze::editor::InteractionContext::selection, SelectionMoveStepPixels(), and yaze::editor::snapping::SnapToTileGrid().
Referenced by HandleDrag().
|
private |
Definition at line 970 of file interaction_coordinator.cc.
References cycle_last_hits_, cycle_last_x_, and cycle_last_y_.
Referenced by HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 1013 of file interaction_coordinator.cc.
References yaze::editor::InteractionContext::canvas, ctx_, cycle_active_index_, cycle_hud_screen_pos_, cycle_hud_start_time_, cycle_last_hits_, cycle_last_x_, cycle_last_y_, cycle_next_index_, FindSelectedCycleIndex(), GetEntitiesAtPosition(), yaze::gui::Canvas::global_scale(), yaze::gui::Canvas::IsMouseHovering(), SameCycleTarget(), yaze::editor::DungeonCanvasTransform::ScreenToRoomPixelCoordinates(), yaze::gui::Canvas::scrolling(), and yaze::gui::Canvas::zero_point().
Referenced by DrawSelectionCycleHud().
|
private |
Definition at line 987 of file interaction_coordinator.cc.
References ctx_, GetSelectedEntity(), yaze::editor::SelectedEntity::index, yaze::editor::ObjectSelection::IsObjectSelected(), selected_entities_, yaze::editor::InteractionContext::selection, and yaze::editor::SelectedEntity::type.
Referenced by UpdateSelectionCycleHudPreview().

|
private |
Definition at line 1052 of file interaction_coordinator.cc.
References cycle_active_index_, cycle_hud_screen_pos_, cycle_hud_start_time_, cycle_last_hits_, DescribeCycleHudEntity(), yaze::editor::AgentUI::GetTheme(), and UpdateSelectionCycleHudPreview().
Referenced by DrawSelectionHighlights().

|
private |
Definition at line 1114 of file interaction_coordinator.cc.
References yaze::editor::InteractionContext::canvas, ctx_, DescribeEntity(), yaze::editor::InteractionContext::GetCurrentRoomConst(), yaze::editor::AgentUI::GetTheme(), yaze::gui::Canvas::global_scale(), yaze::editor::DungeonCanvasTransform::RoomPixelsToScreen(), yaze::editor::DungeonCanvasTransform::RoomSizeToScreen(), yaze::editor::DungeonCanvasTransform::scale(), yaze::gui::Canvas::scrolling(), selected_entities_, and yaze::gui::Canvas::zero_point().
Referenced by DrawSelectionHighlights().
|
private |
Definition at line 1163 of file interaction_coordinator.cc.
References ctx_, yaze::editor::InteractionContext::GetCurrentRoomConst(), yaze::zelda3::GetDoorDirectionName(), yaze::zelda3::Room::GetDoors(), yaze::zelda3::GetObjectName(), yaze::zelda3::Room::GetPotItems(), yaze::zelda3::Room::GetSprites(), yaze::zelda3::Room::GetTileObjects(), yaze::editor::SelectedEntity::index, yaze::zelda3::ResolveSpriteName(), and yaze::editor::SelectedEntity::type.
Referenced by DescribeCycleHudEntity(), and DrawMultiEntitySelectionHighlights().
|
private |
Definition at line 1202 of file interaction_coordinator.cc.
References DescribeEntity().
Referenced by DrawSelectionCycleHud().

|
private |
Definition at line 188 of file interaction_coordinator.h.
Referenced by ReportSelectionEditStatus(), and selection_edit_status().
|
private |
Definition at line 189 of file interaction_coordinator.h.
Referenced by CancelCurrentMode(), GetActiveHandler(), GetCurrentMode(), and SetMode().
|
private |
Definition at line 190 of file interaction_coordinator.h.
Referenced by ApplySelection(), ClearEntitySelection(), CommitSelectionEdit(), DescribeEntity(), DrawMultiEntitySelectionHighlights(), FindSelectedCycleIndex(), FinishEntityGroupDrag(), HandleClick(), HandleDrag(), HandleEntityGroupDrag(), HasGroupDragSelection(), IsSelectionHitSelected(), NudgeSelected(), ReportSelectionEditStatus(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetSelectedEntities(), UpdateEntitySelection(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 192 of file interaction_coordinator.h.
Referenced by ApplySelection(), CancelCurrentMode(), CancelPlacement(), ClearAllEntitySelections(), door_handler(), door_handler(), DrawGhostPreviews(), DrawPostPlacementOverlays(), DrawSelectionHighlights(), GetActiveHandler(), GetEntitiesAtPosition(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HandleDrag(), HandleMouseWheel(), HandleRelease(), HasEntitySelection(), IsPlacementActive(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetMode(), SetSelectedEntities(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 193 of file interaction_coordinator.h.
Referenced by ApplySelection(), CancelCurrentMode(), CancelPlacement(), ClearAllEntitySelections(), DrawGhostPreviews(), DrawPostPlacementOverlays(), DrawSelectionHighlights(), GetActiveHandler(), GetEntitiesAtPosition(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HandleDrag(), HandleMouseWheel(), HandleRelease(), HasEntitySelection(), IsPlacementActive(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetMode(), SetSelectedEntities(), sprite_handler(), sprite_handler(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 194 of file interaction_coordinator.h.
Referenced by ApplySelection(), CancelCurrentMode(), CancelPlacement(), ClearAllEntitySelections(), DrawGhostPreviews(), DrawPostPlacementOverlays(), DrawSelectionHighlights(), GetActiveHandler(), GetEntitiesAtPosition(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HandleDrag(), HandleMouseWheel(), HandleRelease(), HasEntitySelection(), IsPlacementActive(), item_handler(), item_handler(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetMode(), SetSelectedEntities(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 195 of file interaction_coordinator.h.
Referenced by CancelCurrentMode(), CancelPlacement(), DrawGhostPreviews(), DrawPostPlacementOverlays(), GetEntitiesAtPosition(), HandleClick(), HandleDrag(), HandleMouseWheel(), HandleRelease(), IsPlacementActive(), SetContext(), tile_handler(), and tile_handler().
|
private |
Definition at line 196 of file interaction_coordinator.h.
Referenced by ApplySelection(), ClearAllEntitySelections(), DrawMultiEntitySelectionHighlights(), DrawSelectionHighlights(), FindSelectedCycleIndex(), GetSelectedEntities(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HasEntitySelection(), HasGroupDragSelection(), IsSelectionHitSelected(), SelectedEntitiesForEdit(), SelectEntitiesInRect(), SelectEntity(), SetSelectedEntities(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 197 of file interaction_coordinator.h.
Referenced by HandleClick(), SameCycleTarget(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 198 of file interaction_coordinator.h.
Referenced by HandleClick(), SameCycleTarget(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 199 of file interaction_coordinator.h.
Referenced by HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 200 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 201 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 202 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 203 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), SameCycleTarget(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 204 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), ClearAllEntitySelections(), FinishEntityGroupDrag(), HandleDrag(), HandleEntityGroupDrag(), and ResetEntityGroupDragState().
|
private |
Definition at line 205 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), and HandleEntityGroupDrag().
|
private |
Definition at line 206 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), and HandleEntityGroupDrag().
|
private |
Definition at line 207 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), HandleEntityGroupDrag(), and ResetEntityGroupDragState().
|
private |
Definition at line 208 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), HandleEntityGroupDrag(), and ResetEntityGroupDragState().