diff --git a/modules/ui/burgs-editor.js b/modules/ui/burgs-editor.js index ffb45cb7..61c02529 100644 --- a/modules/ui/burgs-editor.js +++ b/modules/ui/burgs-editor.js @@ -252,7 +252,7 @@ function editBurgs() { } function downloadBurgsData() { - let data = "Id,Burg,State,Culture,Population,Capital,Port\n"; // headers + let data = "Id,Burg,State,Culture,Population,Capital,Port,Longitude,Latitude,Elevation\n"; // headers const valid = pack.burgs.filter(b => b.i && !b.removed); // all valid burgs valid.forEach(b => { @@ -262,7 +262,12 @@ function editBurgs() { data += pack.cultures[b.culture].name + ","; data += rn(b.population * populationRate.value * urbanization.value) + ","; data += b.capital ? "capital," : ","; - data += b.port ? "port\n" : "\n"; + data += b.port ? "port," : ","; + + // add geography data + data += (b.x / graphWidth) * mapCoordinates.lonT + mapCoordinates.lonW + ","; + data += (b.y / graphHeight) * mapCoordinates.latT + mapCoordinates.latS + ","; + data += parseInt(getFriendlyHeight(pack.cells.h[b.cell])) + "\n"; }); const dataBlob = new Blob([data], {type: "text/plain"}); @@ -315,7 +320,7 @@ function editBurgs() { } }); } - + fileReader.readAsText(fileToLoad, "UTF-8"); } @@ -339,4 +344,3 @@ function editBurgs() { } } -