This commit is contained in:
2026-02-09 21:48:47 +02:00
parent fc2fc3a907
commit ca67773650
6 changed files with 20 additions and 10 deletions
@@ -85,6 +85,12 @@ export default {
}
},
watch:{
async 'object.scenario'(n){
await this.loadScenario()
},
},
methods:{
}
+1
View File
@@ -27,6 +27,7 @@ export default {
},
watch:{
scenario(n){
this.debug('Scenario changed', n);
if (n){
this.scenesList = [this.scenes?.[0]];
}
+4 -6
View File
@@ -73,9 +73,6 @@ export default {
mode(n){
engine.transformControls.setMode(n)
},
async 'object.scenario'(n){
await this.loadScenario()
},
currentObject(n){
if (this.env == 'GameDesigner'){
engine.transformControls.attach(n.__o);
@@ -124,6 +121,7 @@ export default {
* @param target Target scene definition from Game Module
*/
async loadEnvironment(scene, target){
this.debug('loading environment');
engine.tm?.setGame(this.object?.id);
//await engine.loadPanorama(`/asset/default/43.webp`);
let intro;
@@ -160,7 +158,7 @@ export default {
if (this.env != 'GameDesigner'){
env.scene.traverse(o=>{
if (o.name.startsWith('land') || o.name == 'Sphere'){
console.log('Fixing ground. TODO!!!')
this.debug('Fixing ground. TODO!!!')
engine.physics.add(o, 'fixed', true, undefined, 'mesh', { root: env.scene})
}
})
@@ -217,7 +215,7 @@ export default {
});
if (finished == expectToFinish){
//GO TO NEXT LEVEL
console.log('LEVEL FINISHED')
this.debug('LEVEL FINISHED')
}
engine.tm?.setGameObject(null);
});
@@ -301,7 +299,7 @@ export default {
},
resize(){
let r = this.$refs.target;
console.log('resizing!!', r.clientWidth, r.clientHeight, r)
this.debug('resizing!!', r.clientWidth, r.clientHeight, r)
engine.resize(r.clientWidth, r.clientHeight);
//this.zoom = Math.min(r.clientWidth / this.viewBox.w, r.clientHeight / this.viewBox.h);
},
+5
View File
@@ -51,6 +51,11 @@ export default {
this.store.snackbar.color = color;
this.store.snackbar.timeout = timeout;
this.store.snackbar.show = true;
},
debug(...args){
if (this.store?.prefs?.debug){
console.log(...args);
}
}
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
<template>
<v-container max-width="1400">
<GamePreview v-model="object"></GamePreview>
<GamePreview v-model="object" v-if="object"></GamePreview>
</v-container>
</template>
@@ -9,7 +9,7 @@
export default {
data() {
return {
object: {},
object: null,
valid: false,
rules: {
required: v => v ? true : this.l.fieldRequired,
+2 -2
View File
@@ -1,6 +1,6 @@
<template>
<v-container max-width="1400">
<GamePlay v-model="object"></GamePlay>
<GamePlay v-model="object" v-if="object"></GamePlay>
</v-container>
</template>
@@ -9,7 +9,7 @@
export default {
data() {
return {
object: {},
object: null,
valid: false,
rules: {
required: v => v ? true : this.l.fieldRequired,