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 } |
| using | GhostCapacityState = PlacementCapacityState |
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. | |
| void | 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, bool notify_mutation=true) |
| Clone a set of objects and move them by a tile delta. | |
| void | DeleteObjects (int room_id, std::vector< size_t > indices) |
| Delete objects by indices. | |
| void | 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) |
| void | ResizeObjects (int room_id, const std::vector< size_t > &indices, int delta) |
| Resize objects by a delta. | |
| bool | PlaceObjectAt (int room_id, const zelda3::RoomObject &object, int x, int y) |
| Place a new object. Returns false if blocked by ROM limits. | |
| 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 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 | |
| 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) |
Private Attributes | |
| bool | object_placement_mode_ = false |
| PlacementBlockReason | placement_block_reason_ = PlacementBlockReason::kNone |
| zelda3::RoomObject | preview_object_ {-1, 0, 0, 0} |
| std::unique_ptr< gfx::BackgroundBuffer > | ghost_preview_buffer_ |
| bool | ghost_preview_bitmap_ready_ = false |
| bool | ghost_preview_create_queued_ = false |
| std::vector< zelda3::RoomObject > | clipboard_ |
| bool | is_dragging_ = false |
| ImVec2 | drag_start_ {0, 0} |
| ImVec2 | drag_current_ {0, 0} |
| int | drag_last_dx_ = 0 |
| int | drag_last_dy_ = 0 |
| bool | drag_has_duplicated_ = false |
| bool | drag_mutation_started_ = false |
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 20 of file tile_object_handler.h.
Definition at line 22 of file tile_object_handler.h.
|
strong |
| Enumerator | |
|---|---|
| kNone | |
| kInvalidRoom | |
| kObjectLimit | |
Definition at line 34 of file tile_object_handler.h.
|
inline |
Definition at line 40 of file tile_object_handler.h.
|
inlineexplicit |
Definition at line 41 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 197 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 202 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 49 of file tile_object_handler.h.
References object_placement_mode_.
Referenced by yaze::editor::InteractionCoordinator::DrawGhostPreviews(), 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 206 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 304 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_start_, yaze::editor::ObjectSelection::GetSelectedIndices(), is_dragging_, yaze::editor::kTileObjects, MoveObjects(), yaze::editor::InteractionContext::NotifyMutation(), 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 338 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 358 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(), ResizeObjects(), and yaze::editor::InteractionContext::selection.
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 371 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_, yaze::editor::BaseEntityHandler::HasValidContext(), yaze::zelda3::RoomObject::id_, yaze::editor::BaseEntityHandler::IsWithinBounds(), yaze::zelda3::kMaxTileObjects, object_placement_mode_, preview_object_, 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 471 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 244 of file tile_object_handler.cc.
References drag_current_, drag_has_duplicated_, drag_last_dx_, drag_last_dy_, drag_mutation_started_, drag_start_, is_dragging_, and yaze::editor::snapping::SnapToTileGrid().

| void yaze::editor::TileObjectHandler::BeginMarqueeSelection | ( | const ImVec2 & | start_pos | ) |
Definition at line 254 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 261 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 493 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::BaseEntityHandler::IsWithinBounds(), yaze::editor::ObjectSelection::PassesLayerFilterForObject(), and yaze::editor::InteractionContext::selection.
Referenced by yaze::editor::InteractionCoordinator::GetEntitiesAtPosition(), yaze::editor::DungeonCanvasViewer::GetObjectUnderContextCursor(), and HandleClick().
| void 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 625 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().
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, | ||
| bool | notify_mutation = true ) |
Clone a set of objects and move them by a tile delta.
Definition at line 741 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().

| void yaze::editor::TileObjectHandler::DeleteObjects | ( | int | room_id, |
| std::vector< size_t > | indices ) |
Delete objects by indices.
Definition at line 768 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().

| void yaze::editor::TileObjectHandler::DeleteAllObjects | ( | int | room_id | ) |
Delete all objects in a room.
Definition at line 784 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().

| void yaze::editor::TileObjectHandler::SendToFront | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Reorder objects.
Definition at line 794 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), and yaze::editor::InteractionContext::selection.

| void yaze::editor::TileObjectHandler::SendToBack | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Definition at line 827 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), and yaze::editor::InteractionContext::selection.

| void yaze::editor::TileObjectHandler::MoveForward | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Definition at line 860 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), and yaze::editor::InteractionContext::selection.

| void yaze::editor::TileObjectHandler::MoveBackward | ( | int | room_id, |
| const std::vector< size_t > & | indices ) |
Definition at line 888 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), and yaze::editor::InteractionContext::selection.

| void yaze::editor::TileObjectHandler::ResizeObjects | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| int | delta ) |
Resize objects by a delta.
Definition at line 916 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().
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 936 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), kInvalidRoom, yaze::zelda3::kMaxTileObjects, kNone, kObjectLimit, yaze::editor::kTileObjects, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), placement_block_reason_, and yaze::editor::BaseEntityHandler::TriggerSuccessToast().
Referenced by HandleClick(), and yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets().

|
inline |
True if the most recent PlaceObjectAt was blocked.
Definition at line 123 of file tile_object_handler.h.
References kNone, and placement_block_reason_.
|
inline |
Definition at line 126 of file tile_object_handler.h.
References placement_block_reason_.
Referenced by yaze::editor::ObjectSelectorContent::Draw().
|
inline |
Definition at line 129 of file tile_object_handler.h.
References kNone, and placement_block_reason_.
| TileObjectHandler::GhostCapacityState yaze::editor::TileObjectHandler::GetPlacementGhostCapacityState | ( | ) | const |
Definition at line 168 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 648 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().

