Handles functional mutations and queries for tile objects. More...
#include <tile_object_handler.h>


Classes | |
| struct | GhostPreviewGeometry |
Public Types | |
| enum class | PlacementBlockReason { kNone = 0 , kInvalidRoom , kObjectLimit , kChestValidation } |
| enum class | PlacementPolicy { kRepeat , kOnce } |
| using | GhostCapacityState = PlacementCapacityState |
| using | ObjectMutationPreflight |
Public Member Functions | |
| TileObjectHandler () | |
| TileObjectHandler (InteractionContext *ctx) | |
| void | BeginPlacement () override |
| Begin placement mode. | |
| void | CancelPlacement () override |
| Cancel current placement. | |
| bool | IsPlacementActive () const override |
| Check if placement mode is active. | |
| bool | HandleClick (int canvas_x, int canvas_y) override |
| Handle mouse click at canvas position. | |
| void | HandleDrag (ImVec2 current_pos, ImVec2 delta) override |
| Handle mouse drag. | |
| void | HandleRelease () override |
| Handle mouse release. | |
| bool | HandleMouseWheel (float delta) override |
| void | DrawGhostPreview () override |
| Draw ghost preview during placement. | |
| void | DrawSelectionHighlight () override |
| Draw selection highlight for selected entities. | |
| void | InitDrag (const ImVec2 &start_pos) |
| void | BeginMarqueeSelection (const ImVec2 &start_pos) |
| void | HandleMarqueeSelection (const ImVec2 &mouse_pos, bool mouse_left_down, bool mouse_left_released, bool shift_down, bool toggle_down, bool alt_down, bool draw_box=true) |
| std::optional< size_t > | GetEntityAtPosition (int canvas_x, int canvas_y) const override |
| Get entity at canvas position. | |
| bool | MoveObjects (int room_id, const std::vector< size_t > &indices, int delta_x, int delta_y, bool notify_mutation=true) |
| Move a set of objects by a tile delta. | |
| std::vector< size_t > | DuplicateObjects (int room_id, const std::vector< size_t > &indices, int delta_x, int delta_y) |
| Clone a set of objects and move them by a tile delta. | |
| bool | DeleteObjects (int room_id, std::vector< size_t > indices) |
| Delete objects by indices. | |
| bool | DeleteAllObjects (int room_id) |
| Delete all objects in a room. | |
| void | SendToFront (int room_id, const std::vector< size_t > &indices) |
| Reorder objects. | |
| void | SendToBack (int room_id, const std::vector< size_t > &indices) |
| void | MoveForward (int room_id, const std::vector< size_t > &indices) |
| void | MoveBackward (int room_id, const std::vector< size_t > &indices) |
| bool | ResizeObjects (int room_id, const std::vector< size_t > &indices, int delta, bool horizontal=false, bool uniform=false) |
| Resize objects by a delta. Uniform changes both packed axes; otherwise horizontal selects packed-floor width. | |
| bool | PlaceObjectAt (int room_id, const zelda3::RoomObject &object, int x, int y) |
| Place a new object. Returns false if blocked by ROM limits. | |
| void | SetPlacementPolicy (PlacementPolicy policy) |
| PlacementPolicy | GetPlacementPolicy () const |
| void | SetObjectMutationPreflight (ObjectMutationPreflight callback) |
| void | SetBeforeObjectCommandCallback (std::function< void()> callback) |
| const absl::Status & | mutation_status () const |
| void | SetMutationErrorCallback (std::function< void(const absl::Status &)> callback) |
| void | SetPlacementCallback (std::function< void(const zelda3::RoomObject &)> callback) |
| bool | was_placement_blocked () const |
| True if the most recent PlaceObjectAt was blocked. | |
| PlacementBlockReason | placement_block_reason () const |
| void | clear_placement_blocked () |
| GhostCapacityState | GetPlacementGhostCapacityState () const |
| void | UpdateObjectsId (int room_id, const std::vector< size_t > &indices, int16_t new_id) |
| void | UpdateObjectsSize (int room_id, const std::vector< size_t > &indices, uint8_t new_size) |
| bool | UpdateObjectsLayer (int room_id, const std::vector< size_t > &indices, int new_layer) |
| void | SetPreviewObject (const zelda3::RoomObject &object) |
| Set object for placement. | |
| const zelda3::RoomObject & | GetPreviewObject () const |
| bool | SetPreviewSize (uint8_t size) |
| bool | SetPreviewLayer (int layer) |
| void | RefreshPreviewGraphics () |
| Refresh graphics without replacing the current placement geometry. | |
| const gfx::BackgroundBuffer * | ghost_preview_buffer_for_testing () const |
| void | CopyObjectsToClipboard (int room_id, const std::vector< size_t > &indices) |
| Copy objects to internal clipboard. | |
| std::vector< size_t > | PasteFromClipboard (int room_id, int offset_x, int offset_y) |
| Paste objects from clipboard with offset. | |
| std::vector< size_t > | PasteFromClipboardAt (int room_id, int target_x, int target_y) |
| Paste objects from clipboard at target location. Use first clipboard item as origin. | |
| bool | HasClipboardData () const |
| Check if clipboard has data. | |
| void | ClearClipboard () |
| Clear the clipboard. | |
Public Member Functions inherited from yaze::editor::BaseEntityHandler | |
| virtual | ~BaseEntityHandler ()=default |
| void | SetContext (InteractionContext *ctx) |
| Set the interaction context. | |
| InteractionContext * | context () const |
| Get the interaction context. | |
| void | DrawPostPlacementToast () |
Static Public Member Functions | |
| static GhostPreviewGeometry | CalculateGhostPreviewGeometry (const zelda3::RoomObject &object) |
| Resolve the render anchor and visual extent used by placement previews. | |
Private Member Functions | |
| bool | RejectMutation (absl::Status status) |
| bool | CommitCandidate (int room_id, std::vector< zelda3::RoomObject > candidate, const std::vector< std::optional< size_t > > &sources, const std::vector< std::optional< chest_data > > &chest_overrides={}, std::optional< std::vector< size_t > > selection=std::nullopt) |
| void | RenderGhostPreviewBitmap () |
| ImVec2 | ApplyDragModifiers (const ImVec2 &delta) const |
| void | DrawSmartGuides (const std::vector< zelda3::RoomObject > &objects) const |
| zelda3::Room * | GetRoom (int room_id) |
| void | NotifyChange (zelda3::Room *room) |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::BaseEntityHandler | |
| void | TriggerSuccessToast () |
| void | DrawSuccessToastOverlay (const char *msg, ImU32 color) const |
| std::pair< int, int > | RoomToCanvas (int room_x, int room_y) const |
| Convert room tile coordinates to canvas pixel coordinates. | |
| std::pair< int, int > | CanvasToRoom (int canvas_x, int canvas_y) const |
| Convert canvas pixel coordinates to room tile coordinates. | |
| bool | IsWithinBounds (int canvas_x, int canvas_y) const |
| Check if coordinates are within room bounds. | |
| ImVec2 | GetCanvasZeroPoint () const |
| Get canvas zero point (for screen coordinate conversion) | |
| DungeonCanvasTransform | GetCanvasTransform () const |
| std::optional< ImVec2 > | GetPointerScreenPosition () const |
| bool | HasValidContext () const |
| Check if context is valid. | |
| zelda3::Room * | GetCurrentRoom () const |
| Get current room (convenience method) | |
Protected Attributes inherited from yaze::editor::BaseEntityHandler | |
| InteractionContext * | ctx_ = nullptr |
| float | toast_expire_time_ = 0.0f |
Static Protected Attributes inherited from yaze::editor::BaseEntityHandler | |
| static constexpr float | kToastDuration = 1.5f |
Handles functional mutations and queries for tile objects.
This class abstracts the raw manipulation of zelda3::RoomObject vectors, providing a cleaner API for the UI and future CLI.
Definition at line 25 of file tile_object_handler.h.
Definition at line 27 of file tile_object_handler.h.
Definition at line 136 of file tile_object_handler.h.
|
strong |
| Enumerator | |
|---|---|
| kNone | |
| kInvalidRoom | |
| kObjectLimit | |
| kChestValidation | |
Definition at line 39 of file tile_object_handler.h.
|
strong |
| Enumerator | |
|---|---|
| kRepeat | |
| kOnce | |
Definition at line 46 of file tile_object_handler.h.
|
inline |
Definition at line 48 of file tile_object_handler.h.
|
inlineexplicit |
Definition at line 49 of file tile_object_handler.h.
References yaze::editor::BaseEntityHandler::SetContext().

