mirror of
https://github.com/xmanrui/OpenClaw-bot-review.git
synced 2026-07-27 22:25:52 +00:00
feat(pixel-office): show temp-worker stools on seat and randomize subagent seating
This commit is contained in:
@@ -706,12 +706,13 @@ export class OfficeState {
|
||||
Math.abs(c - parentCol) + Math.abs(r - parentRow)
|
||||
|
||||
let bestSeatId: string | null = null
|
||||
for (const seatId of SUBAGENT_PRIORITY_SEAT_IDS) {
|
||||
const availablePrioritySeats = SUBAGENT_PRIORITY_SEAT_IDS.filter((seatId) => {
|
||||
const seat = this.seats.get(seatId)
|
||||
if (seat && !seat.assigned) {
|
||||
bestSeatId = seatId
|
||||
break
|
||||
}
|
||||
return !!seat && !seat.assigned
|
||||
})
|
||||
if (availablePrioritySeats.length > 0) {
|
||||
const randomIdx = Math.floor(Math.random() * availablePrioritySeats.length)
|
||||
bestSeatId = availablePrioritySeats[randomIdx]
|
||||
}
|
||||
if (!bestSeatId) {
|
||||
let bestDist = Infinity
|
||||
|
||||
@@ -236,6 +236,13 @@ export function renderScene(
|
||||
const laptopUpwardSpinRad = -Math.PI / 12
|
||||
const laptopTiltScaleY = Math.max(0.22, Math.abs(Math.cos(laptopXTiltRad)))
|
||||
const laptopTiltSkewX = -Math.sin(laptopXTiltRad) * 0.35
|
||||
const visibleSubagentStoolIds = new Set<string>()
|
||||
for (const ch of characters) {
|
||||
if (!ch.isSubagent || ch.state !== CharacterState.TYPE || !ch.seatId) continue
|
||||
if (!ch.seatId.startsWith('stool-r')) continue
|
||||
if (ch.matrixEffect === 'despawn') continue
|
||||
visibleSubagentStoolIds.add(ch.seatId)
|
||||
}
|
||||
|
||||
// Wall decorations as z-sorted drawables (zY just above row 0 walls so they render on top of walls but below characters)
|
||||
const wallDecoZY = TILE_SIZE + 0.5
|
||||
@@ -252,6 +259,9 @@ export function renderScene(
|
||||
|
||||
// Furniture
|
||||
for (const f of furniture) {
|
||||
if (f.uid?.startsWith('stool-r') && !visibleSubagentStoolIds.has(f.uid)) {
|
||||
continue
|
||||
}
|
||||
const fx = offsetX + f.x * zoom
|
||||
const fy = offsetY + f.y * zoom
|
||||
if (f.emoji) {
|
||||
|
||||
@@ -73,7 +73,16 @@ export function layoutToFurnitureInstances(furniture: PlacedFurniture[]): Furnit
|
||||
sprite = getColorizedSprite(`furn-${item.type}-${h}-${s}-${bv}-${cv}-${item.color.colorize ? 1 : 0}`, entry.sprite, item.color)
|
||||
}
|
||||
|
||||
instances.push({ sprite, x, y, zY, ...(entry.emoji ? { emoji: entry.emoji } : {}), ...(item.rotation ? { rotation: item.rotation } : {}), ...(entry.emojiScale ? { emojiScale: entry.emojiScale } : {}) })
|
||||
instances.push({
|
||||
uid: item.uid,
|
||||
sprite,
|
||||
x,
|
||||
y,
|
||||
zY,
|
||||
...(entry.emoji ? { emoji: entry.emoji } : {}),
|
||||
...(item.rotation ? { rotation: item.rotation } : {}),
|
||||
...(entry.emojiScale ? { emojiScale: entry.emojiScale } : {}),
|
||||
})
|
||||
}
|
||||
return instances
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ export interface Seat {
|
||||
}
|
||||
|
||||
export interface FurnitureInstance {
|
||||
uid?: string
|
||||
sprite: SpriteData
|
||||
/** Pixel x (top-left) */
|
||||
x: number
|
||||
|
||||
Reference in New Issue
Block a user