mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: improve tooltip logic for burg labels and icons
This commit is contained in:
parent
8907cd62ec
commit
1571a5fd8e
1 changed files with 8 additions and 6 deletions
|
|
@ -161,12 +161,14 @@ function showMapTooltip(point, e, i, g) {
|
||||||
if (group === "terrain") return tip("Click to edit the Relief Icon");
|
if (group === "terrain") return tip("Click to edit the Relief Icon");
|
||||||
|
|
||||||
if (subgroup === "burgLabels" || subgroup === "burgIcons") {
|
if (subgroup === "burgLabels" || subgroup === "burgIcons") {
|
||||||
const burg = +path[path.length - 10].dataset.id;
|
const burgId = +path[path.length - 10].dataset.id;
|
||||||
const b = pack.burgs[burg];
|
if (burgId) {
|
||||||
const population = si(b.population * populationRate * urbanization);
|
const burg = pack.burgs[burgId];
|
||||||
tip(`${b.name}. Population: ${population}. Click to edit`);
|
const population = si(burg.population * populationRate * urbanization);
|
||||||
if (burgsOverview?.offsetParent) highlightEditorLine(burgsOverview, burg, 5000);
|
tip(`${burg.name}. Population: ${population}. Click to edit`);
|
||||||
return;
|
if (burgsOverview?.offsetParent) highlightEditorLine(burgsOverview, burgId, 5000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (group === "labels") return tip("Click to edit the Label");
|
if (group === "labels") return tip("Click to edit the Label");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue