diff --git a/src/app/character.coffee b/src/app/character.coffee index 901e3cb518..7ace61dbf1 100644 --- a/src/app/character.coffee +++ b/src/app/character.coffee @@ -72,6 +72,14 @@ module.exports.app = (appExports, model) -> appExports.customizeArmorSet = (e, el) -> user.set 'preferences.armorSet', $(el).attr('data-value') + appExports.restoreSave = (e, el) -> + batch = new BatchUpdate(model) + batch.startTransaction() + obj = batch.obj() + _.each obj.stats, (stat, key) -> batch.set("stats.#{key}", parseInt(stat)) + _.each obj.items, (item, key) -> batch.set("items.#{key}", parseInt(item)) + batch.commit() + user.on 'set', 'flags.customizationsNotification', (captures, args) -> return unless captures == true $('.main-avatar').popover('destroy') #remove previous popovers diff --git a/views/app/settings.html b/views/app/settings.html index 5f564d221e..57354e3bb9 100644 --- a/views/app/settings.html +++ b/views/app/settings.html @@ -10,7 +10,8 @@
{_user.apiToken}
HabitRPG is quite Beta-quality at present, and many find they need to restore character attributes as a result. Enter your numbers here and it will be applied automatically to your character. This will be removed once Habit is more stable.
+ + {#with _user} + + {/} + + <@footer> + + @footer> +