Syndaryl / DFRPGRandomDungeonGenerator

A HTML/CSS/JavaScript based random dungeon generator for GURPS. Eventual goals are to not only produce a map, but also populate the rooms with descriptions and challenges. Game statistics will be for the DFRPG / GURPS 4e.
Other
35 stars 13 forks source link

Fix persistence of configuration options #65

Closed Celti closed 6 years ago

Celti commented 6 years ago

Configuration options are meant to persist, but this does not work for the following reasons:

  1. supports_local_storage() in dungeon_types.js will never return true. Fixed in 49c9111.
  2. save_dungeon_configuration() is not called with the correct storage key to actually save the settings. Nowhere in the code actually calls it with any specific key, so wiping that out restores the proper behaviour. Fixed in 7f50586.
  3. FetchStorage() is trying to return the first member of an array from localStorage, but the other localStorage wrappers all deal with objects. Fixed in 6ef13fe.
Syndaryl commented 6 years ago

This is causing application-stopping exceptions in chrome ( Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. at supports_local_storage (file:///D:/GitHub/DFRPGRandomDungeonGenerator/lib/dungeon_types.js:670:21) at file:///D:/GitHub/DFRPGRandomDungeonGenerator/lib/dungeon_types.js:720:5 )

Celti commented 6 years ago

I hate to say it, but I can't reproduce that locally. Works fine in a completely default installation of 67.0.3396.87. I'll go ahead and wrap it back up in an exception catcher, but I have no idea why that wouldn't work on any recent Chrome version.