Merge branch 'v1.96' into scale-bar-styling

This commit is contained in:
Azgaar 2023-12-09 20:01:33 +04:00 committed by GitHub
commit ebb97f78d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 15 deletions

View file

@ -1182,7 +1182,7 @@ async function editStates() {
async function editCultures() {
if (customization) return;
const Editor = await import("../dynamic/editors/cultures-editor.js?v=1.91.00");
const Editor = await import("../dynamic/editors/cultures-editor.js?v=1.95.04");
Editor.open();
}

View file

@ -244,11 +244,13 @@ function editNamesbase() {
Names.clearChains();
if (override) nameBases = [];
const unsafe = new RegExp(/[|/]/, "g");
data.forEach(base => {
const [name, min, max, d, m, names] = base.split("|");
const secureNames = names.replace(/[/|]/g, "");
nameBases.push({name, min, max, d, m, b: secureNames});
const [rawName, min, max, d, m, rawNames] = base.split("|");
const name = rawName.replace(unsafe, "");
const names = rawNames.replace(unsafe, "");
nameBases.push({name, min, max, d, m, b: names});
});
createBasesList();

View file

@ -361,10 +361,10 @@ function regenerateBurgs() {
const score = new Int16Array(cells.s.map(s => s * Math.random())); // cell score for capitals placement
const sorted = cells.i.filter(i => score[i] > 0 && cells.culture[i]).sort((a, b) => score[b] - score[a]); // filtered and sorted array of indexes
const existingStatesCount = states.filter(s => s.i && !s.removed).length;
const burgsCount =
manorsInput.value === "1000"
? rn(sorted.length / 5 / (grid.points.length / 10000) ** 0.8) + states.length
: +manorsInput.value + states.length;
(manorsInput.value === "1000" ? rn(sorted.length / 5 / (grid.points.length / 10000) ** 0.8) : +manorsInput.value) +
existingStatesCount;
const spacing = (graphWidth + graphHeight) / 150 / (burgsCount ** 0.7 / 66); // base min distance between towns
for (let i = 0; i < sorted.length && burgs.length < burgsCount; i++) {