maxPoints

This commit is contained in:
2026-04-13 08:43:30 +03:00
parent 36bd33b1f9
commit c69070fdc8
10 changed files with 31 additions and 9 deletions
+14 -2
View File
@@ -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;