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

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

View File

@ -23,9 +23,9 @@ import RecitPlayer from '@components/RecitPlayer.vue';
// import iconTerraindevie from "@/assets/icons/terraindevie.svg" // import iconTerraindevie from "@/assets/icons/terraindevie.svg"
// import iconProximite from "@/assets/icons/proximite.svg" // import iconProximite from "@/assets/icons/proximite.svg"
// import iconSuperposition from "@/assets/icons/superposition.svg" // import iconSuperposition from "@/assets/icons/superposition.svg"
import iconPuissanceagir from "@/assets/icons/puissancedagir.svg" // import iconPuissanceagir from "@/assets/icons/puissancedagir.svg"
import iconAction from "@/assets/icons/action_2.svg" // import iconAction from "@/assets/icons/action_2.svg"
import iconDoleancer from "@/assets/icons/doleancer.svg" // import iconDoleancer from "@/assets/icons/doleancer.svg"
export default { export default {
data() { data() {
@ -282,9 +282,9 @@ export default {
initPaperSymbols(){ initPaperSymbols(){
this.addPaperSymbolDefinition('boussole_bg', this.setPaperBoussoleBGSymbol()); this.addPaperSymbolDefinition('boussole_bg', this.setPaperBoussoleBGSymbol());
this.addPaperSymbolDefinition('puissanceagir_bg', this.setPaperPuissanceagirBGSymbol()); this.addPaperSymbolDefinition('puissanceagir_bg', this.setPaperPuissanceagirBGSymbol());
this.addPaperSymbolDefinition('puissanceagir_icon', this.setPaperPuissanceagirICONSymbol()); // this.addPaperSymbolDefinition('puissanceagir_icon', this.setPaperPuissanceagirICONSymbol());
this.addPaperSymbolDefinition('doleance_bg', this.setPaperDoleanceBGSymbol()); this.addPaperSymbolDefinition('doleance_bg', this.setPaperDoleanceBGSymbol());
this.addPaperSymbolDefinition('doleance_icon', this.setPaperDoleanceICONSymbol()); // this.addPaperSymbolDefinition('doleance_icon', this.setPaperDoleanceICONSymbol());
// //
this.addPaperSymbolDefinition('entite', this.setPaperEntiteSymbol()); this.addPaperSymbolDefinition('entite', this.setPaperEntiteSymbol());
this.addPaperSymbolDefinition('entite_hidden', this.setPaperHiddenEntiteSymbol()); this.addPaperSymbolDefinition('entite_hidden', this.setPaperHiddenEntiteSymbol());
@ -504,25 +504,25 @@ export default {
} }
}); });
}, },
setPaperPuissanceagirICONSymbol(){ // setPaperPuissanceagirICONSymbol(){
let children = []; // let children = [];
let svgIcon = paper.project.importSVG(iconPuissanceagir); // let svgIcon = paper.project.importSVG(iconPuissanceagir);
children.push(svgIcon); // children.push(svgIcon);
svgIcon.position = this.pos; // svgIcon.position = this.pos;
return new paper.Group({ // return new paper.Group({
children: children, // children: children,
pivot: new paper.Point(this.pos), // pivot: new paper.Point(this.pos),
name: 'puissanceagir_icon', // name: 'puissanceagir_icon',
locked: true, // locked: true,
style: { // style: {
strokeColor: '#000', // strokeColor: '#000',
strokeWidth: 0.75, // strokeWidth: 0.75,
fillColor: null // fillColor: null
} // }
}); // });
}, // },
setPaperDoleanceBGSymbol(){ setPaperDoleanceBGSymbol(){
let ray = this.map_item_ray; let ray = this.map_item_ray;
let pos = {x:0,y:0}; let pos = {x:0,y:0};
@ -924,27 +924,25 @@ export default {
// locked: true // locked: true
}); });
}, },
setPaperDoleanceICONSymbol(){ // setPaperDoleanceICONSymbol(){
let children = []; // let children = [];
let svgIcon = paper.project.importSVG(iconDoleancer); // let svgIcon = paper.project.importSVG(iconDoleancer);
children.push(svgIcon); // children.push(svgIcon);
svgIcon.position = this.pos; // svgIcon.position = this.pos;
return new paper.Group({ // return new paper.Group({
children: children, // children: children,
pivot: new paper.Point(this.pos), // pivot: new paper.Point(this.pos),
name: 'doleance_icon', // name: 'doleance_icon',
locked: true, // locked: true,
style: { // style: {
strokeColor: '#000', // strokeColor: '#000',
strokeWidth: 0.75, // strokeWidth: 0.75,
fillColor: null // fillColor: null
} // }
}); // });
// },
},
setPaperEntiteSymbol(){ setPaperEntiteSymbol(){
return new paper.Path.Circle({ return new paper.Path.Circle({
pivot: new paper.Point({x:0,y:0}), pivot: new paper.Point({x:0,y:0}),