load dynamically cultures editor

This commit is contained in:
Azgaar 2022-05-19 00:19:24 +03:00 committed by Peter
parent 877ae096bd
commit 69823ceeb0
3 changed files with 14 additions and 8 deletions

View file

@ -294,13 +294,13 @@ function statesEditorAddLines() {
$body.innerHTML = lines;
// update footer
byId("statesFooterStates").innerHTML = pack.states.filter(s => s.i && !s.removed).length;
byId("statesFooterCells").innerHTML = pack.cells.h.filter(h => h >= 20).length;
byId("statesFooterBurgs").innerHTML = totalBurgs;
byId("statesFooterArea").innerHTML = si(totalArea) + unit;
byId("statesFooterArea").dataset.area = totalArea;
byId("statesFooterPopulation").innerHTML = si(totalPopulation);
byId("statesFooterPopulation").dataset.population = totalPopulation;
statesFooterStates.innerHTML = pack.states.filter(s => s.i && !s.removed).length;
statesFooterCells.innerHTML = pack.cells.h.filter(h => h >= 20).length;
statesFooterBurgs.innerHTML = totalBurgs;
statesFooterArea.innerHTML = `${si(totalArea)} ${unit}`;
statesFooterPopulation.innerHTML = si(totalPopulation);
statesFooterArea.dataset.area = totalArea;
statesFooterPopulation.dataset.population = totalPopulation;
// add listeners
$body.querySelectorAll(":scope > div").forEach($line => {

View file

@ -1197,3 +1197,9 @@ async function editStates() {
const StateEditor = await import("../dynamic/editors/states-editor.js");
StateEditor.open();
}
async function editCultures() {
if (customization) return;
const CulturesEditor = await import("../dynamic/editors/cultures-editor.js");
CulturesEditor.open();
}