mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-06 13:24:12 +02:00
wip
This commit is contained in:
@@ -32,7 +32,7 @@ import { i18n } from '@/i18n.js';
|
|||||||
import { ensureSignin } from '@/i';
|
import { ensureSignin } from '@/i';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { RoomEngine } from '@/utility/room/engine.js';
|
import { RoomEngine } from '@/utility/room/engine.js';
|
||||||
import { getObjectDef } from '@/utility/room/object-defs.js';
|
import { getObjectDef, OBJECT_DEFS } from '@/utility/room/object-defs.js';
|
||||||
import MkSelect from '@/components/MkSelect.vue';
|
import MkSelect from '@/components/MkSelect.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
|
||||||
@@ -472,9 +472,15 @@ function toggleEditMode() {
|
|||||||
canvas.value!.focus();
|
canvas.value!.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addObject() {
|
function addObject(ev: PointerEvent) {
|
||||||
engine.value?.addObject('tabletopDigitalClock');
|
if (engine.value == null) return;
|
||||||
canvas.value!.focus();
|
os.popupMenu(OBJECT_DEFS.map(def => ({
|
||||||
|
text: def.id,
|
||||||
|
action: () => {
|
||||||
|
engine.value?.addObject(def.id);
|
||||||
|
canvas.value!.focus();
|
||||||
|
},
|
||||||
|
})), ev.currentTarget ?? ev.target);
|
||||||
}
|
}
|
||||||
|
|
||||||
definePage(() => ({
|
definePage(() => ({
|
||||||
|
|||||||
@@ -14,40 +14,40 @@ export const tabletopDigitalClock = defineObject({
|
|||||||
createInstance: ({ room, root }) => {
|
createInstance: ({ room, root }) => {
|
||||||
return {
|
return {
|
||||||
onInited: () => {
|
onInited: () => {
|
||||||
|
const meshes = {
|
||||||
|
'1a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1A__')),
|
||||||
|
'1b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1B__')),
|
||||||
|
'1c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1C__')),
|
||||||
|
'1d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1D__')),
|
||||||
|
'1e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1E__')),
|
||||||
|
'1f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1F__')),
|
||||||
|
'1g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1G__')),
|
||||||
|
'2a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2A__')),
|
||||||
|
'2b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2B__')),
|
||||||
|
'2c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2C__')),
|
||||||
|
'2d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2D__')),
|
||||||
|
'2e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2E__')),
|
||||||
|
'2f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2F__')),
|
||||||
|
'2g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2G__')),
|
||||||
|
'3a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3A__')),
|
||||||
|
'3b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3B__')),
|
||||||
|
'3c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3C__')),
|
||||||
|
'3d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3D__')),
|
||||||
|
'3e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3E__')),
|
||||||
|
'3f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3F__')),
|
||||||
|
'3g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3G__')),
|
||||||
|
'4a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4A__')),
|
||||||
|
'4b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4B__')),
|
||||||
|
'4c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4C__')),
|
||||||
|
'4d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4D__')),
|
||||||
|
'4e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4E__')),
|
||||||
|
'4f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4F__')),
|
||||||
|
'4g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4G__')),
|
||||||
|
};
|
||||||
|
|
||||||
|
const colonMeshes = root.getChildMeshes().filter(m => m.name.includes('__TIME_7SEG_COLON__'));
|
||||||
|
|
||||||
room.intervalIds.push(window.setInterval(() => {
|
room.intervalIds.push(window.setInterval(() => {
|
||||||
const meshes = {
|
|
||||||
'1a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1A__')),
|
|
||||||
'1b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1B__')),
|
|
||||||
'1c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1C__')),
|
|
||||||
'1d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1D__')),
|
|
||||||
'1e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1E__')),
|
|
||||||
'1f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1F__')),
|
|
||||||
'1g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_1G__')),
|
|
||||||
'2a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2A__')),
|
|
||||||
'2b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2B__')),
|
|
||||||
'2c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2C__')),
|
|
||||||
'2d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2D__')),
|
|
||||||
'2e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2E__')),
|
|
||||||
'2f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2F__')),
|
|
||||||
'2g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_2G__')),
|
|
||||||
'3a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3A__')),
|
|
||||||
'3b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3B__')),
|
|
||||||
'3c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3C__')),
|
|
||||||
'3d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3D__')),
|
|
||||||
'3e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3E__')),
|
|
||||||
'3f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3F__')),
|
|
||||||
'3g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_3G__')),
|
|
||||||
'4a': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4A__')),
|
|
||||||
'4b': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4B__')),
|
|
||||||
'4c': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4C__')),
|
|
||||||
'4d': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4D__')),
|
|
||||||
'4e': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4E__')),
|
|
||||||
'4f': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4F__')),
|
|
||||||
'4g': root.getChildMeshes().find(m => m.name.includes('__TIME_7SEG_4G__')),
|
|
||||||
};
|
|
||||||
|
|
||||||
const colonMeshes = root.getChildMeshes().filter(m => m.name.includes('__TIME_7SEG_COLON__'));
|
|
||||||
|
|
||||||
const onMeshes = get7segMeshesOfCurrentTime(meshes);
|
const onMeshes = get7segMeshesOfCurrentTime(meshes);
|
||||||
|
|
||||||
for (const mesh of Object.values(meshes)) {
|
for (const mesh of Object.values(meshes)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user