mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
A couple achievment/item editor error fixes.
This commit is contained in:
parent
434a0c071b
commit
68dcdaf223
2 changed files with 5 additions and 2 deletions
app/views/editor
|
@ -41,6 +41,7 @@ module.exports = class AchievementEditView extends RootView
|
|||
change: @pushChangesToPreview
|
||||
@treema = @$el.find('#achievement-treema').treema(options)
|
||||
@treema.build()
|
||||
@pushChangesToPreview()
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
|
@ -54,6 +55,7 @@ module.exports = class AchievementEditView extends RootView
|
|||
@pushChangesToPreview()
|
||||
|
||||
pushChangesToPreview: =>
|
||||
return unless @treema
|
||||
@$el.find('#achievement-view').empty()
|
||||
for key, value of @treema.data
|
||||
@achievement.set key, value
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView
|
|||
super options
|
||||
@supermodel.loadModel @thangType, 'thang'
|
||||
@colorConfig = {hue: 0, saturation: 0.5, lightness: 0.5}
|
||||
@spriteBuilder = new SpriteBuilder(@thangType)
|
||||
@spriteBuilder = new SpriteBuilder(@thangType) if @thangType.get('raw')
|
||||
f = =>
|
||||
@offset++
|
||||
@updateMovieClip()
|
||||
|
@ -54,7 +54,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView
|
|||
@updateMovieClip()
|
||||
|
||||
updateMovieClip: ->
|
||||
return unless @currentColorGroupTreema
|
||||
return unless @currentColorGroupTreema and @thangType.get('raw')
|
||||
actionDict = @thangType.getActions()
|
||||
animations = (a.animation for key, a of actionDict when a.animation)
|
||||
index = @offset % animations.length
|
||||
|
@ -74,6 +74,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView
|
|||
@stage.addChild @movieClip
|
||||
|
||||
updateContainer: ->
|
||||
return unless @thangType.get('raw')
|
||||
actionDict = @thangType.getActions()
|
||||
idle = actionDict.idle
|
||||
@stage.removeChild(@container) if @container
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue