mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.3.31
This commit is contained in:
parent
aab1b8eac6
commit
5ecbcdaf85
2 changed files with 7 additions and 4 deletions
6
main.js
6
main.js
|
|
@ -279,12 +279,14 @@ function findBurgForMFCG(params) {
|
|||
const b = selection[selected].i;
|
||||
if (!b) {console.error("Cannot select a burg for MFCG"); return;}
|
||||
|
||||
const referrer = new URL(document.referrer).searchParams;
|
||||
for (let p of referrer) {
|
||||
const referrer = new URL(document.referrer);
|
||||
for (let p of referrer.searchParams) {
|
||||
if (p[0] === "size") burgs[b].population = +p[1]; else
|
||||
if (p[0] === "seed") burgs[b].MFCG = +p[1]; else
|
||||
if (p[0] === "shantytown") burgs[b].shanty = +p[1]; else
|
||||
burgs[b][p[0]] = p[1];
|
||||
}
|
||||
burgs[b].MFCGlink = document.referrer;
|
||||
|
||||
const label = burgLabels.select("[data-id='" + b + "']");
|
||||
if (label.size()) {
|
||||
|
|
|
|||
|
|
@ -287,11 +287,12 @@ function editBurg(id) {
|
|||
Seed should be a number. Default seed is FMG map seed + burg id padded to 4 chars with zeros (${defSeed}). <br>
|
||||
Please note that if seed is custom, "Overworld" button from MFCG will open a different map`, {default:burg.MFCG||defSeed, step:1, min:1, max:1e13-1}, v => {
|
||||
burg.MFCG = v;
|
||||
openMFCG();
|
||||
openMFCG(v);
|
||||
});
|
||||
} else openMFCG();
|
||||
|
||||
function openMFCG() {
|
||||
function openMFCG(seed) {
|
||||
if (!seed) openURL(burg.MFCGlink);
|
||||
const name = elSelected.text();
|
||||
const size = Math.max(Math.min(rn(burg.population), 65), 6);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue