mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
deleting totalCells in the code, maybe i will add provinceCells in the future.
Deleted lines for const totalCells and for (+cells / totalCells) * 100 + "%";
This commit is contained in:
parent
f3253380c5
commit
8b57426dc8
1 changed files with 0 additions and 2 deletions
|
|
@ -584,14 +584,12 @@ function editProvinces() {
|
||||||
function togglePercentageMode() {
|
function togglePercentageMode() {
|
||||||
if (body.dataset.type === "absolute") {
|
if (body.dataset.type === "absolute") {
|
||||||
body.dataset.type = "percentage";
|
body.dataset.type = "percentage";
|
||||||
const totalCells = +byId("statesFooterCells").innerText;
|
|
||||||
const totalBurgs = +byId("provincesFooterBurgs").innerText;
|
const totalBurgs = +byId("provincesFooterBurgs").innerText;
|
||||||
const totalArea = +provincesFooterArea.dataset.area;
|
const totalArea = +provincesFooterArea.dataset.area;
|
||||||
const totalPopulation = +provincesFooterPopulation.dataset.population;
|
const totalPopulation = +provincesFooterPopulation.dataset.population;
|
||||||
|
|
||||||
body.querySelectorAll(":scope > div").forEach(function (el) {
|
body.querySelectorAll(":scope > div").forEach(function (el) {
|
||||||
const {cells, burgs, area, population} = el.dataset;
|
const {cells, burgs, area, population} = el.dataset;
|
||||||
el.querySelector(".provinceCells").innerText = rn((+cells / totalCells) * 100) + "%";
|
|
||||||
el.querySelector(".provinceBurgs").innerText = rn((+burgs / totalBurgs) * 100) + "%";
|
el.querySelector(".provinceBurgs").innerText = rn((+burgs / totalBurgs) * 100) + "%";
|
||||||
el.querySelector(".biomeArea").innerHTML = rn((+area / totalArea) * 100) + "%";
|
el.querySelector(".biomeArea").innerHTML = rn((+area / totalArea) * 100) + "%";
|
||||||
el.querySelector(".culturePopulation").innerHTML = rn((+population / totalPopulation) * 100) + "%";
|
el.querySelector(".culturePopulation").innerHTML = rn((+population / totalPopulation) * 100) + "%";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue