From 8d920a7ea123d0490182a7d48ab6a021adeb728f Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 11 Feb 2013 01:55:45 -0500 Subject: [PATCH] unlock pets feature --- src/app/items.coffee | 15 +++++ src/app/scoring.coffee | 3 + views/app/index.html | 132 +++++++++++++++++++++-------------------- 3 files changed, 87 insertions(+), 63 deletions(-) diff --git a/src/app/items.coffee b/src/app/items.coffee index a584d44d7f..a3ea5fb8f3 100644 --- a/src/app/items.coffee +++ b/src/app/items.coffee @@ -182,6 +182,21 @@ module.exports.app = (appExports, model) -> content: html $('ul.items').popover 'show' + user.on 'set', 'flags.petsEnabled', (captures, args) -> + return unless captures == true + html = """ + + You have unlocked Pets! You can now buy buy pets with tokens (note, you replenish tokens with real-life money - so chose your pets wisely!) + [Close] + """ + $('#rewardsTabs').popover + title: "Pets Unlocked" + placement: 'left' + trigger: 'manual' + html: true + content: html + $('#rewardsTabs').popover 'show' + ### update store ### diff --git a/src/app/scoring.coffee b/src/app/scoring.coffee index ac21b95d4e..8aa50498cf 100644 --- a/src/app/scoring.coffee +++ b/src/app/scoring.coffee @@ -96,6 +96,9 @@ updateStats = (newStats, batch) -> if !obj.flags.partyEnabled and obj.stats.lvl >= 3 batch.set 'flags.partyEnabled', true obj.flags.partyEnabled = true + if !obj.flags.petsEnabled and obj.stats.lvl >= 4 + batch.set 'flags.petsEnabled', true + obj.flags.petsEnabled = true if newStats.gp? #FIXME what was I doing here? I can't remember, gp isn't defined diff --git a/views/app/index.html b/views/app/index.html index 7dadb79846..e4ec4d02dc 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -364,76 +364,65 @@ do a find for the string after "→" -
+ {#if _user.flags.petsEnabled} +
-
-
- -
    - {#each _rewardList as :task}{/} -
+
+
+ +
+ +
+ {#with _view.items.pets as :pets} + +
+ {#with :pets[0]}{/} + {#with :pets[1]}{/} + {#with :pets[2]}{/} + {#with :pets[3]}{/} +
+ +
+ {#with :pets[4]}{/} + {#with :pets[5]}{/} + {#with :pets[6]}{/} + {#with :pets[7]}{/} +
+ +
+ {#with :pets[8]}{/} + {#with :pets[9]}{/} + {#with :pets[10]}{/} + {#with :pets[11]}{/} +
+ +
+ {#with :pets[12]}{/} + {#with :pets[13]}{/} + {#with :pets[14]}{/} + {#with :pets[15]}{/} +
+ +
+ {#with :pets[16]}{/} +
- {#if _user.flags.itemsEnabled} -
    - {#with _view.items.weapon as :item}{/} - {#with _view.items.armor as :item}{/} - {#with _view.items.head as :item}{/} - {#with _view.items.shield as :item}{/} - {#with _view.items.potion as :item}{/} - {#with _view.items.reroll as :item}{/} -
- {/} + {/} +
+
-
- {#with _view.items.pets as :pets} -
- {#with :pets[0]}{/} - {#with :pets[1]}{/} - {#with :pets[2]}{/} - {#with :pets[3]}{/} -
- -
- {#with :pets[4]}{/} - {#with :pets[5]}{/} - {#with :pets[6]}{/} - {#with :pets[7]}{/} -
- -
- {#with :pets[8]}{/} - {#with :pets[9]}{/} - {#with :pets[10]}{/} - {#with :pets[11]}{/} -
- -
- {#with :pets[12]}{/} - {#with :pets[13]}{/} - {#with :pets[14]}{/} - {#with :pets[15]}{/} -
- -
- {#with :pets[16]}{/} -
- - - {/} -
-
...
+
- - - -
+ {else} + + {/}
@@ -481,6 +470,23 @@ do a find for the string after "→"
+ + + + + {#if _user.flags.itemsEnabled} + + {/} +