diff --git a/index.html b/index.html index cb550137..a7892868 100644 --- a/index.html +++ b/index.html @@ -7864,10 +7864,10 @@ - + - + @@ -7882,11 +7882,11 @@ - + - + diff --git a/main.js b/main.js index e201f7fe..49b0f001 100644 --- a/main.js +++ b/main.js @@ -695,6 +695,7 @@ async function generate(options) { if (shouldRegenerateGrid(grid, precreatedSeed)) grid = precreatedGraph || generateGrid(); else delete grid.cells.h; grid.cells.h = await HeightmapGenerator.generate(grid); + pack = {}; markFeatures(); markupGridOcean(); @@ -2038,8 +2039,6 @@ const regenerateMap = debounce(async function (options) { customization = 0; resetZoom(1000); undraw(); - pack.religions = []; - pack.cultures = []; await generate(options); restoreLayers(); if (ThreeD.options.isOn) ThreeD.redraw(); diff --git a/modules/dynamic/editors/cultures-editor.js b/modules/dynamic/editors/cultures-editor.js index ac323573..3f8018d6 100644 --- a/modules/dynamic/editors/cultures-editor.js +++ b/modules/dynamic/editors/cultures-editor.js @@ -519,11 +519,10 @@ function cultureRegenerateBurgs() { } function removeCulture(cultureId) { - // and the Folk religion cults.select("#culture" + cultureId).remove(); debug.select("#cultureCenter" + cultureId).remove(); - const {burgs, states, cells, cultures, religions} = pack; + const {burgs, states, cells, cultures} = pack; burgs.filter(b => b.culture == cultureId).forEach(b => (b.culture = 0)); states.forEach(s => { @@ -532,11 +531,7 @@ function removeCulture(cultureId) { cells.culture.forEach((c, i) => { if (c === cultureId) cells.culture[i] = 0; }); - cells.religion.forEach((r, i) => { - if (r === cultureId) cells.religion[i] = 0; - }) cultures[cultureId].removed = true; - religions[cultureId].removed = true; cultures .filter(c => c.i && !c.removed) @@ -544,12 +539,6 @@ function removeCulture(cultureId) { c.origins = c.origins.filter(origin => origin !== cultureId); if (!c.origins.length) c.origins = [0]; }); - religions - .filter(r => r.i && !r.removed) - .forEach(r => { - r.origins = r.origins.filter(origin => origin !== cultureId); - if (!r.origins.length) r.origins = [0]; - }); refreshCulturesEditor(); } @@ -559,7 +548,7 @@ function cultureRemovePrompt() { const cultureId = +this.parentNode.dataset.id; confirmationDialog({ title: "Remove culture", - message: "Are you sure you want to remove the culture?
The linked folk religion will also be removed.
This action cannot be reverted", + message: "Are you sure you want to remove the culture?
This action cannot be reverted", confirm: "Remove", onConfirm: () => removeCulture(cultureId) }); @@ -834,7 +823,6 @@ function addCulture() { if (d3.event.shiftKey === false) exitAddCultureMode(); Cultures.add(center); - Religions.addFolk(center); drawCultureCenters(); culturesEditorAddLines(); diff --git a/modules/dynamic/editors/religions-editor.js b/modules/dynamic/editors/religions-editor.js index 8a92addc..d6c60dfb 100644 --- a/modules/dynamic/editors/religions-editor.js +++ b/modules/dynamic/editors/religions-editor.js @@ -213,15 +213,9 @@ function religionsEditorAddLines() { - ${r.type === "Folk" ? - ` - Folk - ` - : - ` ${getTypeOptions(r.type)} - ` - } + @@ -231,37 +225,12 @@ function religionsEditorAddLines() {
${si(area) + unit}
${si(population)}
- ${r.type === "Folk" ? - ` - culture - - - + ${getExpansionColumns(r)} - ` - : - ` - - - - ` - } + `; } $body.innerHTML = lines; @@ -306,11 +275,34 @@ function religionsEditorAddLines() { function getTypeOptions(type) { let options = ""; - const types = ["Organized", "Cult", "Heresy"]; + const types = ["Folk", "Organized", "Cult", "Heresy"]; types.forEach(t => (options += ``)); return options; } +function getExpansionColumns(r) { + if (r.type === "Folk") + return ` + culture + + + ` + else + return ` + + ` +} + function getExtentOptions(type) { let options = ""; const types = ["global", "state", "culture"]; diff --git a/modules/religions-generator.js b/modules/religions-generator.js index 84d09f67..5f083312 100644 --- a/modules/religions-generator.js +++ b/modules/religions-generator.js @@ -678,7 +678,6 @@ window.Religions = (function () { const cultureId = cells.culture[cellId]; religionIds[cellId] = cultureToReligionMap.get(cultureId) || 0; } - } return religionIds; } diff --git a/modules/ui/editors.js b/modules/ui/editors.js index def092fe..1f110900 100644 --- a/modules/ui/editors.js +++ b/modules/ui/editors.js @@ -1188,6 +1188,6 @@ async function editCultures() { async function editReligions() { if (customization) return; - const Editor = await import("../dynamic/editors/religions-editor.js?v=1.90.00"); + const Editor = await import("../dynamic/editors/religions-editor.js?v=1.89.09"); Editor.open(); } diff --git a/versioning.js b/versioning.js index 32386e54..1598751a 100644 --- a/versioning.js +++ b/versioning.js @@ -1,7 +1,7 @@ "use strict"; // version and caching control -const version = "1.89.08"; // generator version, update each time +const version = "1.89.09"; // generator version, update each time { document.title += " v" + version;