Add food drop and avatar stable

This commit is contained in:
Daniel Saewitz 2013-03-09 15:34:48 -05:00
parent 9f172cb627
commit aece4b1a41
2 changed files with 23 additions and 4 deletions

View file

@ -1,5 +1,5 @@
{ randomProp } = require './helpers'
{ pets } = require('./items').items
{ pets, food } = require('./items').items
###
app exports
@ -10,14 +10,15 @@ module.exports.app = (appExports, model) ->
user.on 'set', 'flags.dropsEnabled', (captures, args) ->
return unless captures == true
egg = randomProp pets
droppedEgg = randomProp pets
droppedFood = randomProp pets
user.push 'items.eggs', egg.name
user.push 'items.eggs', droppedEgg.name
user.push 'items.food', droppedFood.name
# do drops enabled stuff
$('#dropsEnabled-modal').show()
appExports.selectPet = (e, el) ->
name = $(el).attr('data-pet')
pet = _.findWhere pets, {name:name}

View file

@ -7,6 +7,7 @@
<li><a data-toggle='tab' href="#profileEdit">Profile</a></li>
{#if _user.flags.dropsEnabled}
<li><a data-toggle='tab' href="#profileInventory">Inventory</a></li>
<li><a data-toggle='tab' href="#profileStable">Stable</a></li>
{/if}
</ul>
@ -22,6 +23,9 @@
<div class="tab-pane" id="profileInventory">
<app:avatar:inventory user="{_user}" main="true" />
</div>
<div class="tab-pane" id="profileStable">
<app:avatar:stable user="{_user}" main="true" />
</div>
</div>
{/}
{else}
@ -201,3 +205,17 @@
{/each}
</div>
</div>
<stable:>
<div class='row-fluid'>
<div class='span6 well'>
<h3>Stable</h3>
{#if not(_user.items.pets)}
<p>You don't have any pets yet.</p>
{/if}
{#each _user.items.pets as :pet}
<p>{:pet}</p>
{/each}
</div>
</div>