This commit is contained in:
@@ -36,7 +36,7 @@ class GenericObject extends EventManager{
|
||||
}
|
||||
}
|
||||
if (data.description){
|
||||
engine.dashboard.updateText(this.object.__onhud ? data.description : '', (d)=>{
|
||||
engine.dashboard.updateText(this.object.__onhud ? data.description : '', false, (d)=>{
|
||||
d && this.dispatchEvent({type:'finish'})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -64,6 +64,13 @@ class InteractiveObject extends EventManager{
|
||||
// this.io.addEventListener?.(event, this.dispatchEvent.bind(this))
|
||||
// })
|
||||
this.io.forwardEvents?.(this);
|
||||
if (this.emits?.includes('interaction')){
|
||||
this.io.once('interaction', ()=>{
|
||||
if (obj.introText){
|
||||
engine.dashboard.updateText(obj.introText, true)
|
||||
}
|
||||
})
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (obj.shouldBeLocked){
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EventManager } from '@/lib/EventManager';
|
||||
import Utils from '@/lib/Utils';
|
||||
|
||||
class PairMatchingGame extends EventManager {
|
||||
emits = ['finish']
|
||||
emits = ['finish', 'interaction']
|
||||
constructor(engine, data) {
|
||||
super();
|
||||
return new Promise(async (resolve, reject)=>{
|
||||
@@ -76,6 +76,7 @@ class PairMatchingGame extends EventManager {
|
||||
let actionDef = {material:{emissiveIntensity:k=>(1+Math.sin((k*2+1.5)*Math.PI))*4 }};
|
||||
|
||||
let clickFn = (i) => {
|
||||
this.dispatchEvent({type:'interaction'});
|
||||
let oc = clicked;
|
||||
if (done.includes(i.object.userData.gd.id)) return;
|
||||
clicked = i.object;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div v-if="modelValue.go">
|
||||
<v-number-input density="compact" label="Number of elements" v-model="modelValue.c"></v-number-input>
|
||||
<v-textarea :label="l.description" v-model="modelValue.introText" class="mt-3"></v-textarea>
|
||||
<v-img :src="`/asset/thumb/${modelValue.go}.webp`" />
|
||||
<div class="text-caption text-center">{{ modelValue.title }}</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user