mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
FIX: #791 Added markers block exporting markers
This commit is contained in:
parent
d12e22aa5c
commit
67f8c68983
1 changed files with 4 additions and 2 deletions
|
|
@ -171,13 +171,15 @@ function overviewMarkers() {
|
||||||
|
|
||||||
function exportMarkers() {
|
function exportMarkers() {
|
||||||
const headers = "Id,Type,Icon,Name,Note,X,Y\n";
|
const headers = "Id,Type,Icon,Name,Note,X,Y\n";
|
||||||
|
const quote = s => '"' + s.replace('"', "'") + '"';
|
||||||
|
|
||||||
const body = pack.markers.map(marker => {
|
const body = pack.markers.map(marker => {
|
||||||
const {i, type, icon, x, y} = marker;
|
const {i, type, icon, x, y} = marker;
|
||||||
const id = `marker${i}`;
|
const id = `marker${i}`;
|
||||||
const note = notes.find(note => note.id === id);
|
const note = notes.find(note => note.id === id);
|
||||||
const legend = escape(note.legend);
|
const name = note ? quote(note.name) : 'Unknown';
|
||||||
return [id, type, icon, note.name, legend, x, y].join(",");
|
const legend = note ? quote(note.legend) : '';
|
||||||
|
return [id, type, icon, name, legend, x, y].join(",");
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = headers + body.join("\n");
|
const data = headers + body.join("\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue