mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 14:33:59 -04:00
Fixed #2452: handling four and even five-digit gem/xp totals in victory screen.
This commit is contained in:
parent
a1199a0121
commit
0d81f658ae
2 changed files with 13 additions and 0 deletions
app
|
@ -253,6 +253,15 @@
|
|||
font-weight: bold
|
||||
color: rgb(40, 33, 22)
|
||||
margin-right: 12px
|
||||
width: 78px
|
||||
|
||||
&.four-digits
|
||||
font-size: 40px
|
||||
margin-top: 3px
|
||||
|
||||
&.five-digits
|
||||
font-size: 30px
|
||||
margin-top: 10px
|
||||
|
||||
.total-label
|
||||
float: left
|
||||
|
|
|
@ -229,6 +229,8 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
@updateXPBars(totalXP)
|
||||
xpTrigger = 'xp-' + (totalXP % 6) # 6 xp sounds
|
||||
Backbone.Mediator.publish 'audio-player:play-sound', trigger: xpTrigger, volume: 0.5 + ratio / 2
|
||||
@XPEl.addClass 'four-digits' if totalXP >= 1000 and @lastTotalXP < 1000
|
||||
@XPEl.addClass 'five-digits' if totalXP >= 10000 and @lastTotalXP < 10000
|
||||
@lastTotalXP = totalXP
|
||||
else if panel.unit is 'gem'
|
||||
newGems = Math.floor(panel.previousNumber + ratio * (panel.number - panel.previousNumber))
|
||||
|
@ -238,6 +240,8 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
@gemEl.text(totalGems)
|
||||
gemTrigger = 'gem-' + (parseInt(panel.number * ratio) % 4) # 4 gem sounds
|
||||
Backbone.Mediator.publish 'audio-player:play-sound', trigger: gemTrigger, volume: 0.5 + ratio / 2
|
||||
@gemEl.addClass 'four-digits' if totalGems >= 1000 and @lastTotalGems < 1000
|
||||
@gemEl.addClass 'five-digits' if totalGems >= 10000 and @lastTotalGems < 10000
|
||||
@lastTotalGems = totalGems
|
||||
else if panel.item
|
||||
thangType = @thangTypes[panel.item]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue