Skip to content
Snippets Groups Projects
Commit a94d7f55 authored by Griefed's avatar Griefed :joystick:
Browse files

fix: Correctly write view radius and center to map JSON. Fix typo in...

fix: Correctly write view radius and center to map JSON. Fix typo in initialViewCenterX in JSON. Fixes issue #32
parent 914872cb
No related branches found
No related tags found
1 merge request!33fix: Correctly write view radius and center to map JSON. Fix typo in initialViewCenterX in JSON. Fixes issue #32
...@@ -295,13 +295,16 @@ export default defineComponent({ ...@@ -295,13 +295,16 @@ export default defineComponent({
return (mapSize/2)+2 return (mapSize/2)+2
} }
}, },
newMap(){ newMap(){
this.confirmMapNew = false; this.confirmMapNew = false;
this.store.methods.reset(); this.store.methods.reset();
}, },
generateMap() { generateMap() {
this.downloadMap(this.store.methods.getMapId() + ".json", JSON.stringify(this.store.methods.exportMap(), null, 2)); this.downloadMap(this.store.methods.getMapId() + ".json", JSON.stringify(this.store.methods.exportMap(), null, 2));
}, },
downloadMap(mapName, map) { downloadMap(mapName, map) {
var element = document.createElement('a'); var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(map)); element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(map));
......
...@@ -77,10 +77,10 @@ const methods = { ...@@ -77,10 +77,10 @@ const methods = {
return{ return{
mapID: state.mapID, mapID: state.mapID,
mapName: state.mapName, mapName: state.mapName,
initialViewRadiusX: state.centerX, initialViewRadiusX: state.radiusX,
initialViewRadiusY: state.centerY, initialViewRadiusY: state.radiusY,
initialVieCenterX: state.radiusX, initialViewCenterX: state.centerX,
initialViewCenterY: state.radiusY, initialViewCenterY: state.centerY,
tileSet: state.lttMap.flat()} tileSet: state.lttMap.flat()}
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment