Fix cell properties and reinstate save/load functionality
objects: Map<ID, GameObject>
agents: Map<ID, GameAgent>
navigable: boolean
- saveProperties = ['x', 'y', 'id', 'description']
+ saveProperties = ['x', 'y', 'id', 'title', 'description']
constructor(x: number, y: number) {
super();
document.body.classList.toggle('edit-mode', this.editMode);
- if (localStorage['map']) {
- this.map.load(JSON.parse(localStorage.map));
- }
this.textView = new TextView();
this.editor = new Editor();
this.mapView = new MapView();
this.mapView.updateAll();
this.actions = new Actions();
+ if (localStorage['map']) {
+ this.map.load(JSON.parse(localStorage.map));
+ }
+
this.enterCell();
}
gs.map.editDescription();
break;
case 'KeyS':
- //localStorage['map'] = JSON.stringify(gs.map.store());
- console.log(JSON.stringify(gs.map.store()));
+ localStorage['map'] = JSON.stringify(gs.map.store());
+ console.log(localStorage['map']);
+ break;
+ case 'KeyL':
+ gs.map.load(JSON.parse(localStorage['map']));
+ gs.enterCell();
+ console.log('Map reloaded');
break;
default:
console.log('code:', e.code);