loop bug fix

This commit is contained in:
Bachir Soussi Chiadmi 2024-06-03 13:06:25 +02:00
parent 16f0e0818c
commit 883e7b5896

View File

@ -68,6 +68,7 @@ export default {
// //
doleance_transition: false, doleance_transition: false,
// //
paperContentsIsSet: false,
} }
}, },
@ -217,7 +218,7 @@ export default {
// if map_item is open and we change the mad mode, redefined what is displayed in the "boussole" // if map_item is open and we change the mad mode, redefined what is displayed in the "boussole"
if (this.is_open & n !== o) { if (this.is_open & n !== o) {
this.setPaperContents(); this.resetPaperContents();
this.resetMapItemPosition(); this.resetMapItemPosition();
this.resetMapItemScale(); this.resetMapItemScale();
} }
@ -843,34 +844,43 @@ export default {
console.log('setPaperContents'); console.log('setPaperContents');
// trigered once opening tween is complete // trigered once opening tween is complete
// trigered once mapmode changed // trigered once mapmode changed
this.clearPaperContents(); // triggerd when reseting papercontents
switch(this.map_mode){
case 'terraindevie': if (!this.paperContentsIsSet) {
this.addNewPaperSymbolInstance('boussole_bg', true); this.clearPaperContents();
this.paper_main_object.addChild(this.setPaperEntites()); switch(this.map_mode){
// this.setPaperEntitesEvents(); case 'terraindevie':
break; this.addNewPaperSymbolInstance('boussole_bg', true);
case 'superposition': this.paper_main_object.addChild(this.setPaperEntites());
this.addNewPaperSymbolInstance('boussole_bg', true); // this.setPaperEntitesEvents();
break; break;
case 'proximite': case 'superposition':
this.addNewPaperSymbolInstance('boussole_bg', true); this.addNewPaperSymbolInstance('boussole_bg', true);
this.paper_main_object.addChild(this.setPaperEntitesProximiteReferences()); break;
break; case 'proximite':
case 'puissancedagir': this.addNewPaperSymbolInstance('boussole_bg', true);
this.addNewPaperSymbolInstance('puissanceagir_bg', true); this.paper_main_object.addChild(this.setPaperEntitesProximiteReferences());
this.paper_main_object.addChild(this.setPaperPuissanceagirBesoins()); break;
break; case 'puissancedagir':
case 'action': this.addNewPaperSymbolInstance('puissanceagir_bg', true);
this.addNewPaperSymbolInstance('boussole_bg', true); this.paper_main_object.addChild(this.setPaperPuissanceagirBesoins());
this.paper_main_object.addChild(this.setPaperAgissantes()); break;
break; case 'action':
case 'doleancer': this.addNewPaperSymbolInstance('boussole_bg', true);
this.addNewPaperSymbolInstance('doleance_bg'); this.paper_main_object.addChild(this.setPaperAgissantes());
this.paper_main_object.addChild(this.setPaperDoleances()); break;
break; case 'doleancer':
this.addNewPaperSymbolInstance('doleance_bg');
this.paper_main_object.addChild(this.setPaperDoleances());
break;
}
this.paperContentsIsSet = true;
} }
}, },
resetPaperContents(){
this.paperContentsIsSet = false;
this.setPaperContents();
},
resetPaperEntitesAndContours(){ resetPaperEntitesAndContours(){
console.log(`concernementMapitem ${this.id} resetPaperEntitesAndContours this.concernement`, this.concernement); console.log(`concernementMapitem ${this.id} resetPaperEntitesAndContours this.concernement`, this.concernement);
if (!this.isResetingPaperEntites) { if (!this.isResetingPaperEntites) {