Elevator exposes four finish slots — cab / doors / shaft / glass (glass only when shaft or door style is glass) — on node.slots. The finish materials now resolve through a per-node material set (context provider) keyed on node.slots + scene materials: textures-off joinery role -> node.slots ref -> declared default (cab preset-softwhite, doors metal-steel, shaft preset-lightgrey, glass preset-glass), with glass transparency flags re-applied. Cab/door/shaft/ glass meshes tag userData.slotId; buttons, indicators, control panels, and queue strips stay untagged (functional UI, not paintable). Interaction system untouched. Monochrome unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import {
|
|
type ElevatorNode,
|
|
getResolvedElevatorDoorPanelStyle,
|
|
getResolvedElevatorShaftStyle,
|
|
type SlotDeclaration,
|
|
} from '@pascal-app/core'
|
|
|
|
export type ElevatorSlotId = 'cab' | 'doors' | 'shaft' | 'glass'
|
|
|
|
export const ELEVATOR_CAB_SLOT_DEFAULT = 'library:preset-softwhite'
|
|
export const ELEVATOR_DOORS_SLOT_DEFAULT = 'library:metal-steel'
|
|
export const ELEVATOR_SHAFT_SLOT_DEFAULT = 'library:preset-lightgrey'
|
|
export const ELEVATOR_GLASS_SLOT_DEFAULT = 'library:preset-glass'
|
|
|
|
export function elevatorSlots(node: ElevatorNode): SlotDeclaration[] {
|
|
const slots: SlotDeclaration[] = [
|
|
{ slotId: 'cab', label: 'Cab', default: ELEVATOR_CAB_SLOT_DEFAULT },
|
|
{ slotId: 'doors', label: 'Doors', default: ELEVATOR_DOORS_SLOT_DEFAULT },
|
|
{ slotId: 'shaft', label: 'Shaft', default: ELEVATOR_SHAFT_SLOT_DEFAULT },
|
|
]
|
|
|
|
const hasGlass =
|
|
getResolvedElevatorShaftStyle(node.shaftStyle) === 'glass' ||
|
|
getResolvedElevatorDoorPanelStyle(node.doorPanelStyle) === 'glass-frame'
|
|
|
|
if (hasGlass) slots.push({ slotId: 'glass', label: 'Glass', default: ELEVATOR_GLASS_SLOT_DEFAULT })
|
|
|
|
return slots
|
|
}
|