mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-19 17:39:56 -04:00
Fixed some more gold view stuff.
This commit is contained in:
parent
2ec225b0d0
commit
a7179ae3b2
3 changed files with 6 additions and 3 deletions
app
|
@ -598,7 +598,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
gold = Math.floor @thang.gold
|
||||
return if gold is @lastGold
|
||||
@lastGold = gold
|
||||
Backbone.Mediator.publish 'surface:gold-changed', {team: @thang.team, gold: gold}
|
||||
Backbone.Mediator.publish 'surface:gold-changed', {team: @thang.team, gold: gold, goldEarned: Math.floor(@thang.goldEarned)}
|
||||
|
||||
playSounds: (withDelay=true, volume=1.0) ->
|
||||
for event in @thang.currentEvents ? []
|
||||
|
|
|
@ -42,4 +42,4 @@
|
|||
|
||||
.gold-amount
|
||||
display: inline-block
|
||||
width: 20px
|
||||
min-width: 20px
|
||||
|
|
|
@ -16,7 +16,10 @@ module.exports = class GoldView extends View
|
|||
teamEl = $("<div class='team-gold team-#{e.team}' title='Gold: #{e.team}'><img src='/images/level/prop_gold.png'> <div class='gold-amount team-#{e.team}'></div></div>")
|
||||
@$el.append(teamEl)
|
||||
goldEl = teamEl.find('.gold-amount.team-' + e.team)
|
||||
goldEl.text(e.gold)
|
||||
text = '' + e.gold
|
||||
if e.goldEarned and e.goldEarned > e.gold
|
||||
text += " (#{e.goldEarned})"
|
||||
goldEl.text text
|
||||
|
||||
onSetLetterbox: (e) ->
|
||||
@$el.toggle not e.on
|
||||
|
|
Loading…
Reference in a new issue