|
overridevirtual |
Begin placement mode.
Called when user selects an entity to place from the palette. Override to initialize placement state.
Implements yaze::editor::BaseEntityHandler.
Definition at line 276 of file tile_object_handler.cc.
References object_placement_mode_, and RenderGhostPreviewBitmap().

|
overridevirtual |
Cancel current placement.
Called when user presses Escape or switches modes. Override to clean up placement state.
Implements yaze::editor::BaseEntityHandler.
Definition at line 281 of file tile_object_handler.cc.
References object_placement_mode_.
Referenced by yaze::editor::InteractionCoordinator::CancelCurrentMode(), and yaze::editor::InteractionCoordinator::CancelPlacement().
|
inlineoverridevirtual |
Check if placement mode is active.
Implements yaze::editor::BaseEntityHandler.
Definition at line 57 of file tile_object_handler.h.
References object_placement_mode_.
Referenced by yaze::editor::InteractionCoordinator::DrawGhostPreviews(), yaze::editor::DungeonObjectInteraction::GetPlacementPreview(), yaze::editor::InteractionCoordinator::HandleClick(), yaze::editor::InteractionCoordinator::HandleDrag(), yaze::editor::InteractionCoordinator::HandleMouseWheel(), and yaze::editor::InteractionCoordinator::IsPlacementActive().
|
overridevirtual |
Handle mouse click at canvas position.
| canvas_x | Unscaled X position relative to canvas origin |
| canvas_y | Unscaled Y position relative to canvas origin |
Implements yaze::editor::BaseEntityHandler.
Definition at line 285 of file tile_object_handler.cc.
References yaze::editor::ObjectSelection::Add, yaze::editor::BaseEntityHandler::CanvasToRoom(), yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, GetEntityAtPosition(), yaze::editor::BaseEntityHandler::HasValidContext(), yaze::editor::BaseEntityHandler::IsWithinBounds(), object_placement_mode_, PlaceObjectAt(), preview_object_, yaze::editor::InteractionContext::selection, yaze::editor::ObjectSelection::SelectObject(), yaze::editor::ObjectSelection::Single, and yaze::editor::ObjectSelection::Toggle.
Referenced by yaze::editor::InteractionCoordinator::HandleClick().
|
overridevirtual |
Handle mouse drag.
| current_pos | Current unscaled room-pixel position |
| delta | Mouse movement since last frame (screen pixels) |
Implements yaze::editor::BaseEntityHandler.
Definition at line 387 of file tile_object_handler.cc.
References ApplyDragModifiers(), yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, drag_current_, drag_last_dx_, drag_last_dy_, drag_mutation_started_, drag_rejected_delta_, drag_start_, yaze::editor::ObjectSelection::GetSelectedIndices(), is_dragging_, MoveObjects(), mutation_status_, yaze::editor::InteractionContext::selection, and yaze::editor::snapping::SnapToTileGrid().
Referenced by yaze::editor::InteractionCoordinator::HandleDrag().

|
overridevirtual |
Handle mouse release.
Called when left mouse button is released after a drag.
Implements yaze::editor::BaseEntityHandler.
Definition at line 425 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, drag_has_duplicated_, drag_mutation_started_, is_dragging_, yaze::editor::kTileObjects, and yaze::editor::InteractionContext::NotifyInvalidateCache().
Referenced by yaze::editor::InteractionCoordinator::HandleRelease().

|
overridevirtual |
Reimplemented from yaze::editor::BaseEntityHandler.
Definition at line 445 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, yaze::editor::ObjectSelection::GetSelectedIndices(), yaze::editor::BaseEntityHandler::HasValidContext(), yaze::zelda3::RoomObject::id_, object_placement_mode_, preview_object_, ResizeObjects(), yaze::zelda3::ResizeRoomObjectByDelta(), yaze::zelda3::ResizeRoomObjectUniformlyByDelta(), yaze::editor::InteractionContext::selection, SetPreviewSize(), and yaze::zelda3::RoomObject::size_.
Referenced by yaze::editor::InteractionCoordinator::HandleMouseWheel().
|
overridevirtual |
Draw ghost preview during placement.
Called every frame when placement mode is active. Shows preview of entity at cursor position.
Implements yaze::editor::BaseEntityHandler.
Definition at line 474 of file tile_object_handler.cc.
References CalculateGhostPreviewGeometry(), yaze::editor::BaseEntityHandler::CanvasToRoom(), yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, yaze::editor::DrawPlacementCapacityBadge(), yaze::editor::BaseEntityHandler::GetCanvasTransform(), yaze::editor::GetPlacementAccentColor(), yaze::editor::GetPlacementCapacityTooltipSuffix(), GetPlacementGhostCapacityState(), yaze::editor::BaseEntityHandler::GetPointerScreenPosition(), GetRoom(), yaze::editor::AgentUI::GetTheme(), yaze::zelda3::Room::GetTileObjects(), ghost_preview_bitmap_ready_, ghost_preview_buffer_, ghost_preview_graphics_revision_, ghost_preview_room_id_, yaze::zelda3::Room::graphics_revision(), yaze::editor::BaseEntityHandler::HasValidContext(), yaze::zelda3::RoomObject::id_, yaze::editor::BaseEntityHandler::IsWithinBounds(), yaze::zelda3::kMaxTileObjects, object_placement_mode_, preview_object_, RenderGhostPreviewBitmap(), yaze::editor::DungeonCanvasTransform::RoomPixelsToScreen(), yaze::editor::DungeonCanvasTransform::RoomSizeToScreen(), yaze::editor::BaseEntityHandler::RoomToCanvas(), and yaze::editor::DungeonCanvasTransform::ScreenToRoomPixelCoordinates().
Referenced by yaze::editor::InteractionCoordinator::DrawGhostPreviews().
|
overridevirtual |
Draw selection highlight for selected entities.
Called every frame to show selection state.
Implements yaze::editor::BaseEntityHandler.
Definition at line 579 of file tile_object_handler.cc.
References yaze::editor::InteractionContext::canvas, yaze::editor::BaseEntityHandler::ctx_, yaze::editor::ObjectSelection::DrawSelectionHighlights(), DrawSmartGuides(), yaze::editor::BaseEntityHandler::GetCurrentRoom(), yaze::editor::BaseEntityHandler::HasValidContext(), is_dragging_, and yaze::editor::InteractionContext::selection.

| void yaze::editor::TileObjectHandler::InitDrag | ( | const ImVec2 & | start_pos | ) |
Definition at line 323 of file tile_object_handler.cc.
References drag_current_, drag_has_duplicated_, drag_last_dx_, drag_last_dy_, drag_mutation_started_, drag_rejected_delta_, drag_start_, is_dragging_, and yaze::editor::snapping::SnapToTileGrid().

| void yaze::editor::TileObjectHandler::BeginMarqueeSelection | ( | const ImVec2 & | start_pos | ) |
Definition at line 334 of file tile_object_handler.cc.
References yaze::editor::ObjectSelection::BeginRectangleSelection(), yaze::editor::BaseEntityHandler::ctx_, and yaze::editor::InteractionContext::selection.

| void yaze::editor::TileObjectHandler::HandleMarqueeSelection | ( | const ImVec2 & | mouse_pos, |
| bool | mouse_left_down, | ||
| bool | mouse_left_released, | ||
| bool | shift_down, | ||
| bool | toggle_down, | ||
| bool | alt_down, | ||
| bool | draw_box = true ) |
Definition at line 341 of file tile_object_handler.cc.
References yaze::editor::ObjectSelection::CancelRectangleSelection(), yaze::editor::InteractionContext::canvas, yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, yaze::editor::ObjectSelection::DrawRectangleSelectionBox(), yaze::editor::ObjectSelection::EndRectangleSelection(), GetRoom(), yaze::editor::ObjectSelection::IsRectangleLargeEnough(), yaze::editor::ObjectSelection::IsRectangleSelectionActive(), yaze::editor::InteractionContext::selection, yaze::editor::ObjectSelection::Single, and yaze::editor::ObjectSelection::UpdateRectangleSelection().
|
overridevirtual |
Get entity at canvas position.
| canvas_x | Unscaled X position relative to canvas origin |
| canvas_y | Unscaled Y position relative to canvas origin |
Implements yaze::editor::BaseEntityHandler.
Definition at line 601 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, yaze::zelda3::DimensionService::Get(), yaze::zelda3::DimensionService::GetHitTestBounds(), GetRoom(), yaze::zelda3::Room::GetTileObjects(), yaze::editor::BaseEntityHandler::HasValidContext(), yaze::editor::InteractionContext::IsObjectVisibleForSelection(), yaze::editor::BaseEntityHandler::IsWithinBounds(), yaze::editor::ObjectSelection::PassesLayerFilterForObject(), and yaze::editor::InteractionContext::selection.
Referenced by yaze::editor::InteractionCoordinator::GetEntitiesAtPosition(), yaze::editor::DungeonCanvasViewer::GetObjectUnderContextCursor(), HandleClick(), and yaze::editor::DungeonCanvasViewer::HandleTouchLongPressContextMenu().
| bool yaze::editor::TileObjectHandler::MoveObjects | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| int | delta_x, | ||
| int | delta_y, | ||
| bool | notify_mutation = true ) |
Move a set of objects by a tile delta.
Definition at line 819 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, GetRoom(), yaze::editor::kTileObjects, mutation_status_, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), object_mutation_preflight_, and RejectMutation().
Referenced by HandleDrag().

