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) |
| 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. | |
| void | 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 |
| bool | NudgeSelectedEntities (int delta_x, int delta_y, bool defer_drag_notifications) |
| 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 |
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 24 of file interaction_coordinator.h.
|
strong |
Available interaction modes.
| Enumerator | |
|---|---|
| Select | |
| PlaceDoor | |
| PlaceSprite | |
| PlaceItem | |
Definition at line 29 of file interaction_coordinator.h.
|
inline |
Definition at line 36 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 100 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(), and yaze::editor::DungeonObjectInteraction::SetRom().

|
inline |
Get current interaction mode.
Definition at line 48 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 108 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 131 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 141 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(), and yaze::editor::DungeonObjectInteraction::HandleLeftClick().

|
inline |
Definition at line 71 of file interaction_coordinator.h.
References door_handler_.
Referenced by yaze::editor::ObjectEditorContent::DeleteAllSelectedTypeInRoom(), and yaze::editor::ObjectEditorContent::DrawSelectedDoorInfo().
|
inline |
Definition at line 72 of file interaction_coordinator.h.
References door_handler_.
|
inline |
Definition at line 74 of file interaction_coordinator.h.
References sprite_handler_.
Referenced by yaze::editor::ObjectEditorContent::DuplicateSelectedSprite(), yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets(), and yaze::editor::anonymous_namespace{object_editor_content.cc}::MutateSelectedSprite().
|
inline |
Definition at line 75 of file interaction_coordinator.h.
References sprite_handler_.
|
inline |
Definition at line 79 of file interaction_coordinator.h.
References item_handler_.
Referenced by yaze::editor::anonymous_namespace{object_editor_content.cc}::MutateSelectedItem().
|
inline |
Definition at line 80 of file interaction_coordinator.h.
References item_handler_.
|
inline |
Definition at line 82 of file interaction_coordinator.h.
References tile_handler_.
Referenced by yaze::editor::ObjectSelectorContent::Draw(), yaze::editor::DungeonCanvasViewer::GetObjectUnderContextCursor(), yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets(), and yaze::editor::DungeonObjectInteraction::HasClipboardData().
|
inline |
Definition at line 83 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 147 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_, yaze::editor::Door, 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(), yaze::editor::Item, item_handler_, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::Object, SameCycleTarget(), selected_entities_, yaze::editor::InteractionContext::selection, yaze::editor::Sprite, sprite_handler_, tile_handler_, and UpdateEntitySelection().
Referenced by yaze::editor::DungeonObjectInteraction::HandleLeftClick().
| bool yaze::editor::InteractionCoordinator::HandleMouseWheel | ( | float | delta | ) |
Definition at line 340 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_.
Referenced by yaze::editor::DungeonObjectInteraction::HandleCanvasMouseInput().
| void yaze::editor::InteractionCoordinator::SelectEntity | ( | EntityType | type, |
| size_t | index ) |
Definition at line 267 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), yaze::editor::ObjectSelection::ClearSelection(), ctx_, yaze::editor::Door, door_handler_, yaze::editor::Item, item_handler_, yaze::editor::None, yaze::editor::Object, yaze::editor::DoorInteractionHandler::SelectDoor(), selected_entities_, yaze::editor::InteractionContext::selection, yaze::editor::ItemInteractionHandler::SelectItem(), yaze::editor::SpriteInteractionHandler::SelectSprite(), yaze::editor::Sprite, and sprite_handler_.
| void yaze::editor::InteractionCoordinator::SetSelectedEntities | ( | std::vector< SelectedEntity > | entities | ) |
Definition at line 297 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), ctx_, yaze::editor::Door, door_handler_, yaze::editor::SelectedEntity::index, yaze::editor::Item, item_handler_, yaze::editor::None, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::Object, yaze::editor::DoorInteractionHandler::SelectDoor(), selected_entities_, yaze::editor::ItemInteractionHandler::SelectItem(), yaze::editor::SpriteInteractionHandler::SelectSprite(), yaze::editor::Sprite, sprite_handler_, and yaze::editor::SelectedEntity::type.
| void yaze::editor::InteractionCoordinator::ClearEntitySelection | ( | ) |
Definition at line 353 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 552 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 717 of file interaction_coordinator.cc.
References door_handler_, yaze::editor::DoorInteractionHandler::HasSelection(), yaze::editor::ItemInteractionHandler::HasSelection(), yaze::editor::SpriteInteractionHandler::HasSelection(), item_handler_, yaze::editor::ItemInteractionHandler::NudgeSelected(), yaze::editor::DoorInteractionHandler::NudgeSelected(), yaze::editor::SpriteInteractionHandler::NudgeSelected(), NudgeSelectedEntities(), selected_entities_, and sprite_handler_.
| void yaze::editor::InteractionCoordinator::CancelPlacement | ( | ) |
Definition at line 361 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 104 of file interaction_coordinator.h.
References selected_entities_.
Referenced by yaze::editor::BuildDungeonSelectionSnapshot(), and yaze::editor::DungeonCanvasViewer::DrawChangePingOverlay().
| void yaze::editor::InteractionCoordinator::SelectEntitiesInRect | ( | const std::tuple< int, int, int, int > & | bounds, |
| bool | additive, | ||
| bool | toggle ) |
Definition at line 1030 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), ctx_, yaze::editor::Door, door_handler_, yaze::editor::InteractionContext::GetCurrentRoomConst(), yaze::editor::Item, item_handler_, yaze::editor::InteractionContext::NotifyEntityChanged(), selected_entities_, yaze::editor::Sprite, sprite_handler_, and UpdateEntitySelection().
| void yaze::editor::InteractionCoordinator::BeginSelectionDrag | ( | ImVec2 | start_pos | ) |
Definition at line 985 of file interaction_coordinator.cc.
References entity_group_drag_active_, entity_group_drag_current_, entity_group_drag_doors_changed_, entity_group_drag_doors_mutation_started_, entity_group_drag_items_changed_, entity_group_drag_items_mutation_started_, entity_group_drag_last_dx_, entity_group_drag_last_dy_, entity_group_drag_sprites_changed_, entity_group_drag_sprites_mutation_started_, 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 368 of file interaction_coordinator.cc.
References GetEntitiesAtPosition().

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

| void yaze::editor::InteractionCoordinator::HandleDrag | ( | ImVec2 | current_pos, |
| ImVec2 | delta ) |
Handle drag operation.
Definition at line 414 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 435 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 480 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 496 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 514 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 523 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), yaze::editor::Door, 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(), yaze::editor::Item, item_handler_, selected_entities_, yaze::editor::Sprite, and sprite_handler_.
| void yaze::editor::InteractionCoordinator::ClearAllEntitySelections | ( | ) |
Clear all entity selections.
Definition at line 738 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(), DeleteSelectedEntity(), HandleClick(), yaze::editor::DungeonCanvasViewer::RefreshRomBackedState(), SelectEntity(), and TrySelectEntityAtCursor().
| void yaze::editor::InteractionCoordinator::DeleteSelectedEntity | ( | ) |
Delete currently selected entity.
Definition at line 751 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), ctx_, yaze::editor::DoorInteractionHandler::DeleteSelected(), yaze::editor::ItemInteractionHandler::DeleteSelected(), yaze::editor::SpriteInteractionHandler::DeleteSelected(), yaze::editor::Door, door_handler_, yaze::editor::InteractionContext::GetCurrentRoom(), yaze::editor::DoorInteractionHandler::HasSelection(), yaze::editor::ItemInteractionHandler::HasSelection(), yaze::editor::SpriteInteractionHandler::HasSelection(), yaze::editor::Item, item_handler_, yaze::editor::kDoors, yaze::editor::kItems, yaze::editor::kSprites, yaze::editor::None, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), yaze::editor::Object, selected_entities_, yaze::editor::Sprite, and sprite_handler_.
Referenced by yaze::editor::ObjectEditorContent::DeleteSelectedEntity(), and yaze::editor::DungeonCanvasViewer::HandleTouchLongPressContextMenu().
| InteractionCoordinator::Mode yaze::editor::InteractionCoordinator::GetSelectedEntityType | ( | ) | const |
Get the type of currently selected entity.
Definition at line 838 of file interaction_coordinator.cc.
References yaze::editor::Door, door_handler_, yaze::editor::DoorInteractionHandler::HasSelection(), yaze::editor::ItemInteractionHandler::HasSelection(), yaze::editor::SpriteInteractionHandler::HasSelection(), yaze::editor::Item, item_handler_, yaze::editor::None, yaze::editor::Object, PlaceDoor, PlaceItem, PlaceSprite, Select, selected_entities_, yaze::editor::Sprite, and sprite_handler_.

|
private |
Get active handler based on current mode.
Definition at line 866 of file interaction_coordinator.cc.
References current_mode_, door_handler_, item_handler_, PlaceDoor, PlaceItem, PlaceSprite, Select, and sprite_handler_.
|
private |
Definition at line 880 of file interaction_coordinator.cc.
References ClearAllEntitySelections(), yaze::editor::ObjectSelection::ClearSelection(), ctx_, yaze::editor::Door, door_handler_, yaze::editor::SelectedEntity::index, yaze::editor::Item, item_handler_, yaze::editor::None, yaze::editor::Object, 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, yaze::editor::Sprite, sprite_handler_, and yaze::editor::SelectedEntity::type.
Referenced by HandleClick().
|
private |
Definition at line 917 of file interaction_coordinator.cc.
References yaze::editor::DoorInteractionHandler::ClearSelection(), yaze::editor::ItemInteractionHandler::ClearSelection(), yaze::editor::SpriteInteractionHandler::ClearSelection(), ctx_, yaze::editor::Door, door_handler_, yaze::editor::Item, item_handler_, yaze::editor::None, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::Object, yaze::editor::DoorInteractionHandler::SelectDoor(), selected_entities_, yaze::editor::ItemInteractionHandler::SelectItem(), yaze::editor::SpriteInteractionHandler::SelectSprite(), yaze::editor::Sprite, sprite_handler_, and yaze::editor::SelectedEntity::type.
Referenced by HandleClick(), and SelectEntitiesInRect().
|
private |
Definition at line 967 of file interaction_coordinator.cc.
References ctx_, GetSelectedEntity(), yaze::editor::SelectedEntity::index, yaze::editor::ObjectSelection::IsObjectSelected(), yaze::editor::Object, selected_entities_, yaze::editor::InteractionContext::selection, and yaze::editor::SelectedEntity::type.
Referenced by HandleClick().

|
private |
Definition at line 978 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 557 of file interaction_coordinator.cc.
References ctx_, yaze::editor::Door, yaze::zelda3::East, entity_group_drag_doors_changed_, entity_group_drag_doors_mutation_started_, entity_group_drag_items_changed_, entity_group_drag_items_mutation_started_, entity_group_drag_sprites_changed_, entity_group_drag_sprites_mutation_started_, yaze::editor::InteractionContext::GetCurrentRoom(), yaze::zelda3::DoorPositionManager::IsValidPosition(), yaze::editor::Item, yaze::editor::kDoors, yaze::editor::kItems, yaze::zelda3::DoorPositionManager::kMaxDoorPositions, yaze::editor::dungeon_coords::kSpriteGridMax, yaze::editor::kSprites, yaze::editor::None, yaze::zelda3::North, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::InteractionContext::NotifyInvalidateCache(), yaze::editor::InteractionContext::NotifyMutation(), yaze::editor::Object, selected_entities_, yaze::zelda3::South, yaze::editor::Sprite, and yaze::zelda3::West.
Referenced by HandleEntityGroupDrag(), and NudgeSelected().
|
private |
Definition at line 443 of file interaction_coordinator.cc.
References entity_group_drag_active_, entity_group_drag_doors_changed_, entity_group_drag_doors_mutation_started_, entity_group_drag_items_changed_, entity_group_drag_items_mutation_started_, entity_group_drag_last_dx_, entity_group_drag_last_dy_, entity_group_drag_sprites_changed_, and entity_group_drag_sprites_mutation_started_.
Referenced by BeginSelectionDrag(), ClearAllEntitySelections(), and FinishEntityGroupDrag().
|
private |
Definition at line 455 of file interaction_coordinator.cc.
References ctx_, entity_group_drag_active_, entity_group_drag_doors_changed_, entity_group_drag_items_changed_, entity_group_drag_sprites_changed_, yaze::editor::kDoors, yaze::editor::kItems, yaze::editor::kSprites, yaze::editor::InteractionContext::NotifyEntityChanged(), yaze::editor::InteractionContext::NotifyInvalidateCache(), and ResetEntityGroupDragState().
Referenced by ClearAllEntitySelections(), and HandleRelease().

|
private |
Definition at line 1004 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_, yaze::editor::dungeon_coords::kSpriteTileSize, NudgeSelectedEntities(), and yaze::editor::snapping::SnapToTileGrid().
Referenced by HandleDrag().

|
private |
Definition at line 1103 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 1146 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 1120 of file interaction_coordinator.cc.
References ctx_, GetSelectedEntity(), yaze::editor::SelectedEntity::index, yaze::editor::ObjectSelection::IsObjectSelected(), yaze::editor::Object, selected_entities_, yaze::editor::InteractionContext::selection, and yaze::editor::SelectedEntity::type.
Referenced by UpdateSelectionCycleHudPreview().

|
private |
Definition at line 1185 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 1248 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 1297 of file interaction_coordinator.cc.
References ctx_, yaze::editor::Door, 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::editor::Item, yaze::editor::None, yaze::editor::Object, yaze::zelda3::ResolveSpriteName(), yaze::editor::Sprite, and yaze::editor::SelectedEntity::type.
Referenced by DescribeCycleHudEntity(), and DrawMultiEntitySelectionHighlights().
|
private |
Definition at line 1336 of file interaction_coordinator.cc.
References DescribeEntity().
Referenced by DrawSelectionCycleHud().

|
private |
Definition at line 177 of file interaction_coordinator.h.
Referenced by CancelCurrentMode(), GetActiveHandler(), GetCurrentMode(), and SetMode().
|
private |
Definition at line 178 of file interaction_coordinator.h.
Referenced by ApplySelection(), ClearEntitySelection(), DeleteSelectedEntity(), DescribeEntity(), DrawMultiEntitySelectionHighlights(), FindSelectedCycleIndex(), FinishEntityGroupDrag(), HandleClick(), HandleDrag(), HasGroupDragSelection(), IsSelectionHitSelected(), NudgeSelectedEntities(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetSelectedEntities(), UpdateEntitySelection(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 180 of file interaction_coordinator.h.
Referenced by ApplySelection(), CancelCurrentMode(), CancelPlacement(), ClearAllEntitySelections(), DeleteSelectedEntity(), door_handler(), door_handler(), DrawGhostPreviews(), DrawPostPlacementOverlays(), DrawSelectionHighlights(), GetActiveHandler(), GetEntitiesAtPosition(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HandleDrag(), HandleMouseWheel(), HandleRelease(), HasEntitySelection(), IsPlacementActive(), NudgeSelected(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetMode(), SetSelectedEntities(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 181 of file interaction_coordinator.h.
Referenced by ApplySelection(), CancelCurrentMode(), CancelPlacement(), ClearAllEntitySelections(), DeleteSelectedEntity(), DrawGhostPreviews(), DrawPostPlacementOverlays(), DrawSelectionHighlights(), GetActiveHandler(), GetEntitiesAtPosition(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HandleDrag(), HandleMouseWheel(), HandleRelease(), HasEntitySelection(), IsPlacementActive(), NudgeSelected(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetMode(), SetSelectedEntities(), sprite_handler(), sprite_handler(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 182 of file interaction_coordinator.h.
Referenced by ApplySelection(), CancelCurrentMode(), CancelPlacement(), ClearAllEntitySelections(), DeleteSelectedEntity(), DrawGhostPreviews(), DrawPostPlacementOverlays(), DrawSelectionHighlights(), GetActiveHandler(), GetEntitiesAtPosition(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HandleDrag(), HandleMouseWheel(), HandleRelease(), HasEntitySelection(), IsPlacementActive(), item_handler(), item_handler(), NudgeSelected(), SelectEntitiesInRect(), SelectEntity(), SetContext(), SetMode(), SetSelectedEntities(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 183 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 184 of file interaction_coordinator.h.
Referenced by ApplySelection(), ClearAllEntitySelections(), DeleteSelectedEntity(), DrawMultiEntitySelectionHighlights(), DrawSelectionHighlights(), FindSelectedCycleIndex(), GetSelectedEntities(), GetSelectedEntity(), GetSelectedEntityType(), HandleClick(), HasEntitySelection(), HasGroupDragSelection(), IsSelectionHitSelected(), NudgeSelected(), NudgeSelectedEntities(), SelectEntitiesInRect(), SelectEntity(), SetSelectedEntities(), TrySelectEntityAtCursor(), and UpdateEntitySelection().
|
private |
Definition at line 185 of file interaction_coordinator.h.
Referenced by HandleClick(), SameCycleTarget(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 186 of file interaction_coordinator.h.
Referenced by HandleClick(), SameCycleTarget(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 187 of file interaction_coordinator.h.
Referenced by HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 188 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 189 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 190 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 191 of file interaction_coordinator.h.
Referenced by DrawSelectionCycleHud(), HandleClick(), SameCycleTarget(), and UpdateSelectionCycleHudPreview().
|
private |
Definition at line 192 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), ClearAllEntitySelections(), FinishEntityGroupDrag(), HandleDrag(), HandleEntityGroupDrag(), and ResetEntityGroupDragState().
|
private |
Definition at line 193 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), and HandleEntityGroupDrag().
|
private |
Definition at line 194 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), and HandleEntityGroupDrag().
|
private |
Definition at line 195 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), HandleEntityGroupDrag(), and ResetEntityGroupDragState().
|
private |
Definition at line 196 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), HandleEntityGroupDrag(), and ResetEntityGroupDragState().
|
private |
Definition at line 197 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), NudgeSelectedEntities(), and ResetEntityGroupDragState().
|
private |
Definition at line 198 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), NudgeSelectedEntities(), and ResetEntityGroupDragState().
|
private |
Definition at line 199 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), NudgeSelectedEntities(), and ResetEntityGroupDragState().
|
private |
Definition at line 200 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), FinishEntityGroupDrag(), NudgeSelectedEntities(), and ResetEntityGroupDragState().
|
private |
Definition at line 201 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), FinishEntityGroupDrag(), NudgeSelectedEntities(), and ResetEntityGroupDragState().
|
private |
Definition at line 202 of file interaction_coordinator.h.
Referenced by BeginSelectionDrag(), FinishEntityGroupDrag(), NudgeSelectedEntities(), and ResetEntityGroupDragState().