|
@@ -588,52 +588,6 @@ export default {
|
|
|
|
|
|
this.ctx.stroke();
|
|
this.ctx.stroke();
|
|
},
|
|
},
|
|
- drawEntites(){
|
|
|
|
- // IF OPENED
|
|
|
|
- if (this.opened) {
|
|
|
|
- // place all entities points
|
|
|
|
- // OR using entitées matter bodies
|
|
|
|
- for (let i = 0; i < this.body.parts.length; i++) {
|
|
|
|
- if (this.body.parts[i].item_type === 'entite'
|
|
|
|
- // draw only entite agissante if map mode is action
|
|
|
|
- && ((this.map_mode === 'action' && this.body.parts[i].agissante) || this.map_mode !== "action")) {
|
|
|
|
- let part = this.body.parts[i];
|
|
|
|
- this.ctx.beginPath();
|
|
|
|
- this.ctx.arc(part.position.x, part.position.y, 0.3*this.scale, 0, 2 * Math.PI, false);
|
|
|
|
- // console.log(part.id, this.opened_entite_id);
|
|
|
|
- if (part.id === this.opened_entite_id) {
|
|
|
|
- this.ctx.fillStyle = "#F00";
|
|
|
|
- } else {
|
|
|
|
- this.ctx.fillStyle = "#000";
|
|
|
|
- }
|
|
|
|
- this.ctx.fill();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // IF CLOSED
|
|
|
|
- else {
|
|
|
|
- // map mode action
|
|
|
|
- // if not opened and has_agissantes draw only entites agissantes
|
|
|
|
- if (this.concernement.has_agissantes && this.map_mode === "action") {
|
|
|
|
- for (let i = 0; i < this.body.parts.length; i++) {
|
|
|
|
- if (this.body.parts[i].item_type === 'entite' && this.body.parts[i].agissante) {
|
|
|
|
- let part = this.body.parts[i];
|
|
|
|
- this.ctx.beginPath();
|
|
|
|
- this.ctx.arc(part.position.x, part.position.y, 1*this.scale, 0, 2 * Math.PI, false);
|
|
|
|
- // console.log(part.id, this.opened_entite_id);
|
|
|
|
- if (part.id === this.opened_entite_id) {
|
|
|
|
- this.ctx.fillStyle = "#F00";
|
|
|
|
- } else {
|
|
|
|
- this.ctx.fillStyle = "#000";
|
|
|
|
- }
|
|
|
|
- this.ctx.fill();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
drawBesoins(){
|
|
drawBesoins(){
|
|
for (let i = 0; i < this.body.parts.length; i++) {
|
|
for (let i = 0; i < this.body.parts.length; i++) {
|
|
if (this.body.parts[i].item_type === 'besoin' || this.body.parts[i].item_type === 'reponse') {
|
|
if (this.body.parts[i].item_type === 'besoin' || this.body.parts[i].item_type === 'reponse') {
|
|
@@ -722,6 +676,52 @@ export default {
|
|
|
|
|
|
this.ctx.stroke();
|
|
this.ctx.stroke();
|
|
},
|
|
},
|
|
|
|
+ drawEntites(){
|
|
|
|
+ // IF OPENED
|
|
|
|
+ if (this.opened) {
|
|
|
|
+ // place all entities points
|
|
|
|
+ // OR using entitées matter bodies
|
|
|
|
+ for (let i = 0; i < this.body.parts.length; i++) {
|
|
|
|
+ if (this.body.parts[i].item_type === 'entite'
|
|
|
|
+ // draw only entite agissante if map mode is action
|
|
|
|
+ && ((this.map_mode === 'action' && this.body.parts[i].agissante) || this.map_mode !== "action")) {
|
|
|
|
+ let part = this.body.parts[i];
|
|
|
|
+ this.ctx.beginPath();
|
|
|
|
+ this.ctx.arc(part.position.x, part.position.y, 0.3*this.scale, 0, 2 * Math.PI, false);
|
|
|
|
+ // console.log(part.id, this.opened_entite_id);
|
|
|
|
+ if (part.id === this.opened_entite_id) {
|
|
|
|
+ this.ctx.fillStyle = "#F00";
|
|
|
|
+ } else {
|
|
|
|
+ this.ctx.fillStyle = "#000";
|
|
|
|
+ }
|
|
|
|
+ this.ctx.fill();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // IF CLOSED
|
|
|
|
+ else {
|
|
|
|
+ // map mode action
|
|
|
|
+ // if not opened and has_agissantes draw only entites agissantes
|
|
|
|
+ if (this.concernement.has_agissantes && this.map_mode === "action") {
|
|
|
|
+ for (let i = 0; i < this.body.parts.length; i++) {
|
|
|
|
+ if (this.body.parts[i].item_type === 'entite' && this.body.parts[i].agissante) {
|
|
|
|
+ let part = this.body.parts[i];
|
|
|
|
+ this.ctx.beginPath();
|
|
|
|
+ this.ctx.arc(part.position.x, part.position.y, 1*this.scale, 0, 2 * Math.PI, false);
|
|
|
|
+ // console.log(part.id, this.opened_entite_id);
|
|
|
|
+ if (part.id === this.opened_entite_id) {
|
|
|
|
+ this.ctx.fillStyle = "#F00";
|
|
|
|
+ } else {
|
|
|
|
+ this.ctx.fillStyle = "#000";
|
|
|
|
+ }
|
|
|
|
+ this.ctx.fill();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
drawContour(){
|
|
drawContour(){
|
|
if (this.salientPoints.length > 3) {
|
|
if (this.salientPoints.length > 3) {
|
|
var fillStyle;
|
|
var fillStyle;
|