| void yaze::editor::TileObjectHandler::UpdateObjectsSize | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| uint8_t | new_size ) |
Definition at line 667 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().

| bool yaze::editor::TileObjectHandler::UpdateObjectsLayer | ( | int | room_id, |
| const std::vector< size_t > & | indices, | ||
| int | new_layer ) |
Definition at line 686 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, LOG_WARN, NotifyChange(), yaze::editor::InteractionContext::NotifyMutation(), yaze::zelda3::ReassignObjectStorage(), and yaze::editor::InteractionContext::selection.

| void yaze::editor::TileObjectHandler::SetPreviewObject | ( | const zelda3::RoomObject & | object | ) |
Set object for placement.
Definition at line 963 of file tile_object_handler.cc.
References object_placement_mode_, preview_object_, and RenderGhostPreviewBitmap().

|
static |
Resolve the render anchor and visual extent used by placement previews.
Definition at line 1035 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(), and RenderGhostPreviewBitmap().

|
inline |
Definition at line 155 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 1064 of file tile_object_handler.cc.
References clipboard_, and GetRoom().

| 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 1080 of file tile_object_handler.cc.
References clipboard_, yaze::editor::BaseEntityHandler::ctx_, GetRoom(), yaze::editor::kTileObjects, NotifyChange(), and yaze::editor::InteractionContext::NotifyMutation().
Referenced by PasteFromClipboardAt().

| 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 1105 of file tile_object_handler.cc.
References clipboard_, and PasteFromClipboard().

|
inline |
Check if clipboard has data.
Definition at line 185 of file tile_object_handler.h.
References clipboard_.
Referenced by yaze::editor::DungeonObjectInteraction::HasClipboardData().
|
inline |
|
private |
Definition at line 970 of file tile_object_handler.cc.
References yaze::zelda3::RoomObject::BG1, CalculateGhostPreviewGeometry(), yaze::gfx::Arena::CREATE, yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::current_palette_group, yaze::editor::InteractionContext::current_room_id, yaze::zelda3::ObjectDrawer::DrawObject(), yaze::gfx::Arena::Get(), GetRoom(), ghost_preview_bitmap_ready_, ghost_preview_buffer_, ghost_preview_create_queued_, yaze::zelda3::ObjectDrawer::InitializeDrawRoutines(), yaze::Rom::is_loaded(), preview_object_, yaze::gfx::Arena::ProcessTextureQueue(), yaze::gfx::Arena::QueueTextureCommand(), yaze::editor::InteractionContext::rom, yaze::gfx::Arena::UPDATE, and yaze::zelda3::RoomObject::x_.
Referenced by BeginPlacement(), and SetPreviewObject().
|
private |
Definition at line 354 of file tile_object_handler.cc.
Referenced by HandleDrag().
|
private |
Definition at line 530 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 177 of file tile_object_handler.cc.
References yaze::editor::BaseEntityHandler::ctx_, yaze::editor::InteractionContext::rooms, and yaze::editor::DungeonRoomStore::size().
Referenced by CopyObjectsToClipboard(), DeleteAllObjects(), DeleteObjects(), DrawGhostPreview(), DuplicateObjects(), GetEntityAtPosition(), GetPlacementGhostCapacityState(), HandleMarqueeSelection(), MoveBackward(), MoveForward(), MoveObjects(), PasteFromClipboard(), PlaceObjectAt(), RenderGhostPreviewBitmap(), ResizeObjects(), SendToBack(), SendToFront(), UpdateObjectsId(), UpdateObjectsLayer(), and UpdateObjectsSize().

|
private |
Definition at line 186 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 DeleteAllObjects(), DeleteObjects(), DuplicateObjects(), MoveBackward(), MoveForward(), MoveObjects(), PasteFromClipboard(), PlaceObjectAt(), ResizeObjects(), SendToBack(), SendToFront(), UpdateObjectsId(), UpdateObjectsLayer(), and UpdateObjectsSize().

|
private |
Definition at line 194 of file tile_object_handler.h.
Referenced by BeginPlacement(), CancelPlacement(), DrawGhostPreview(), HandleClick(), IsPlacementActive(), and SetPreviewObject().
|
private |
Definition at line 195 of file tile_object_handler.h.
Referenced by clear_placement_blocked(), placement_block_reason(), PlaceObjectAt(), and was_placement_blocked().
|
private |
Definition at line 196 of file tile_object_handler.h.
Referenced by DrawGhostPreview(), HandleClick(), RenderGhostPreviewBitmap(), and SetPreviewObject().
|
private |
Definition at line 197 of file tile_object_handler.h.
Referenced by DrawGhostPreview(), ghost_preview_buffer_for_testing(), and RenderGhostPreviewBitmap().
|
private |
Definition at line 198 of file tile_object_handler.h.
Referenced by DrawGhostPreview(), and RenderGhostPreviewBitmap().
|
private |
Definition at line 199 of file tile_object_handler.h.
Referenced by RenderGhostPreviewBitmap().
|
private |
Definition at line 202 of file tile_object_handler.h.
Referenced by ClearClipboard(), CopyObjectsToClipboard(), HasClipboardData(), PasteFromClipboard(), and PasteFromClipboardAt().
|
private |
Definition at line 207 of file tile_object_handler.h.
Referenced by DrawSelectionHighlight(), HandleDrag(), HandleRelease(), and InitDrag().
|
private |
Definition at line 208 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 209 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 210 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 211 of file tile_object_handler.h.
Referenced by HandleDrag(), and InitDrag().
|
private |
Definition at line 212 of file tile_object_handler.h.
Referenced by HandleRelease(), and InitDrag().
|
private |
Definition at line 213 of file tile_object_handler.h.
Referenced by HandleDrag(), HandleRelease(), and InitDrag().