Update URL and add saving cells

This commit is contained in:
howlingsails 2022-10-03 19:55:48 -07:00
parent c477c8dfcd
commit f2f3f83d86
2 changed files with 8 additions and 6 deletions

View file

@ -202,12 +202,14 @@ function downloadStates() {
link.click(); link.click();
} }
function downloadNotes() {
const mapData = JSON.stringify(pack.notes);
function downloadCells() {
const mapData = JSON.stringify(pack.cells);
const blob = new Blob([mapData], { type: "text/plain" }); const blob = new Blob([mapData], { type: "text/plain" });
const URL = window.URL.createObjectURL(blob); const URL = window.URL.createObjectURL(blob);
const link = document.createElement("a"); const link = document.createElement("a");
link.download = getFileName() + "-notes.json"; link.download = getFileName() + "-cells.json";
link.href = URL; link.href = URL;
link.click(); link.click();
} }
@ -234,7 +236,7 @@ function dowloadMap() {
downloadMarkers(); downloadMarkers();
downloadBurgs(); downloadBurgs();
downloadCultures(); downloadCultures();
downloadNotes(); downloadCells();
downloadReligions(); downloadReligions();
downloadPopRates(); downloadPopRates();
downloadStates(); downloadStates();

View file

@ -574,8 +574,8 @@ function editBurg(id) {
if (people > 900) townSize = "medium"; if (people > 900) townSize = "medium";
if (people > 2_000) townSize = "average"; if (people > 2_000) townSize = "average";
if (people > 5_500) townSize = "big"; if (people > 5_500) townSize = "big";
const baseURL = "http://localhost:9090/town/"; const baseURL = "http://localhost:9090/world/";
const url = `${baseURL}${worldName}_${name}-${burgCulture}/${townSize}`; const url = `${baseURL}${worldName}/burg/${burg.i}`;
return url; return url;
} }