| std::vector< size_t > yaze::editor::TileObjectHandler::DuplicateObjects | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| int | delta_x, | ||
| int | delta_y ) |
Clone a set of objects and move them by a tile delta.
Definition at line 1021 of file tile_object_handler.cc.
References yaze::zelda3::Chest, yaze::zelda3::IsStatefulChestObjectId(), and yaze::zelda3::UsesRoomObjectStream().

| bool yaze::editor::TileObjectHandler::DeleteObjects | ( | int | room_id, |
| std::vector< size_t > | indices ) |
Delete objects by indices.
Definition at line 1053 of file tile_object_handler.cc.
| bool yaze::editor::TileObjectHandler::DeleteAllObjects | ( | int | room_id | ) |
Delete all objects in a room.
Definition at line 1076 of file tile_object_handler.cc.
| void yaze::editor::TileObjectHandler::SendToFront | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Reorder objects.
Definition at line 1080 of file tile_object_handler.cc.
| void yaze::editor::TileObjectHandler::SendToBack | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Definition at line 1114 of file tile_object_handler.cc.
| void yaze::editor::TileObjectHandler::MoveForward | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Definition at line 1148 of file tile_object_handler.cc.
| void yaze::editor::TileObjectHandler::MoveBackward | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Definition at line 1177 of file tile_object_handler.cc.
| bool yaze::editor::TileObjectHandler::ResizeObjects | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| int | delta, | ||
| bool | horizontal = false, | ||
| bool | uniform = false ) |
Resize objects by a delta. Uniform changes both packed axes; otherwise horizontal selects packed-floor width.
Definition at line 1206 of file tile_object_handler.cc.
References yaze::zelda3::IsRoomObjectResizable(), yaze::zelda3::ResizeRoomObjectByDelta(), and yaze::zelda3::ResizeRoomObjectUniformlyByDelta().
Referenced by HandleMouseWheel().

| bool yaze::editor::TileObjectHandler::PlaceObjectAt | ( | int | room_id, |
| const zelda3::RoomObject & | object, | ||
| int | x, | ||
| int | y ) |
Place a new object. Returns false if blocked by ROM limits.
Definition at line 1275 of file tile_object_handler.cc.
References yaze::zelda3::Chest, yaze::zelda3::IsStatefulChestObjectId(), yaze::zelda3::kMaxTileObjects, and yaze::zelda3::UsesRoomObjectStream().
Referenced by HandleClick(), and yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets().

