Forked from
spnati / spnati
Source project has a limited visibility.
-
ReformCopyright authored
1. localStorage is used instead of a cookie. Multiple entries are used, and keys have a prefix to avoid any collisions when hosted on other sites. 2. The existing cookie is converted so as not to lose unlocked endings in particular. This code can be dropped some time in the future. 3. Option values are handled and stored as-is intead of as opaque indices from 1 and up. For time values, this has the disadvantage that if we modify what e.g. "Slow" means, the old value will still be used until the user chooses a new option, but the advantages that we can later add more options or change the input elements to sliders without problems, plus the disadvantage can also be an advantage. Above all, there's no conversion back and forth and default values aren't specified in three or four places. 4. Option change event handles are attached with jQuery and the option values stored in attributes. 5. Backgrounds are renamed and moved to a subdirectory (that could have been done anyway; it's not a direct result of 3). 6. Clothes selections are stored as arrays of article names instead of 18 true/false values. 7. No separate askedUsageTracking flag. If no usageTracking value is in localStorage, then we haven't asked. Similarily, null is used for FORFEIT_DELAY and ENDING_DELAY to represent Disabled.
ReformCopyright authored1. localStorage is used instead of a cookie. Multiple entries are used, and keys have a prefix to avoid any collisions when hosted on other sites. 2. The existing cookie is converted so as not to lose unlocked endings in particular. This code can be dropped some time in the future. 3. Option values are handled and stored as-is intead of as opaque indices from 1 and up. For time values, this has the disadvantage that if we modify what e.g. "Slow" means, the old value will still be used until the user chooses a new option, but the advantages that we can later add more options or change the input elements to sliders without problems, plus the disadvantage can also be an advantage. Above all, there's no conversion back and forth and default values aren't specified in three or four places. 4. Option change event handles are attached with jQuery and the option values stored in attributes. 5. Backgrounds are renamed and moved to a subdirectory (that could have been done anyway; it's not a direct result of 3). 6. Clothes selections are stored as arrays of article names instead of 18 true/false values. 7. No separate askedUsageTracking flag. If no usageTracking value is in localStorage, then we haven't asked. Similarily, null is used for FORFEIT_DELAY and ENDING_DELAY to represent Disabled.