1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-10 15:24:04 +02:00
This commit is contained in:
syuilo
2026-04-19 20:23:07 +09:00
parent e402057d3b
commit c2428ca3cc
5 changed files with 20 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ export const tabletopDigitalClock = defineObject({
},
placement: 'top',
hasCollisions: false,
createInstance: ({ root, room, options, model, scene }) => {
createInstance: ({ root, room, options, model, scene, timer }) => {
const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0, cm(3), cm(1)), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null);
light.parent = root;
light.intensity = 0.01 * WORLD_SCALE * WORLD_SCALE;
@@ -100,7 +100,8 @@ export const tabletopDigitalClock = defineObject({
applyBodyColor();
applyLcdColor();
room.timer.setInterval(() => {
// TODO: 家具が撤去された後も呼ばれ続けるのをどうにかする
timer.setInterval(() => {
const onMeshes = get7segMeshesOfCurrentTime(segmentMeshes);
for (const mesh of Object.values(segmentMeshes)) {

View File

@@ -22,7 +22,7 @@ export const wallClock = defineObject({
},
placement: 'side',
hasCollisions: false,
createInstance: ({ room, root, options, model }) => {
createInstance: ({ room, timer, options, model }) => {
const hourHand = model.findMesh('HandH');
const minuteHand = model.findMesh('HandM');
@@ -39,7 +39,8 @@ export const wallClock = defineObject({
return {
onInited: () => {
room.timer.setInterval(() => {
// TODO: 家具が撤去された後も呼ばれ続けるのをどうにかする
timer.setInterval(() => {
const now = new Date();
const hours = now.getHours() % 12;
const minutes = now.getMinutes();