This commit is contained in:
@@ -35,8 +35,10 @@ class GenericObject extends EventManager{
|
||||
}
|
||||
}
|
||||
if (data.description){
|
||||
engine.dashboard.updateText(this.object.__onhud ? data.description : '', false, (d)=>{
|
||||
d && this.dispatchEvent({type:'finish'})
|
||||
engine.dashboard.updateText(this.object.__onhud ? data.description : '', {
|
||||
textScrolledCallback: (d)=>{
|
||||
d && this.dispatchEvent({type:'finish'})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { EventManager } from "@/lib/EventManager";
|
||||
import { MeshStandardMaterial, MeshBasicMaterial, PlaneGeometry, Mesh, DoubleSide, Vector3 } from "three";
|
||||
|
||||
class ImageObject {
|
||||
class ImageObject extends EventManager{
|
||||
constructor(engine, obj) {
|
||||
super();
|
||||
return new Promise(async(resolve, reject)=>{
|
||||
if (obj.$go){
|
||||
obj.path = engine.assetPath;
|
||||
@@ -32,6 +34,12 @@ class ImageObject {
|
||||
}
|
||||
this.object = new Mesh(geo, mp.metalness ? new MeshStandardMaterial(mp) : new MeshBasicMaterial(mp));
|
||||
|
||||
if (obj.description) {
|
||||
engine.clickable.add(this.object, ()=>{
|
||||
engine.dashboard.updateText(obj.description, {hideOnFinish: true})
|
||||
})
|
||||
}
|
||||
|
||||
resolve(this)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div v-if="modelValue.go">
|
||||
<v-img :src="`/asset/thumb/${modelValue.go}.webp`" />
|
||||
<div class="text-caption text-center">{{ modelValue.title }}</div>
|
||||
<v-textarea :label="l.description" v-model="modelValue.description"></v-textarea>
|
||||
</div>
|
||||
<asset-selector @select="assignTexture" :type="['Texture']">
|
||||
<template v-slot:activator="props">
|
||||
|
||||
@@ -68,7 +68,7 @@ class InteractiveObject extends EventManager{
|
||||
//process first interaction
|
||||
this.io.once('interaction', ()=>{
|
||||
if (obj.introText){
|
||||
engine.dashboard.updateText(obj.introText, true)
|
||||
engine.dashboard.updateText(obj.introText, {hideOnFinish: true});
|
||||
}
|
||||
})
|
||||
this.io.addEventListener('interaction', ()=>{
|
||||
|
||||
@@ -46,6 +46,13 @@ class VideoPlayer extends EventManager {
|
||||
if (data.immersive || 1){
|
||||
engine.immersive(true);
|
||||
}
|
||||
if (data.description) {
|
||||
engine.dashboard.updateText(data.description, {
|
||||
hideOnFinish: true,
|
||||
startFrom: vi.currentTime / vi.duration,
|
||||
duration: vi.duration
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const onPause = ()=>{
|
||||
@@ -57,6 +64,9 @@ class VideoPlayer extends EventManager {
|
||||
if (data.immersive || 1){
|
||||
engine.immersive(false);
|
||||
}
|
||||
if (data.description) {
|
||||
engine.dashboard.updateText('')
|
||||
}
|
||||
}
|
||||
|
||||
vi.addEventListener('play', onPlay);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<v-img :src="`/asset/thumb/${modelValue.go}.webp`" />
|
||||
<div class="text-caption text-center">{{ modelValue.title }}</div>
|
||||
<v-checkbox density="compact" v-model="modelValue.playInHud" hide-details :label="l.viewInHUD"></v-checkbox>
|
||||
<v-textarea :label="l.description" v-model="modelValue.description"></v-textarea>
|
||||
</div>
|
||||
<asset-selector @select="assignVideoObject" :type="['Video']">
|
||||
<template v-slot:activator="props">
|
||||
|
||||
Reference in New Issue
Block a user