Use ?intro=true to show intro screen even after level completion
This commit is contained in:
parent
2259076800
commit
7e433b9e12
2 changed files with 7 additions and 6 deletions
app/views/play/level
|
@ -75,9 +75,7 @@ module.exports = class LevelLoadingView extends CocoView
|
||||||
prepareIntro: ->
|
prepareIntro: ->
|
||||||
@docs = @level.get('documentation') ? {}
|
@docs = @level.get('documentation') ? {}
|
||||||
specific = @docs.specificArticles or []
|
specific = @docs.specificArticles or []
|
||||||
return unless @intro = _.find specific, name: 'Intro'
|
@intro = _.find specific, name: 'Intro'
|
||||||
@intro.html = marked utils.filterMarkdownCodeLanguages(utils.i18n(@intro, 'body'))
|
|
||||||
@intro.name = utils.i18n @intro, 'name'
|
|
||||||
|
|
||||||
showReady: ->
|
showReady: ->
|
||||||
return if @shownReady
|
return if @shownReady
|
||||||
|
@ -86,7 +84,9 @@ module.exports = class LevelLoadingView extends CocoView
|
||||||
|
|
||||||
finishShowingReady: =>
|
finishShowingReady: =>
|
||||||
return if @destroyed
|
return if @destroyed
|
||||||
if @options.autoUnveil or (@session?.get('state').complete and not @getQueryVariable('intro'))
|
showIntro = @getQueryVariable('intro')
|
||||||
|
autoUnveil = not showIntro and (@options.autoUnveil or @session?.get('state').complete)
|
||||||
|
if autoUnveil
|
||||||
@startUnveiling()
|
@startUnveiling()
|
||||||
@unveil true
|
@unveil true
|
||||||
else
|
else
|
||||||
|
@ -166,7 +166,8 @@ module.exports = class LevelLoadingView extends CocoView
|
||||||
|
|
||||||
unveilIntro: =>
|
unveilIntro: =>
|
||||||
return if @destroyed or not @intro or @unveiled
|
return if @destroyed or not @intro or @unveiled
|
||||||
@$el.find('.intro-doc').html @intro.html
|
html = marked utils.filterMarkdownCodeLanguages(utils.i18n(@intro, 'body'))
|
||||||
|
@$el.find('.intro-doc').html html
|
||||||
@resize()
|
@resize()
|
||||||
|
|
||||||
onUnveilEnded: =>
|
onUnveilEnded: =>
|
||||||
|
|
|
@ -341,7 +341,7 @@ module.exports = class PlayLevelView extends RootView
|
||||||
return Backbone.Mediator.subscribeOnce 'modal:closed', @onLevelStarted, @
|
return Backbone.Mediator.subscribeOnce 'modal:closed', @onLevelStarted, @
|
||||||
@surface.showLevel()
|
@surface.showLevel()
|
||||||
Backbone.Mediator.publish 'level:set-time', time: 0
|
Backbone.Mediator.publish 'level:set-time', time: 0
|
||||||
if @isEditorPreview or @observing
|
if (@isEditorPreview or @observing) and not @getQueryVariable('intro')
|
||||||
@loadingView.startUnveiling()
|
@loadingView.startUnveiling()
|
||||||
@loadingView.unveil true
|
@loadingView.unveil true
|
||||||
|
|
||||||
|
|
Reference in a new issue