Fixing flag coloring in new WebGL rendering.

This commit is contained in:
Nick Winter 2014-10-18 18:18:12 -07:00
parent 24da2aa80a
commit 66c728210b
2 changed files with 4 additions and 9 deletions

View file

@ -500,8 +500,8 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
renderGroupingKey: (thangType, grouping, colorConfig) ->
key = thangType.get('slug')
if colorConfig?.team
key += "(#{colorConfig.team.hue},#{colorConfig.team.saturation},#{colorConfig.team.lightness})"
for colorKey, colorValue of colorConfig ? {}
key += "(#{colorKey}:#{colorValue.hue},#{colorValue.saturation},#{colorValue.lightness})"
key += '.'+grouping if grouping
key

View file

@ -43,7 +43,7 @@ module.exports = class ThangType extends CocoModel
isFullyLoaded: ->
# TODO: Come up with a better way to identify when the model doesn't have everything needed to build the sprite. ie when it's a projection without all the required data.
return @get('actions') or @get('raster') # needs one of these two things
loadRasterImage: ->
return if @loadingRaster or @loadedRaster
return unless raster = @get('raster')
@ -57,7 +57,7 @@ module.exports = class ThangType extends CocoModel
@loadingRaster = false
@trigger('raster-image-load-errored', @)
)
getActions: ->
return {} unless @isFullyLoaded()
return @actions or @buildActions()
@ -72,11 +72,6 @@ module.exports = class ThangType extends CocoModel
@actions[relatedAction.name] = relatedAction
@actions
getSpriteSheet: (options) ->
options = @fillOptions options
key = @spriteSheetKey(options)
return @spriteSheets[key] or @buildSpriteSheet(options)
fillOptions: (options) ->
options ?= {}
options = _.clone options