mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-05 22:14:10 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -10,11 +10,27 @@ export const wallClock = defineObject({
|
|||||||
id: 'wallClock',
|
id: 'wallClock',
|
||||||
name: 'Wall Clock',
|
name: 'Wall Clock',
|
||||||
options: {
|
options: {
|
||||||
schema: {},
|
schema: {
|
||||||
default: {},
|
frameColor: {
|
||||||
|
type: 'color',
|
||||||
|
label: 'Frame color',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: {
|
||||||
|
frameColor: [0.71, 0.58, 0.39],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
placement: 'side',
|
placement: 'side',
|
||||||
createInstance: ({ room, root }) => {
|
createInstance: ({ room, root, options, findMaterial }) => {
|
||||||
|
const frameMaterial = findMaterial('__X_FRAME__');
|
||||||
|
|
||||||
|
const applyFrameColor = () => {
|
||||||
|
const [r, g, b] = options.frameColor;
|
||||||
|
frameMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||||
|
};
|
||||||
|
|
||||||
|
applyFrameColor();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onInited: () => {
|
onInited: () => {
|
||||||
const hourHand = root.getChildMeshes().find(m => m.name === 'HandH') as BABYLON.Mesh;
|
const hourHand = root.getChildMeshes().find(m => m.name === 'HandH') as BABYLON.Mesh;
|
||||||
@@ -29,6 +45,9 @@ export const wallClock = defineObject({
|
|||||||
minuteHand.rotation = new BABYLON.Vector3(0, 0, mAngle);
|
minuteHand.rotation = new BABYLON.Vector3(0, 0, mAngle);
|
||||||
}, 1000));
|
}, 1000));
|
||||||
},
|
},
|
||||||
|
onOptionsUpdated: ([k, v]) => {
|
||||||
|
applyFrameColor();
|
||||||
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user