Fix modals

This commit is contained in:
Daniel Saewitz 2013-03-13 11:47:37 -04:00
parent 4485d226e8
commit 3d5e3c7743
3 changed files with 6 additions and 7 deletions

View file

@ -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'

View file

@ -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(*)

View file

@ -1,5 +1,5 @@
<modals:>
<app:modals:modal modalId='dropsEnabled-modal' header="Drops Enabled!">
<app:modals:modal modalId='drops-enabled-modal' header="Drops Enabled!">
<p>You've unlocked the drop system.</p>
<p>Here's your first egg! {_user.items.eggs.0.text}</p>
<p>Feed it some meat to get it to hatch.</p>
@ -7,7 +7,7 @@
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</@footer>
</app:modals:modal>
<app:modals:modal modalId='itemDropped-modal' header="Item Dropped!">
<app:modals:modal modalId='item-dropped-modal' header="Item Dropped!">
<p>An item has dropped!</p>
<p>Here's your first {_drop.type} {_drop.text}!</p>
<p>{_drop.notes}</p>