This commit is contained in:
syuilo
2026-02-19 19:44:08 +09:00
parent 679c75006a
commit dadc5295fa
3 changed files with 8 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div v-if="engine != null && engine.isEditMode.value && engine.selected.value != null" class="_panel" :class="$style.overlayObjectInfoPanel">
{{ engine.selected.value.objectId }}
{{ engine.selected.value.objectDef.name }}
</div>
</div>

View File

@@ -82,6 +82,7 @@ type GetOptionsSchemaValues<T extends OptionsSchema> = {
type ObjectDef<OpSc extends OptionsSchema> = {
id: string;
name: string;
options: {
schema: OpSc;
default: GetOptionsSchemaValues<OpSc>;
@@ -174,6 +175,8 @@ export class RoomEngine {
objectId: string;
objectMesh: BABYLON.Mesh;
objectInstance: RoomObjectInstance<any>;
objectState: RoomStateObject<any>;
objectDef: ObjectDef<any>;
} | null>(null);
private time: 0 | 1 | 2 = 0; // 0: 昼, 1: 夕, 2: 夜
private roomCollisionMeshes: BABYLON.AbstractMesh[] = [];
@@ -544,10 +547,13 @@ export class RoomEngine {
for (const om of mesh.getChildMeshes()) {
om.renderOutline = true;
}
const state = this.roomState.installedObjects.find(o => o.id === objectId)!;
this.selected.value = {
objectId,
objectMesh: mesh,
objectInstance: this.objectInstances.get(objectId)!,
objectState: state,
objectDef: getObjectDef(state.type),
};
}
}

View File

@@ -9,6 +9,7 @@ import { get7segMeshesOfCurrentTime } from '../utility.js';
export const tabletopDigitalClock = defineObject({
id: 'tabletopDigitalClock',
name: 'Tabletop Digital Clock',
options: {
schema: {
bodyStyle: {