mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 08:38:09 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
a806351a2a
6 changed files with 25 additions and 13 deletions
|
@ -153,7 +153,7 @@ class CocoModel extends Backbone.Model
|
|||
console.warn errorMessage, res.responseJSON
|
||||
unless webkit?.messageHandlers # Don't show these notys on iPad
|
||||
try
|
||||
noty text: "#{errorMessage}: #{res.status} #{res.statusText}", layout: 'topCenter', type: 'error', killer: false, timeout: 10000
|
||||
noty text: "#{errorMessage}: #{res.status} #{res.statusText}\n#{res.responseText}", layout: 'topCenter', type: 'error', killer: false, timeout: 10000
|
||||
catch notyError
|
||||
console.warn "Couldn't even show noty error for", error, "because", notyError
|
||||
options.success = options.error = null # So the callbacks can be garbage-collected.
|
||||
|
|
|
@ -282,8 +282,8 @@ module.exports = class ThangType extends CocoModel
|
|||
sprite = vectorParser.buildContainerFromStore(portrait.container)
|
||||
|
||||
pt = portrait.positions?.registration
|
||||
sprite.regX = pt?.x or 0
|
||||
sprite.regY = pt?.y or 0
|
||||
sprite.regX = pt?.x / scale or 0
|
||||
sprite.regY = pt?.y / scale or 0
|
||||
sprite.scaleX = sprite.scaleY = scale * size / 100
|
||||
stage.addChild(sprite)
|
||||
stage.update()
|
||||
|
|
|
@ -17,18 +17,19 @@ block modal-body-content
|
|||
div.achievement-description= achievement.get('description')
|
||||
|
||||
div.achievement-rewards
|
||||
- var worth = achievement.get('worth', true);
|
||||
- var worth = achievement.worth;
|
||||
- var gems = achievement.gems;
|
||||
if worth
|
||||
.reward-panel.numerical.xp(data-number=worth, data-number-unit='xp')
|
||||
.reward-image-container(class=animate ? 'pending-reward-image' : 'show')
|
||||
img(src="/images/pages/play/level/modal/reward_icon_xp.png")
|
||||
.reward-text= animate ? '+0' : '+'+worth
|
||||
|
||||
if rewards.gems
|
||||
.reward-panel.numerical.gems(data-number=rewards.gems, data-number-unit='gem')
|
||||
if gems
|
||||
.reward-panel.numerical.gems(data-number=gems, data-number-unit='gem')
|
||||
.reward-image-container(class=animate ? 'pending-reward-image' : 'show')
|
||||
img(src="/images/pages/play/level/modal/reward_icon_gems.png")
|
||||
.reward-text= animate ? '+0' : '+'+rewards.gems
|
||||
.reward-text= animate ? '+0' : '+'+gems
|
||||
|
||||
if rewards.heroes
|
||||
for hero in rewards.heroes
|
||||
|
|
|
@ -76,8 +76,8 @@ module.exports = class VectorIconSetupModal extends ModalView
|
|||
|
||||
updateSpriteProperties: ->
|
||||
@sprite.scaleX = @sprite.scaleY = @scale * @demoSize / 100
|
||||
@sprite.regX = @regX
|
||||
@sprite.regY = @regY
|
||||
@sprite.regX = @regX / @scale
|
||||
@sprite.regY = @regY / @scale
|
||||
console.log 'set to', @scale, @regX, @regY
|
||||
|
||||
onClickCenter: ->
|
||||
|
@ -91,6 +91,8 @@ module.exports = class VectorIconSetupModal extends ModalView
|
|||
@regY += (b[3] - b[2]) / 2
|
||||
else
|
||||
@regX += (b[2] - b[3]) / 2
|
||||
@regX *= @scale
|
||||
@regY *= @scale
|
||||
@updateSpriteProperties()
|
||||
@stage.update()
|
||||
|
||||
|
|
|
@ -162,5 +162,6 @@ module.exports = class I18NEditModelView extends RootView
|
|||
return button.text('Failed to Submit Changes') if errors
|
||||
res = modelToSave.save(null, {type: 'POST'}) # Override PUT so we can trigger postNewVersion logic
|
||||
return button.text('Failed to Submit Changes') unless res
|
||||
button.text('Submitting...')
|
||||
res.error => button.text('Error Submitting Changes')
|
||||
res.success => button.text('Submit Changes')
|
||||
|
|
|
@ -84,7 +84,7 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
@listenToOnce me, 'sync', ->
|
||||
@readyToContinue = true
|
||||
@updateSavingProgressStatus()
|
||||
me.fetch cache:false unless me.loading
|
||||
me.fetch cache: false unless me.loading
|
||||
|
||||
@readyToContinue = true if not @achievements.models.length
|
||||
|
||||
|
@ -96,7 +96,17 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
earnedAchievement = earnedAchievementMap[achievement.id]
|
||||
if earnedAchievement
|
||||
achievement.completedAWhileAgo = new Date() - Date.parse(earnedAchievement.get('created')) > 30 * 1000
|
||||
c.achievements = @achievements.models
|
||||
achievement.worth = achievement.get 'worth', true
|
||||
achievement.gems = achievement.get('rewards')?.gems
|
||||
c.achievements = @achievements.models.slice()
|
||||
for achievement in c.achievements
|
||||
continue unless @supermodel.finished() and proportionalTo = achievement.get 'proportionalTo'
|
||||
# For repeatable achievements, we modify their base worth/gems by their repeatable growth functions.
|
||||
achievedAmount = utils.getByPath @session.attributes, proportionalTo
|
||||
func = achievement.getExpFunction()
|
||||
achievement.worth = (achievement.get('worth') ? 0) * func achievedAmount
|
||||
rewards = achievement.get 'rewards'
|
||||
achievement.gems = rewards?.gems * func achievedAmount if rewards?.gems
|
||||
|
||||
# for testing the three states
|
||||
#if c.achievements.length
|
||||
|
@ -110,8 +120,6 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
# rewards = achievement.get('rewards') or {}
|
||||
# rewards.gems *= (index + 1)
|
||||
|
||||
# TODO: use earned achievement worths or somehow pull in recalculated exp/gems
|
||||
|
||||
c.thangTypes = @thangTypes
|
||||
c.me = me
|
||||
c.readyToRank = @level.get('type', true) is 'hero-ladder' and @session.readyToRank()
|
||||
|
|
Loading…
Reference in a new issue