From 811d6de107a7d73699e672bcd4f92026ab2daa58 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 27 Feb 2013 09:15:06 -0500 Subject: [PATCH] fix to previous - don't do it dynamically, do it on save --- src/app/character.coffee | 5 ++--- views/app/settings.html | 18 +++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/app/character.coffee b/src/app/character.coffee index 7ace61dbf1..07b0996dcb 100644 --- a/src/app/character.coffee +++ b/src/app/character.coffee @@ -75,9 +75,8 @@ module.exports.app = (appExports, model) -> 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)) + $('#restore-form input').each -> + batch.set $(this).attr('data-for'), parseInt($(this).val()) batch.commit() user.on 'set', 'flags.customizationsNotification', (captures, args) -> diff --git a/views/app/settings.html b/views/app/settings.html index 57354e3bb9..6d053bc3df 100644 --- a/views/app/settings.html +++ b/views/app/settings.html @@ -31,41 +31,41 @@

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} -
+

Stats

HP - +
Exp - +
GP - +
Level - +

Items

Weapon - +
Armor - +
Helm - +
Shield - +