Fixed a few minor bugs.
This commit is contained in:
parent
3125c2b129
commit
1a7e4554f0
4 changed files with 8 additions and 1 deletions
app
lib
views/play/level
|
@ -78,6 +78,10 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
@listenToOnce @opponentSession, 'sync', @loadDependenciesForSession
|
@listenToOnce @opponentSession, 'sync', @loadDependenciesForSession
|
||||||
|
|
||||||
loadDependenciesForSession: (session) ->
|
loadDependenciesForSession: (session) ->
|
||||||
|
return if @levelID is 'sky-span' # TODO
|
||||||
|
# TODO: I think this runs afoul of https://github.com/codecombat/codecombat/issues/1108
|
||||||
|
# TODO: this shouldn't happen when it's not a hero level, but we don't have level loaded yet,
|
||||||
|
# and the sessions are being created with default hero config regardless of whether it's a hero level.
|
||||||
if heroConfig = session.get('heroConfig')
|
if heroConfig = session.get('heroConfig')
|
||||||
url = "/db/thang.type/#{heroConfig.thangType}/version?project=name,components,original"
|
url = "/db/thang.type/#{heroConfig.thangType}/version?project=name,components,original"
|
||||||
@worldNecessities.push @maybeLoadURL(url, ThangType, 'thang')
|
@worldNecessities.push @maybeLoadURL(url, ThangType, 'thang')
|
||||||
|
|
|
@ -321,6 +321,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
@lastPos = p1.copy?() or _.clone(p1)
|
@lastPos = p1.copy?() or _.clone(p1)
|
||||||
@hasMoved = true
|
@hasMoved = true
|
||||||
if @thangType.get('name') is 'Flag' and not @notOfThisWorld
|
if @thangType.get('name') is 'Flag' and not @notOfThisWorld
|
||||||
|
# Let the pending flags know we're here (but not this call stack, they need to delete themselves, and we may be iterating sprites).
|
||||||
_.defer => Backbone.Mediator.publish 'surface:flag-appeared', sprite: @
|
_.defer => Backbone.Mediator.publish 'surface:flag-appeared', sprite: @
|
||||||
|
|
||||||
updateBaseScale: ->
|
updateBaseScale: ->
|
||||||
|
@ -521,7 +522,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
@letterboxOn = e.on
|
@letterboxOn = e.on
|
||||||
|
|
||||||
onMouseEvent: (e, ourEventName) ->
|
onMouseEvent: (e, ourEventName) ->
|
||||||
return if @letterboxOn
|
return if @letterboxOn or not @imageObject
|
||||||
p = @imageObject
|
p = @imageObject
|
||||||
p = p.parent while p.parent
|
p = p.parent while p.parent
|
||||||
newEvent = sprite: @, thang: @thang, originalEvent: e, canvas:p.canvas
|
newEvent = sprite: @, thang: @thang, originalEvent: e, canvas:p.canvas
|
||||||
|
|
|
@ -38,6 +38,7 @@ module.exports = class LevelFlagsView extends CocoView
|
||||||
|
|
||||||
onRealTimePlaybackEnded: (e) ->
|
onRealTimePlaybackEnded: (e) ->
|
||||||
@realTime = false
|
@realTime = false
|
||||||
|
@onFlagSelected color: null
|
||||||
@$el.hide()
|
@$el.hide()
|
||||||
|
|
||||||
onFlagSelected: (e) ->
|
onFlagSelected: (e) ->
|
||||||
|
|
|
@ -209,6 +209,7 @@ module.exports = class TomeView extends CocoView
|
||||||
|
|
||||||
spellFor: (thang, spellName) ->
|
spellFor: (thang, spellName) ->
|
||||||
return null unless thang?.isProgrammable
|
return null unless thang?.isProgrammable
|
||||||
|
return unless @thangSpells[thang.id] # Probably in streaming mode, where we don't update until it's done.
|
||||||
selectedThangSpells = (@spells[spellKey] for spellKey in @thangSpells[thang.id])
|
selectedThangSpells = (@spells[spellKey] for spellKey in @thangSpells[thang.id])
|
||||||
if spellName
|
if spellName
|
||||||
spell = _.find selectedThangSpells, {name: spellName}
|
spell = _.find selectedThangSpells, {name: spellName}
|
||||||
|
|
Reference in a new issue