|
inline |
Definition at line 132 of file tile_object_handler.h.
References placement_policy_.
Referenced by yaze::editor::DungeonObjectInteraction::SetPlacementPolicy().
|
inline |
Definition at line 135 of file tile_object_handler.h.
References placement_policy_.
Referenced by yaze::editor::DungeonObjectInteraction::GetPlacementPolicy().
|
inline |
Definition at line 139 of file tile_object_handler.h.
References object_mutation_preflight_.
Referenced by yaze::editor::DungeonEditorV2::ConfigureViewerUndoHooks().
|
inline |
Definition at line 144 of file tile_object_handler.h.
References before_object_command_callback_.
Referenced by yaze::editor::DungeonEditorV2::ConfigureViewerUndoHooks().
|
inline |
Definition at line 147 of file tile_object_handler.h.
References mutation_status_.
|
inline |
Definition at line 148 of file tile_object_handler.h.
References mutation_error_callback_.
Referenced by yaze::editor::DungeonEditorV2::ConfigureViewerUndoHooks().
|
inline |
Definition at line 153 of file tile_object_handler.h.
References placement_callback_.
Referenced by yaze::editor::DungeonObjectInteraction::DungeonObjectInteraction().
|
inline |
True if the most recent PlaceObjectAt was blocked.
Definition at line 159 of file tile_object_handler.h.
References kNone, and placement_block_reason_.
|
inline |
Definition at line 162 of file tile_object_handler.h.
References placement_block_reason_.
Referenced by yaze::editor::ObjectSelectorContent::DrawContent().
|
inline |
Definition at line 165 of file tile_object_handler.h.
References kNone, and placement_block_reason_.
| TileObjectHandler::GhostCapacityState yaze::editor::TileObjectHandler::GetPlacementGhostCapacityState | ( | ) | const |
Definition at line 247 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, yaze::editor::GetPlacementCapacityState(), GetRoom(), yaze::zelda3::Room::GetTileObjects(), and yaze::zelda3::kMaxTileObjects.
Referenced by DrawGhostPreview().

| void yaze::editor::TileObjectHandler::UpdateObjectsId | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| int16_t | new_id ) |
Definition at line 872 of file tile_object_handler.cc.
References yaze::zelda3::CanonicalRoomObjectSize(), yaze::zelda3::Chest, CommitCandidate(), GetRoom(), yaze::zelda3::IsStatefulChestObjectId(), mutation_status_, RejectMutation(), and yaze::zelda3::UsesSpecialLayerSelector().
| void yaze::editor::TileObjectHandler::UpdateObjectsSize | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| uint8_t | new_size ) |
Definition at line 904 of file tile_object_handler.cc.
References yaze::zelda3::CanonicalRoomObjectSize(), yaze::zelda3::CustomObjectManager::Get(), GetRoom(), yaze::zelda3::IsRoomObjectResizable(), yaze::zelda3::IsRoomObjectSizeEditable(), and mutation_status_.
| bool yaze::editor::TileObjectHandler::UpdateObjectsLayer | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| int | new_layer ) |
Definition at line 961 of file tile_object_handler.cc.
References LOG_WARN, and yaze::zelda3::ReassignObjectStorage().

| void yaze::editor::TileObjectHandler::SetPreviewObject | ( | const zelda3::RoomObject & | object | ) |
Set object for placement.
Definition at line 1323 of file tile_object_handler.cc.
|
inline |
Definition at line 186 of file tile_object_handler.h.
References preview_object_.
| bool yaze::editor::TileObjectHandler::SetPreviewSize | ( | uint8_t | size | ) |
Definition at line 1328 of file tile_object_handler.cc.
References yaze::zelda3::CanonicalRoomObjectSize(), yaze::zelda3::CustomObjectManager::Get(), yaze::zelda3::IsRoomObjectResizable(), and yaze::zelda3::IsRoomObjectSizeEditable().
Referenced by HandleMouseWheel(), and yaze::editor::DungeonObjectInteraction::SetPlacementPreviewSize().

