markers data rework - master data object

This commit is contained in:
Azgaar 2021-09-18 16:47:17 +03:00
parent c8b7e9ccee
commit 3b47efd9a4
3 changed files with 40 additions and 52 deletions

View file

@ -707,7 +707,7 @@ class Battle {
const result = `The ${this.getTypeName(this.type)} ended in ${status}`;
const legend = `${this.name} took place in ${options.year} ${options.eraShort}. It was fought between ${getSide(this.attackers.regiments, 1)} and ${getSide(this.defenders.regiments, 0)}. ${result}.
\r\nAttackers losses: ${getLosses(this.attackers.casualties)}%, defenders losses: ${getLosses(this.defenders.casualties)}%`;
const id = getNextId("markerElement");
const id = getNextId("marker");
notes.push({id, name: this.name, legend});
tip(`${this.name} is over. ${result}`, true, "success", 4000);

View file

@ -690,9 +690,9 @@ function toggleAddMarker() {
function addMarkerOnClick() {
const point = d3.mouse(this);
const x = rn(point[0], 2),
y = rn(point[1], 2);
const id = getNextId("markerElement");
const x = rn(point[0], 2);
const y = rn(point[1], 2);
const id = getNextId("marker");
const selected = markerSelectGroup.value;
const valid =