fix: show furniture-occupied tiles in the floor plan editor

The editor never requested occupied tiles, so tiles holding furniture
were indistinguishable from empty floor and could be edited/voided.

- request GetOccupiedTilesMessageComposer when the editor opens
- handle RoomOccupiedTilesMessageEvent -> SET_OCCUPIED_TILES
- new Tile.occupied flag (kept separate from `blocked`/void): occupied
  tiles render with a distinct marker and are protected from PAINT/
  ERASE/ADJUST and brush-to-selection edits
- occupied is purely informational and never changes the saved tilemap
  (no accidental voiding of floor under furni)

Tests: reducer cases for SET_OCCUPIED_TILES + edit protection; container
test asserts the occupied event is non-destructive on save; route the
canvas pointer test through elementFromPoint (jsdom has no getScreenCTM).
This commit is contained in:
medievalshell
2026-05-28 09:20:20 +02:00
parent 7a65e5bf6d
commit 48ed3ad7ba
7 changed files with 87 additions and 7 deletions
@@ -104,6 +104,17 @@ const FloorplanTileImpl: FC<Props> = ({ row, col, tile, selected, isDoor, southH
stroke="#222"
strokeWidth={ 0.5 }
/>
{ tile.occupied && (
<polygon
data-testid="occupied-marker"
points={ points }
fill="rgba(249, 115, 22, 0.40)"
stroke="#f97316"
strokeWidth={ 1 }
strokeDasharray="2 2"
pointerEvents="none"
/>
) }
{ selected && (
<polygon
data-testid="selection-ring"