removed puissance d'agir, action & doleance icons on map #2249

This commit is contained in:
2023-10-06 10:50:32 +02:00
parent 3da18ba960
commit 5e5cf061c5
2 changed files with 108 additions and 110 deletions

View File

@@ -524,15 +524,15 @@ export default {
this.paper_main_object.addChild(this.setPaperEntitesSuperposees());
}
if (this.concernement.has_puissancedagir) {
this.addNewPaperSymbolInstance('puissanceagir_icon', false, 0.7);
}
if (this.concernement.has_agissantes) {
this.paper_main_object.addChild(this.setPaperAgissantesIcons());
}
if (this.concernement.has_doleance) {
this.addNewPaperSymbolInstance('doleance_icon', false, 0.7);
}
// if (this.concernement.has_puissancedagir) {
// this.addNewPaperSymbolInstance('puissanceagir_icon', false, 0.7);
// }
// if (this.concernement.has_agissantes) {
// this.paper_main_object.addChild(this.setPaperAgissantesIcons());
// }
// if (this.concernement.has_doleance) {
// this.addNewPaperSymbolInstance('doleance_icon', false, 0.7);
// }
this.initPaperEvents()
},
@@ -755,28 +755,28 @@ export default {
}
return g;
},
setPaperAgissantesIcons(){
let g = new paper.Group({
pivot: new paper.Point(this.pos),
name: 'agissantes_icons'
});
for (let i = 0; i < this.concernement.revisions_byid[this.concernement.revision_id].entites.length; i++) {
let entite = this.concernement.revisions_byid[this.concernement.active_revision].entites[i];
if (entite.entite && entite.entite.agissante) {
let instance = new paper.SymbolItem(this.paper_symbol_definitions['entite_action_icon']);
instance.name = 'entite_action';
instance.position = new paper.Point([this.pos.x + entite.display.pos.x * this.scale, this.pos.y + entite.display.pos.y * this.scale]);
instance.fillColor = '#000';
// instance.scale(0.2);
instance.scale(this.scale);
instance.item_id = entite.entite.id;
instance.item_type = 'entite_action';
instance.is_symbol_instance = true;
g.addChild(instance)
}
}
return g;
},
// setPaperAgissantesIcons(){
// let g = new paper.Group({
// pivot: new paper.Point(this.pos),
// name: 'agissantes_icons'
// });
// for (let i = 0; i < this.concernement.revisions_byid[this.concernement.revision_id].entites.length; i++) {
// let entite = this.concernement.revisions_byid[this.concernement.active_revision].entites[i];
// if (entite.entite && entite.entite.agissante) {
// let instance = new paper.SymbolItem(this.paper_symbol_definitions['entite_action_icon']);
// instance.name = 'entite_action';
// instance.position = new paper.Point([this.pos.x + entite.display.pos.x * this.scale, this.pos.y + entite.display.pos.y * this.scale]);
// instance.fillColor = '#000';
// // instance.scale(0.2);
// instance.scale(this.scale);
// instance.item_id = entite.entite.id;
// instance.item_type = 'entite_action';
// instance.is_symbol_instance = true;
// g.addChild(instance)
// }
// }
// return g;
// },
setPaperPuissanceagirBesoins(){
let g = new paper.Group({
pivot: new paper.Point(this.pos),
@@ -1143,14 +1143,14 @@ export default {
},
// PAPER VISIBILITY
handlePaperVisibilityOnBeforeOpen(){
// agissantes
if (this.concernement.has_agissantes && this.map_mode === "action") {
if (!this.is_open) {
this.paper_main_object.children.agissantes_icons.visible = true;
} else {
this.paper_main_object.children.agissantes_icons.visible = false;
}
}
// // agissantes
// if (this.concernement.has_agissantes && this.map_mode === "action") {
// if (!this.is_open) {
// this.paper_main_object.children.agissantes_icons.visible = true;
// } else {
// this.paper_main_object.children.agissantes_icons.visible = false;
// }
// }
// superposition
// scale down superposed entites on open
@@ -1177,14 +1177,14 @@ export default {
}
},
handlePaperVisibilityOnClosed(){
// agissantes
if (this.concernement.has_agissantes && this.map_mode === "action") {
if (!this.is_open) {
this.paper_main_object.children.agissantes_icons.visible = true;
} else {
this.paper_main_object.children.agissantes_icons.visible = false;
}
}
// // agissantes
// if (this.concernement.has_agissantes && this.map_mode === "action") {
// if (!this.is_open) {
// this.paper_main_object.children.agissantes_icons.visible = true;
// } else {
// this.paper_main_object.children.agissantes_icons.visible = false;
// }
// }
},
handlePaperVisibilityOnMapMode(){},
handlePaperVisibilityOnAfterEnginUpdate(){
@@ -1259,42 +1259,42 @@ export default {
}
}
// puissance d'agir
if (this.concernement.has_puissancedagir) {
if (this.map_mode === "puissancedagir") {
if (!this.is_open) {
this.paper_main_object.children.puissanceagir_icon.visible = true; // if not opened and has_puissancedagir draw the puissance d'agir icone
} else {
this.paper_main_object.children.puissanceagir_icon.visible = false;
}
} else {
this.paper_main_object.children.puissanceagir_icon.visible = false;
}
}
// // puissance d'agir
// if (this.concernement.has_puissancedagir) {
// if (this.map_mode === "puissancedagir") {
// if (!this.is_open) {
// this.paper_main_object.children.puissanceagir_icon.visible = true; // if not opened and has_puissancedagir draw the puissance d'agir icone
// } else {
// this.paper_main_object.children.puissanceagir_icon.visible = false;
// }
// } else {
// this.paper_main_object.children.puissanceagir_icon.visible = false;
// }
// }
// agissantes
if (this.concernement.has_agissantes) {
if (this.map_mode !== "action") {
this.paper_main_object.children.agissantes_icons.visible = false;
} else if(!this.is_open && !this.is_closing){
this.paper_main_object.children.agissantes_icons.visible = true;
}
}
// if (this.concernement.has_agissantes) {
// if (this.map_mode !== "action") {
// this.paper_main_object.children.agissantes_icons.visible = false;
// } else if(!this.is_open && !this.is_closing){
// this.paper_main_object.children.agissantes_icons.visible = true;
// }
// }
// doleance
if (this.concernement.has_doleance) {
if (this.map_mode === "doleancer") {
if (!this.is_open) {
this.paper_main_object.children.doleance_icon.visible = true;
// this.paper_main_object.children.doleance_icon.visible = true;
} else {
this.paper_main_object.children.doleance_icon.visible = false;
// this.paper_main_object.children.doleance_icon.visible = false;
// display the right (opened) doleance
this.concernement.doleances.forEach((d) => {
this.paper_main_object.children.doleances.children[`doleance_${d.id}`].visible = d.id === this.concernement.opened_doleance.id;
})
}
} else {
this.paper_main_object.children.doleance_icon.visible = false;
// this.paper_main_object.children.doleance_icon.visible = false;
}
}