mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Fix colorConfig prerendered sprite sheet data, comparison
This commit is contained in:
parent
39bddb889e
commit
1085731fdd
3 changed files with 7 additions and 3 deletions
|
@ -523,7 +523,8 @@ module.exports = class ThangType extends CocoModel
|
|||
return false if pss.get('spriteType') isnt spriteType
|
||||
otherColorConfig = pss.get('colorConfig')
|
||||
return true if _.isEmpty(colorConfig) and _.isEmpty(otherColorConfig)
|
||||
return _.isEqual(colorConfig and otherColorConfig)
|
||||
getHue = (config) -> _.result(_.result(config, 'team'), 'hue')
|
||||
return getHue(colorConfig) is getHue(otherColorConfig)
|
||||
|
||||
getPrerenderedSpriteSheetToLoad: ->
|
||||
return unless @prerenderedSpriteSheets
|
||||
|
|
|
@ -184,7 +184,7 @@ _.extend ThangTypeSchema.properties,
|
|||
speed: { type: 'number' }
|
||||
}
|
||||
}
|
||||
colorConfig: c.colorConfig()
|
||||
colorConfig: c.object {additionalProperties: c.colorConfig()}
|
||||
colorLabel: { enum: ['red', 'green', 'blue'] }
|
||||
frames:
|
||||
type: 'array'
|
||||
|
|
|
@ -20,7 +20,10 @@ module.exports = class ExportThangTypeModal extends ModalView
|
|||
green: { hue: 0.33, saturation: 0.75, lightness: 0.5 }
|
||||
}
|
||||
getColorLabel: -> @$('#color-config-select').val()
|
||||
getColorConfig: -> @colorMap[@getColorLabel()]
|
||||
getColorConfig: ->
|
||||
color = @colorMap[@getColorLabel()]
|
||||
return { team: color } if color
|
||||
return null
|
||||
getActionNames: -> _.map @$('input[name="action"]:checked'), (el) -> $(el).val()
|
||||
getResolutionFactor: -> parseInt(@$('#resolution-input').val()) or SPRITE_RESOLUTION_FACTOR
|
||||
getFilename: -> 'spritesheet-'+_.string.slugify(moment().format())+'.png'
|
||||
|
|
Loading…
Reference in a new issue