diff --git a/packages/frontend/src/pages/room.vue b/packages/frontend/src/pages/room.vue index 802ada2204..38614cc002 100644 --- a/packages/frontend/src/pages/room.vue +++ b/packages/frontend/src/pages/room.vue @@ -204,8 +204,70 @@ function onWheel(ev: WheelEvent) { } } -const data = localStorage.getItem('roomData') != null ? JSON.parse(localStorage.getItem('roomData')!) : { - roomType: 'default', +const data = localStorage.getItem('roomData') != null ? { ...JSON.parse(localStorage.getItem('roomData')!), ...{ + heya: { + type: 'simple', + options: { + dimension: [300, 300], + window: 'demado', + wallN: { + material: null, + color: [0.9, 0.9, 0.9], + }, + wallE: { + material: null, + color: [0.9, 0.9, 0.9], + }, + wallS: { + material: null, + color: [0.9, 0.9, 0.9], + }, + wallW: { + material: null, + color: [0.9, 0.9, 0.9], + }, + flooring: { + material: 'wood', + color: [0.9, 0.9, 0.9], + }, + ceiling: { + material: null, + color: [0.9, 0.9, 0.9], + }, + }, + }, +} } : { + heya: { + type: 'simple', + options: { + dimension: [300, 300], + window: 'demado', + wallN: { + material: null, + color: [0.9, 0.9, 0.9], + }, + wallE: { + material: null, + color: [0.9, 0.9, 0.9], + }, + wallS: { + material: null, + color: [0.9, 0.9, 0.9], + }, + wallW: { + material: null, + color: [0.9, 0.9, 0.9], + }, + flooring: { + material: 'wood', + color: [0.9, 0.9, 0.9], + }, + ceiling: { + material: null, + color: [0.9, 0.9, 0.9], + }, + }, + }, installedObjects: [{ id: 'a', type: 'cardboardBox', diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index 49f9c720b2..2e68aae1a3 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -56,7 +56,7 @@ type SimpleHeyaWallBase = { type Heya = { type: 'simple'; options: { - size: [number, number]; + dimension: [number, number]; window: 'none' | 'kosidakamado' | 'demado' | 'hakidasimado'; wallN: SimpleHeyaWallBase; wallE: SimpleHeyaWallBase; @@ -542,7 +542,7 @@ export class RoomEngine { } public async init() { - await this.loadRoomModel(this.roomState.roomType); + await this.loadRoomModel(this.roomState.heya.type); await this.loadEnvModel(); await Promise.all(this.roomState.installedObjects.map(o => this.loadObject({ id: o.id,