// Decor tokens ("props"): drawn from above, purely visual. Built-in ones are SVG (id "b:"), own uploads are images (id "c:"). // w / h are the default size in grid squares. const wood = '#8a5a2b', dark = '#5b3a18', light = '#b98545', metal = '#8d949b', stone = '#7d7f84', green = '#3f7d3a' export const BUILTIN = [ { id: 'chest', name: 'Chest', w: 1, h: 0.7, art: <> }, { id: 'barrel', name: 'Barrel', w: 1, h: 1, art: <> }, { id: 'crate', name: 'Crate', w: 1, h: 1, art: <> }, { id: 'table', name: 'Table', w: 2, h: 1, art: <> }, { id: 'roundtable', name: 'Round table', w: 2, h: 2, art: <> }, { id: 'chair', name: 'Chair', w: 0.6, h: 0.6, art: <> }, { id: 'bed', name: 'Bed', w: 1, h: 2, art: <> }, { id: 'door', name: 'Door (decor)', w: 1, h: 0.25, art: <> }, { id: 'campfire', name: 'Campfire', w: 1, h: 1, art: <> }, { id: 'torch', name: 'Torch', w: 0.5, h: 0.5, art: <> }, { id: 'tree', name: 'Tree', w: 3, h: 3, art: <> }, { id: 'bush', name: 'Bush', w: 1.2, h: 1.2, art: <> }, { id: 'rock', name: 'Rock', w: 1.2, h: 1, art: }, { id: 'rug', name: 'Rug', w: 3, h: 2, art: <> }, { id: 'stairs', name: 'Stairs', w: 1, h: 2, art: <>{[18, 33, 48, 63, 78].map((y) => )} }, { id: 'pillar', name: 'Pillar', w: 1, h: 1, art: <> }, { id: 'altar', name: 'Altar', w: 2, h: 1, art: <> }, { id: 'bones', name: 'Bones', w: 1, h: 1, art: <> }, { id: 'cart', name: 'Wreck / cart', w: 2, h: 1, art: <> }, ] const byId = Object.fromEntries(BUILTIN.map((p) => [p.id, p])) export const isCustom = (id) => typeof id === 'string' && id.startsWith('c:') export const builtin = (id) => byId[String(id).replace(/^b:/, '')] // Picture of a prop filling its box. customSrc(id) gives the image URL for own uploads. export function PropArt({ prop, customSrc }) { if (isCustom(prop)) return const b = builtin(prop) return }