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
|
change: @pushChangesToPreview
|
||||||
@treema = @$el.find('#achievement-treema').treema(options)
|
@treema = @$el.find('#achievement-treema').treema(options)
|
||||||
@treema.build()
|
@treema.build()
|
||||||
|
@pushChangesToPreview()
|
||||||
|
|
||||||
getRenderData: (context={}) ->
|
getRenderData: (context={}) ->
|
||||||
context = super(context)
|
context = super(context)
|
||||||
|
@ -54,6 +55,7 @@ module.exports = class AchievementEditView extends RootView
|
||||||
@pushChangesToPreview()
|
@pushChangesToPreview()
|
||||||
|
|
||||||
pushChangesToPreview: =>
|
pushChangesToPreview: =>
|
||||||
|
return unless @treema
|
||||||
@$el.find('#achievement-view').empty()
|
@$el.find('#achievement-view').empty()
|
||||||
for key, value of @treema.data
|
for key, value of @treema.data
|
||||||
@achievement.set key, value
|
@achievement.set key, value
|
||||||
|
|
|
@ -14,7 +14,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView
|
||||||
super options
|
super options
|
||||||
@supermodel.loadModel @thangType, 'thang'
|
@supermodel.loadModel @thangType, 'thang'
|
||||||
@colorConfig = {hue: 0, saturation: 0.5, lightness: 0.5}
|
@colorConfig = {hue: 0, saturation: 0.5, lightness: 0.5}
|
||||||
@spriteBuilder = new SpriteBuilder(@thangType)
|
@spriteBuilder = new SpriteBuilder(@thangType) if @thangType.get('raw')
|
||||||
f = =>
|
f = =>
|
||||||
@offset++
|
@offset++
|
||||||
@updateMovieClip()
|
@updateMovieClip()
|
||||||
|
@ -54,7 +54,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView
|
||||||
@updateMovieClip()
|
@updateMovieClip()
|
||||||
|
|
||||||
updateMovieClip: ->
|
updateMovieClip: ->
|
||||||
return unless @currentColorGroupTreema
|
return unless @currentColorGroupTreema and @thangType.get('raw')
|
||||||
actionDict = @thangType.getActions()
|
actionDict = @thangType.getActions()
|
||||||
animations = (a.animation for key, a of actionDict when a.animation)
|
animations = (a.animation for key, a of actionDict when a.animation)
|
||||||
index = @offset % animations.length
|
index = @offset % animations.length
|
||||||
|
@ -74,6 +74,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView
|
||||||
@stage.addChild @movieClip
|
@stage.addChild @movieClip
|
||||||
|
|
||||||
updateContainer: ->
|
updateContainer: ->
|
||||||
|
return unless @thangType.get('raw')
|
||||||
actionDict = @thangType.getActions()
|
actionDict = @thangType.getActions()
|
||||||
idle = actionDict.idle
|
idle = actionDict.idle
|
||||||
@stage.removeChild(@container) if @container
|
@stage.removeChild(@container) if @container
|
||||||
|
|
Reference in a new issue