| bool yaze::editor::TileObjectHandler::SetPreviewLayer | ( | int | layer | ) |
Definition at line 1350 of file tile_object_handler.cc.
References yaze::zelda3::UsesSpecialLayerSelector().
Referenced by yaze::editor::DungeonObjectInteraction::SetPlacementPreviewLayer().

| void yaze::editor::TileObjectHandler::RefreshPreviewGraphics | ( | ) |
Refresh graphics without replacing the current placement geometry.
Definition at line 1363 of file tile_object_handler.cc.
Referenced by yaze::editor::DungeonObjectInteraction::SetCurrentPaletteGroup().
|
static |
Resolve the render anchor and visual extent used by placement previews.
Definition at line 1437 of file tile_object_handler.cc.
References yaze::zelda3::DimensionService::Get(), yaze::zelda3::ObjectGeometry::Get(), yaze::zelda3::DimensionService::GetDimensions(), yaze::editor::TileObjectHandler::GhostPreviewGeometry::render_anchor_x_tiles, and yaze::zelda3::ObjectGeometry::ResolveAnchor().
Referenced by DrawGhostPreview().

|
inline |
Definition at line 200 of file tile_object_handler.h.
References ghost_preview_buffer_.
| void yaze::editor::TileObjectHandler::CopyObjectsToClipboard | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Copy objects to internal clipboard.
Definition at line 1466 of file tile_object_handler.cc.
References yaze::zelda3::ChestIndexForObject(), yaze::zelda3::IsStatefulChestObjectId(), and yaze::zelda3::ValidateChestObjectMapping().

| std::vector< size_t > yaze::editor::TileObjectHandler::PasteFromClipboard | ( | int | room_id, |
| int | offset_x, | ||
| int | offset_y ) |
Paste objects from clipboard with offset.
Definition at line 1504 of file tile_object_handler.cc.
References yaze::zelda3::Chest, yaze::zelda3::IsStatefulChestObjectId(), and yaze::zelda3::UsesRoomObjectStream().

| std::vector< size_t > yaze::editor::TileObjectHandler::PasteFromClipboardAt | ( | int | room_id, |
| int | target_x, | ||
| int | target_y ) |
Paste objects from clipboard at target location. Use first clipboard item as origin.
Definition at line 1540 of file tile_object_handler.cc.
|
inline |
Check if clipboard has data.
Definition at line 230 of file tile_object_handler.h.
References clipboard_.
|
inline |
Clear the clipboard.
Definition at line 235 of file tile_object_handler.h.
References clipboard_, clipboard_chests_, and clipboard_status_.
|
private |
Definition at line 737 of file tile_object_handler.cc.
References mutation_error_callback_, and mutation_status_.
Referenced by CommitCandidate(), MoveObjects(), and UpdateObjectsId().
|
private |
Definition at line 745 of file tile_object_handler.cc.
References before_object_command_callback_, yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_room_id, GetRoom(), yaze::zelda3::kMaxTileObjects, yaze::editor::kTileObjects, mutation_status_, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), object_mutation_preflight_, yaze::zelda3::PlanChestObjectEdit(), RejectMutation(), and yaze::editor::InteractionContext::selection.
Referenced by UpdateObjectsId().
|
private |
Definition at line 1369 of file tile_object_handler.cc.
References yaze::zelda3::RoomObject::BG1, yaze::gfx::Arena::CREATE, yaze::zelda3::ObjectDrawer::DrawObject(), yaze::gfx::Arena::Get(), yaze::zelda3::ObjectDrawer::InitializeDrawRoutines(), yaze::gfx::Arena::ProcessTextureQueue(), yaze::gfx::Arena::QueueTextureCommand(), yaze::zelda3::ObjectDrawer::SetRoomFloorGraphics(), and yaze::gfx::Arena::UPDATE.
Referenced by BeginPlacement(), and DrawGhostPreview().
|
private |
Definition at line 441 of file tile_object_handler.cc.
Referenced by HandleDrag().
|
private |
Definition at line 642 of file tile_object_handler.cc.
References yaze::editor::InteractionContext::canvas, yaze::editor::BaseEntityHandler::ctx_, yaze::editor::BaseEntityHandler::GetCanvasTransform(), yaze::editor::ObjectSelection::GetSelectedIndices(), yaze::editor::AgentUI::GetTheme(), yaze::editor::ObjectSelection::HasSelection(), yaze::editor::ObjectSelection::IsObjectSelected(), yaze::editor::dungeon_coords::kRoomPixelHeight, yaze::editor::dungeon_coords::kRoomPixelWidth, yaze::editor::DungeonCanvasTransform::room_origin_screen(), yaze::editor::DungeonCanvasTransform::RoomPixelsToScreen(), yaze::editor::DungeonCanvasTransform::RoomSizeToScreen(), and yaze::editor::InteractionContext::selection.
Referenced by DrawSelectionHighlight().
|
private |
Definition at line 256 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::rooms, and yaze::editor::DungeonRoomStore::size().
Referenced by CommitCandidate(), DrawGhostPreview(), GetEntityAtPosition(), GetPlacementGhostCapacityState(), HandleMarqueeSelection(), MoveObjects(), UpdateObjectsId(), and UpdateObjectsSize().

