maxPoints
This commit is contained in:
@@ -30,6 +30,7 @@ export default {
|
||||
this.modelValue.title = e.name
|
||||
this.modelValue.exclude = true
|
||||
}
|
||||
}
|
||||
},
|
||||
__noPoints: true
|
||||
}
|
||||
</script>
|
||||
@@ -5,6 +5,9 @@ class GenericObject extends EventManager{
|
||||
#actions = [];
|
||||
constructor(engine, data){
|
||||
super();
|
||||
if (!data.description || data.exclude){
|
||||
this.maxPoints = 0;
|
||||
}
|
||||
return new Promise(async(resolve, reject)=>{
|
||||
this.source = await engine.load(data.$go.asset.name);
|
||||
this.object = engine.meshUtils.bottomOrigin(this.source.scene)
|
||||
|
||||
@@ -44,6 +44,8 @@ class ImageObject extends EventManager{
|
||||
textScrolledCallback: ()=>{ this.dispatchEvent({type:'finish'}); }
|
||||
})
|
||||
})
|
||||
}else{
|
||||
this.maxPoints = 0
|
||||
}
|
||||
|
||||
resolve(this)
|
||||
|
||||
@@ -77,6 +77,7 @@ class InteractiveObject extends EventManager{
|
||||
engine.tm?.setGameObject(obj.id);
|
||||
})
|
||||
}
|
||||
['minPoints', 'maxPoints'].filter(p=>this.io[p] !== undefined).forEach(p=> this[p] = this.io[p] )
|
||||
break;
|
||||
}
|
||||
if (obj.shouldBeLocked){
|
||||
|
||||
@@ -43,6 +43,7 @@ export default {
|
||||
this.modelValue.h = 50;
|
||||
this.modelValue.exclude = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
__noPoints: true
|
||||
}
|
||||
</script>
|
||||
@@ -46,7 +46,8 @@ export default {
|
||||
return data.__root.scenes.find(s=>s.data.id == data.switchScene).data.environment;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
__noPoints: true
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -17,6 +17,7 @@ export default {
|
||||
modelValue: Object
|
||||
},
|
||||
methods:{
|
||||
}
|
||||
},
|
||||
__noPoints: true
|
||||
}
|
||||
</script>
|
||||
@@ -21,6 +21,7 @@ export default {
|
||||
modelValue: Object
|
||||
},
|
||||
methods:{
|
||||
}
|
||||
},
|
||||
__noPoints: true
|
||||
}
|
||||
</script>
|
||||
@@ -27,7 +27,7 @@
|
||||
<v-form class="pt-4">
|
||||
<v-text-field density="compact" :label="l.name" v-model="modelValue.title"></v-text-field>
|
||||
<!-- <v-text-field density="compact" :label="l.id" v-model="modelValue.id"></v-text-field> -->
|
||||
<v-number-input density="compact" :label="l.completionPoints" v-model="modelValue.points"></v-number-input>
|
||||
<v-number-input density="compact" v-if="!cpc[modelValue.type].__noPoints" :label="l.completionPoints" v-model="modelValue.points"></v-number-input>
|
||||
</v-form>
|
||||
<div v-if="selected && modelValue.type">
|
||||
<component :is="modelValue.type" v-model="mv"></component>
|
||||
@@ -69,6 +69,8 @@ const components = {
|
||||
PuzzleGame1, PuzzleGame2, MazeQuizGame, Particles, ClassicPuzzle, PairMatchingGame, SingleQuestion, Teleporter
|
||||
};
|
||||
|
||||
import { markRaw } from 'vue';
|
||||
|
||||
export default {
|
||||
emits:['target', 'preview'],
|
||||
props:{
|
||||
@@ -80,14 +82,15 @@ export default {
|
||||
visible: Boolean,
|
||||
parent: Object
|
||||
},
|
||||
components,
|
||||
data(){
|
||||
return {
|
||||
InteractiveObjectTypes,
|
||||
active: false,
|
||||
activationTypes: ['unlock', 'appear'],
|
||||
cpc: markRaw(components)
|
||||
}
|
||||
},
|
||||
components,
|
||||
mounted(){
|
||||
this.active = true;
|
||||
this.modelValue.points ??= 10;
|
||||
@@ -98,6 +101,15 @@ export default {
|
||||
components[this.modelValue.type].__transform(this.modelValue)
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'modelValue.type'(n){
|
||||
if (components[this.modelValue.type].__noPoints){
|
||||
this.modelValue.points = 0;
|
||||
}else{
|
||||
this.modelValue.points = 10;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
showInView(){
|
||||
this.vd.__showInView = this.visible && this.parent.visible;
|
||||
|
||||
@@ -78,7 +78,6 @@ class MeshUtils {
|
||||
let group = new Group();
|
||||
group.userData.bbox = this.getBoundingBox(object);
|
||||
group.add(object);
|
||||
group.userData.object = object;
|
||||
group.isWrapper = true;
|
||||
return group;
|
||||
}
|
||||
@@ -92,7 +91,7 @@ class MeshUtils {
|
||||
|
||||
bottomOrigin(object){
|
||||
let group = this.centerOrigin(object);
|
||||
group.userData.object.position.y = -group.userData.bbox.min.y
|
||||
group.children[0].position.y = -group.userData.bbox.min.y
|
||||
return group;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user