Closed gogins closed 8 years ago
Done. Four functions in Silencio: save to local filesystem, restore from local filesystem (parameterized on whether values are strings or objects); save dat.gui state to local filesystem, restore dat.gui state from local storage if it exists, the local filesystem if the file exists, or a default parameters object.
Oops, it didn't work to save parameters for dat.gui from local storage, there is no guarantee of correct data in there until the window is unloading. Changed to use gui.getSaveObject() which seems to work.
For HTML5 user interfaces based on anything like dat.gui, persist JavaScript parameters to the filesystem as a backup in case localstore is corrupt, needs to be duplicated, or does not exist.