mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
fix: culture data change must not ignore lock status
This commit is contained in:
parent
8a1122e668
commit
660316e4bf
6 changed files with 14 additions and 17 deletions
|
|
@ -7867,7 +7867,7 @@
|
||||||
|
|
||||||
<script defer src="modules/relief-icons.js"></script>
|
<script defer src="modules/relief-icons.js"></script>
|
||||||
<script defer src="modules/ui/style.js"></script>
|
<script defer src="modules/ui/style.js"></script>
|
||||||
<script defer src="modules/ui/editors.js?v=1.87.07"></script>
|
<script defer src="modules/ui/editors.js?v=1.89.02"></script>
|
||||||
<script defer src="modules/ui/tools.js?v=1.89.00"></script>
|
<script defer src="modules/ui/tools.js?v=1.89.00"></script>
|
||||||
<script defer src="modules/ui/world-configurator.js"></script>
|
<script defer src="modules/ui/world-configurator.js"></script>
|
||||||
<script defer src="modules/ui/heightmap-editor.js?v=1.88.03"></script>
|
<script defer src="modules/ui/heightmap-editor.js?v=1.88.03"></script>
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ function culturesEditorAddLines() {
|
||||||
style="width: 5em">${si(population)}</div>
|
style="width: 5em">${si(population)}</div>
|
||||||
<span data-tip="Click to re-generate names for burgs with this culture assigned" class="icon-arrows-cw hide"></span>
|
<span data-tip="Click to re-generate names for burgs with this culture assigned" class="icon-arrows-cw hide"></span>
|
||||||
${getShapeOptions(selectShape, c.shield)}
|
${getShapeOptions(selectShape, c.shield)}
|
||||||
<span data-tip="Lock culture" class="icon-lock${c.lock ? '' : '-open'} hide"></span>
|
<span data-tip="Lock culture" class="icon-lock${c.lock ? "" : "-open"} hide"></span>
|
||||||
<span data-tip="Remove culture" class="icon-trash-empty hide"></span>
|
<span data-tip="Remove culture" class="icon-trash-empty hide"></span>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
@ -251,7 +251,7 @@ function culturesEditorAddLines() {
|
||||||
$body.querySelectorAll("fill-box").forEach($el => $el.on("click", cultureChangeColor));
|
$body.querySelectorAll("fill-box").forEach($el => $el.on("click", cultureChangeColor));
|
||||||
$body.querySelectorAll("div > input.cultureName").forEach($el => $el.on("input", cultureChangeName));
|
$body.querySelectorAll("div > input.cultureName").forEach($el => $el.on("input", cultureChangeName));
|
||||||
$body.querySelectorAll("div > span.icon-cw").forEach($el => $el.on("click", cultureRegenerateName));
|
$body.querySelectorAll("div > span.icon-cw").forEach($el => $el.on("click", cultureRegenerateName));
|
||||||
$body.querySelectorAll("div > input.cultureExpan").forEach($el => $el.on("input", cultureChangeExpansionism));
|
$body.querySelectorAll("div > input.cultureExpan").forEach($el => $el.on("change", cultureChangeExpansionism));
|
||||||
$body.querySelectorAll("div > select.cultureType").forEach($el => $el.on("change", cultureChangeType));
|
$body.querySelectorAll("div > select.cultureType").forEach($el => $el.on("change", cultureChangeType));
|
||||||
$body.querySelectorAll("div > select.cultureBase").forEach($el => $el.on("change", cultureChangeBase));
|
$body.querySelectorAll("div > select.cultureBase").forEach($el => $el.on("change", cultureChangeBase));
|
||||||
$body.querySelectorAll("div > select.cultureEmblems").forEach($el => $el.on("change", cultureChangeEmblemsShape));
|
$body.querySelectorAll("div > select.cultureEmblems").forEach($el => $el.on("change", cultureChangeEmblemsShape));
|
||||||
|
|
@ -666,17 +666,10 @@ async function showHierarchy() {
|
||||||
function recalculateCultures(must) {
|
function recalculateCultures(must) {
|
||||||
if (!must && !culturesAutoChange.checked) return;
|
if (!must && !culturesAutoChange.checked) return;
|
||||||
|
|
||||||
pack.cells.culture = new Uint16Array(pack.cells.i.length);
|
|
||||||
pack.cultures.forEach(function (c) {
|
|
||||||
if (!c.i || c.removed) return;
|
|
||||||
pack.cells.culture[c.center] = c.i;
|
|
||||||
});
|
|
||||||
|
|
||||||
Cultures.expand();
|
Cultures.expand();
|
||||||
drawCultures();
|
drawCultures();
|
||||||
pack.burgs.forEach(b => (b.culture = pack.cells.culture[b.cell]));
|
pack.burgs.forEach(b => (b.culture = pack.cells.culture[b.cell]));
|
||||||
refreshCulturesEditor();
|
refreshCulturesEditor();
|
||||||
document.querySelector("input.cultureExpan").focus(); // to not trigger hotkeys
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function enterCultureManualAssignent() {
|
function enterCultureManualAssignent() {
|
||||||
|
|
|
||||||
|
|
@ -163,8 +163,6 @@ function addListeners() {
|
||||||
const line = $element.parentNode;
|
const line = $element.parentNode;
|
||||||
const state = +line.dataset.id;
|
const state = +line.dataset.id;
|
||||||
if (classList.contains("stateCapital")) stateChangeCapitalName(state, line, $element.value);
|
if (classList.contains("stateCapital")) stateChangeCapitalName(state, line, $element.value);
|
||||||
else if (classList.contains("cultureType")) stateChangeType(state, line, $element.value);
|
|
||||||
else if (classList.contains("statePower")) stateChangeExpansionism(state, line, $element.value);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$body.on("change", function (ev) {
|
$body.on("change", function (ev) {
|
||||||
|
|
@ -173,6 +171,8 @@ function addListeners() {
|
||||||
const line = $element.parentNode;
|
const line = $element.parentNode;
|
||||||
const state = +line.dataset.id;
|
const state = +line.dataset.id;
|
||||||
if (classList.contains("stateCulture")) stateChangeCulture(state, line, $element.value);
|
if (classList.contains("stateCulture")) stateChangeCulture(state, line, $element.value);
|
||||||
|
else if (classList.contains("cultureType")) stateChangeType(state, line, $element.value);
|
||||||
|
else if (classList.contains("statePower")) stateChangeExpansionism(state, line, $element.value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1176,13 +1176,13 @@ function refreshAllEditors() {
|
||||||
// dynamically loaded editors
|
// dynamically loaded editors
|
||||||
async function editStates() {
|
async function editStates() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
const Editor = await import("../dynamic/editors/states-editor.js?v=12062022");
|
const Editor = await import("../dynamic/editors/states-editor.js?v=1.89.02");
|
||||||
Editor.open();
|
Editor.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editCultures() {
|
async function editCultures() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
const Editor = await import("../dynamic/editors/cultures-editor.js?v=1.88.06");
|
const Editor = await import("../dynamic/editors/cultures-editor.js?v=1.89.02");
|
||||||
Editor.open();
|
Editor.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
8
sw.js
8
sw.js
|
|
@ -8,7 +8,10 @@ const {ExpirationPlugin} = workbox.expiration;
|
||||||
const DAY = 24 * 60 * 60;
|
const DAY = 24 * 60 * 60;
|
||||||
|
|
||||||
const getPolitics = ({entries, days}) => {
|
const getPolitics = ({entries, days}) => {
|
||||||
return [new CacheableResponsePlugin({statuses: [0, 200]}), new ExpirationPlugin({maxEntries: entries, maxAgeSeconds: days * DAY})];
|
return [
|
||||||
|
new CacheableResponsePlugin({statuses: [0, 200]}),
|
||||||
|
new ExpirationPlugin({maxEntries: entries, maxAgeSeconds: days * DAY})
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
registerRoute(
|
registerRoute(
|
||||||
|
|
@ -21,7 +24,8 @@ registerRoute(
|
||||||
);
|
);
|
||||||
|
|
||||||
registerRoute(
|
registerRoute(
|
||||||
({request, url}) => request.destination === "script" && !url.pathname.endsWith("min.js") && !url.pathname.includes("versioning.js"),
|
({request, url}) =>
|
||||||
|
request.destination === "script" && !url.pathname.endsWith("min.js") && !url.pathname.includes("versioning.js"),
|
||||||
new CacheFirst({
|
new CacheFirst({
|
||||||
cacheName: "fmg-scripts",
|
cacheName: "fmg-scripts",
|
||||||
plugins: getPolitics({entries: 100, days: 30})
|
plugins: getPolitics({entries: 100, days: 30})
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// version and caching control
|
// version and caching control
|
||||||
const version = "1.89.01"; // generator version, update each time
|
const version = "1.89.02"; // generator version, update each time
|
||||||
|
|
||||||
{
|
{
|
||||||
document.title += " v" + version;
|
document.title += " v" + version;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue