mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-10 21:28:02 -04:00
Do not automatically show victory modal for shareable game dev levels
Students are likely to want to keep working on their level, even if they beat it.
This commit is contained in:
parent
d14bea3110
commit
ffa840910d
3 changed files with 6 additions and 4 deletions
|
@ -117,6 +117,7 @@ module.exports =
|
|||
|
||||
'level:show-victory': c.object {required: ['showModal']},
|
||||
showModal: {type: 'boolean'}
|
||||
manual: { type: 'boolean' }
|
||||
|
||||
'level:highlight-dom': c.object {required: ['selector']},
|
||||
selector: {type: 'string'}
|
||||
|
|
|
@ -548,9 +548,9 @@ module.exports = class PlayLevelView extends RootView
|
|||
|
||||
onDonePressed: -> @showVictory()
|
||||
|
||||
onShowVictory: (e) ->
|
||||
onShowVictory: (e={}) ->
|
||||
$('#level-done-button').show() unless @level.isType('hero', 'hero-ladder', 'hero-coop', 'course', 'course-ladder', 'game-dev', 'web-dev')
|
||||
@showVictory() if e.showModal
|
||||
@showVictory(_.pick(e, 'manual')) if e.showModal
|
||||
return if @victorySeen
|
||||
@victorySeen = true
|
||||
victoryTime = (new Date()) - @loadEndTime
|
||||
|
@ -563,8 +563,9 @@ module.exports = class PlayLevelView extends RootView
|
|||
ls: @session?.get('_id')
|
||||
application.tracker?.trackTiming victoryTime, 'Level Victory Time', @levelID, @levelID
|
||||
|
||||
showVictory: ->
|
||||
showVictory: (options={}) ->
|
||||
return if @level.hasLocalChanges() # Don't award achievements when beating level changed in level editor
|
||||
return if @level.isType('game-dev') and @level.get('shareable') and not options.manual
|
||||
@endHighlight()
|
||||
options = {level: @level, supermodel: @supermodel, session: @session, hasReceivedMemoryWarning: @hasReceivedMemoryWarning, courseID: @courseID, courseInstanceID: @courseInstanceID, world: @world}
|
||||
ModalClass = if @level.isType('hero', 'hero-ladder', 'hero-coop', 'course', 'course-ladder', 'game-dev', 'web-dev') then HeroVictoryModal else VictoryModal
|
||||
|
|
|
@ -81,7 +81,7 @@ module.exports = class CastButtonView extends CocoView
|
|||
onDoneButtonClick: (e) ->
|
||||
return if @options.level.hasLocalChanges() # Don't award achievements when beating level changed in level editor
|
||||
@options.session.recordScores @world?.scores, @options.level
|
||||
Backbone.Mediator.publish 'level:show-victory', showModal: true
|
||||
Backbone.Mediator.publish 'level:show-victory', { showModal: true, manual: true }
|
||||
|
||||
onSpellChanged: (e) ->
|
||||
@updateCastButton()
|
||||
|
|
Loading…
Reference in a new issue