1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-04 00:44:22 +02:00
This commit is contained in:
syuilo
2026-02-19 19:09:00 +09:00
parent 376bb328df
commit d01b3036d6
2 changed files with 20 additions and 16 deletions

View File

@@ -82,8 +82,10 @@ type GetOptionsSchemaValues<T extends OptionsSchema> = {
type ObjectDef<OpSc extends OptionsSchema> = { type ObjectDef<OpSc extends OptionsSchema> = {
id: string; id: string;
optionsSchema: OpSc; options: {
defaultOptions: GetOptionsSchemaValues<OpSc>; schema: OpSc;
default: GetOptionsSchemaValues<OpSc>;
};
placement: 'top' | 'side' | 'bottom' | 'wall' | 'ceiling' | 'floor'; placement: 'top' | 'side' | 'bottom' | 'wall' | 'ceiling' | 'floor';
isChair?: boolean; isChair?: boolean;
createInstance: (args: { createInstance: (args: {
@@ -1097,7 +1099,7 @@ export class RoomEngine {
type, type,
position: new BABYLON.Vector3(0, 0, 0), position: new BABYLON.Vector3(0, 0, 0),
rotation: new BABYLON.Vector3(0, Math.PI, 0), rotation: new BABYLON.Vector3(0, Math.PI, 0),
options: def.defaultOptions, options: def.options.default,
}); });
const ghost = this.createGhost(root); const ghost = this.createGhost(root);
@@ -1145,7 +1147,7 @@ export class RoomEngine {
position: [pos.x, pos.y, pos.z], position: [pos.x, pos.y, pos.z],
rotation: [rotation.x, rotation.y, rotation.z], rotation: [rotation.x, rotation.y, rotation.z],
sticky, sticky,
options: def.defaultOptions, options: def.options.default,
}); });
}, },
}; };

View File

@@ -9,7 +9,8 @@ import { get7segMeshesOfCurrentTime } from '../utility.js';
export const tabletopDigitalClock = defineObject({ export const tabletopDigitalClock = defineObject({
id: 'tabletopDigitalClock', id: 'tabletopDigitalClock',
optionsSchema: { options: {
schema: {
bodyStyle: { bodyStyle: {
type: 'select', type: 'select',
label: 'Body Style', label: 'Body Style',
@@ -20,10 +21,11 @@ export const tabletopDigitalClock = defineObject({
label: 'Body Color', label: 'Body Color',
}, },
}, },
defaultOptions: { default: {
bodyStyle: 'color', bodyStyle: 'color',
bodyColor: [0.45, 0.8, 0], bodyColor: [0.45, 0.8, 0],
}, },
},
placement: 'top', placement: 'top',
createInstance: ({ room, options, root }) => { createInstance: ({ room, options, root }) => {
return { return {