From 3d5e3c77439dcfe4a2eff1b716c782bd99373d09 Mon Sep 17 00:00:00 2001 From: Daniel Saewitz Date: Wed, 13 Mar 2013 11:47:37 -0400 Subject: [PATCH] Fix modals --- src/app/pets.coffee | 5 ++--- src/app/scoring.coffee | 4 ++-- views/app/pets.html | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/pets.coffee b/src/app/pets.coffee index 1c67a50028..3e9d7cad1c 100644 --- a/src/app/pets.coffee +++ b/src/app/pets.coffee @@ -18,8 +18,7 @@ module.exports.app = (appExports, model) -> user.push 'items.eggs', egg model._dontPersist = true if dontPersist - # do drops enabled stuff - $('#dropsEnabled-modal').show() + $('#drops-enabled-modal').modal 'show' appExports.selectPet = (e, el) -> name = $(el).attr('data-pet') @@ -36,4 +35,4 @@ module.exports.app = (appExports, model) -> user.set 'items.currentPet', pet user.set 'balance', (tokens - pet.value)/4 else - $('#more-tokens-modal').modal('show') + $('#more-tokens-modal').modal 'show' diff --git a/src/app/scoring.coffee b/src/app/scoring.coffee index 4c6cc68525..0baab23fcd 100644 --- a/src/app/scoring.coffee +++ b/src/app/scoring.coffee @@ -108,7 +108,7 @@ score = (model, taskId, direction, times, batch, cron) -> updateStats model, {hp: hp, exp: exp, gp: gp}, batch # 1% chance of getting a pet or meat - if Math.random() < .01 + if obj.flags.dropsEnabled and Math.random() < .01 if Math.random() < .5 drop = randomProp(food) user.push 'items.food', drop.name @@ -119,7 +119,7 @@ score = (model, taskId, direction, times, batch, cron) -> drop.type = 'egg' model.set '_drop', drop - $('#itemDropped-modal').show() + $('#item-dropped-modal').modal 'show' if commit # newStats / origStats is a glorious hack to trick Derby into seeing the change in model.on(*) diff --git a/views/app/pets.html b/views/app/pets.html index 9c025105d3..a6e4e19bd5 100644 --- a/views/app/pets.html +++ b/views/app/pets.html @@ -1,5 +1,5 @@ - +

You've unlocked the drop system.

Here's your first egg! {_user.items.eggs.0.text}

Feed it some meat to get it to hatch.

@@ -7,7 +7,7 @@
- +

An item has dropped!

Here's your first {_drop.type} – {_drop.text}!

{_drop.notes}