swith to the end

This commit is contained in:
2026-04-03 17:45:20 +03:00
parent 70f0b7c780
commit 6c71f56189
5 changed files with 17 additions and 6 deletions
+3 -1
View File
@@ -24,6 +24,9 @@ export default {
mode: 'GamePlay'
});
manager = await new GameManager(engine, this.id);
manager.addEventListener('the-end', _=>{
this.$router.push('/');
})
window.addEventListener('resize', this.resize);
manager.loadScene(manager.scenarioData.scenes[0].data.id)
},
@@ -39,7 +42,6 @@ export default {
},
methods:{
targetClick(e){
engine.onClick(e, this.$refs.target);
},
@@ -31,7 +31,9 @@ export default {
},
computed:{
scenes(){
return this.modelValue.__root.scenes.map(s=>({title: s.data.title, value: s.data.id}))
let sc = this.modelValue.__root.scenes.map(s=>({title: s.data.title, value: s.data.id}))
sc.push({title: `-- ${this.l.end} --`, value: '__end__'});
return sc;
},
},
methods:{
+1 -1
View File
@@ -9,7 +9,7 @@
<g @mousedown="$emit('target', {target:vd, attrs:['x1', 'y1'], delta: true})" :class="{gameObject: true, selected}"
v-show="showInView">
<line :x1="vd.x1" :y1="vd.y1" :x2="parent.vd.x1" :y2="parent.vd.y1"></line>
<svg-icon :src="`/asset/thumb/${modelValue.go||0}.webp`" :x="vd.x1" :y="vd.y1" :size="37"></svg-icon>
<svg-icon :src="`/asset/thumb/${modelValue.go||modelValue.type}.webp`" :x="vd.x1" :y="vd.y1" :size="37"></svg-icon>
<text :x="vd.x1" :y="vd.y1" dy="58">{{ modelValue.title }}</text>
<image v-if="modelValue.go" href="/static/svg/play-circle.svg" width="20" class="cursor-pointer"
:x="vd.x1 + 37 - 10" :y="vd.y1 + 37 - 10" @click="$emit('preview', modelValue.go)">