|
private |
Definition at line 265 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, yaze::editor::kTileObjects, yaze::zelda3::Room::MarkTileObjectCollectionDirty(), and yaze::editor::InteractionContext::NotifyInvalidateCache().
Referenced by CommitCandidate(), and MoveObjects().

|
private |
Definition at line 243 of file tile_object_handler.h.
Referenced by BeginPlacement(), CancelPlacement(), DrawGhostPreview(), HandleClick(), HandleMouseWheel(), and IsPlacementActive().
|
private |
Definition at line 244 of file tile_object_handler.h.
Referenced by GetPlacementPolicy(), and SetPlacementPolicy().
|
private |
Definition at line 245 of file tile_object_handler.h.
Referenced by SetPlacementCallback().
|
private |
Definition at line 246 of file tile_object_handler.h.
Referenced by clear_placement_blocked(), placement_block_reason(), and was_placement_blocked().
|
private |
Definition at line 247 of file tile_object_handler.h.
Referenced by DrawGhostPreview(), GetPreviewObject(), HandleClick(), and HandleMouseWheel().
|
private |
Definition at line 248 of file tile_object_handler.h.
Referenced by DrawGhostPreview(), and ghost_preview_buffer_for_testing().
|
private |
Definition at line 249 of file tile_object_handler.h.
Referenced by DrawGhostPreview().
|
private |
Definition at line 250 of file tile_object_handler.h.
|
private |
Definition at line 251 of file tile_object_handler.h.
Referenced by DrawGhostPreview().
|
private |
Definition at line 252 of file tile_object_handler.h.
Referenced by DrawGhostPreview().
|
private |
Definition at line 255 of file tile_object_handler.h.
Referenced by ClearClipboard(), and HasClipboardData().
|
private |
Definition at line 256 of file tile_object_handler.h.
Referenced by ClearClipboard().
|
private |
Definition at line 257 of file tile_object_handler.h.
Referenced by ClearClipboard().
|
private |
Definition at line 258 of file tile_object_handler.h.
Referenced by CommitCandidate(), HandleDrag(), MoveObjects(), mutation_status(), RejectMutation(), UpdateObjectsId(), and UpdateObjectsSize().
|
private |
Definition at line 259 of file tile_object_handler.h.
Referenced by CommitCandidate(), MoveObjects(), and SetObjectMutationPreflight().
|
private |
Definition at line 260 of file tile_object_handler.h.
Referenced by CommitCandidate(), and SetBeforeObjectCommandCallback().
|
private |
Definition at line 261 of file tile_object_handler.h.
Referenced by RejectMutation(), and SetMutationErrorCallback().
|
private |
Definition at line 273 of file tile_object_handler.h.
Referenced by DrawSelectionHighlight(), HandleDrag(), HandleRelease(), and InitDrag().
|
private |
Definition at line 274 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 275 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 276 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 277 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 278 of file tile_object_handler.h.
Referenced by HandleRelease(), and InitDrag().
|
private |
Definition at line 279 of file tile_object_handler.h.
Referenced by HandleDrag(), HandleRelease(), and InitDrag().
|
private |
Definition at line 280 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().