mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 15:48:11 -05:00
Basic campaign mode victory modal hookup for web-dev levels
This commit is contained in:
parent
739973cb47
commit
1e89775486
12 changed files with 25 additions and 11 deletions
|
@ -1877,6 +1877,9 @@
|
|||
vectors: "Vectors"
|
||||
while_loops: "While Loops"
|
||||
recursion: "Recursion"
|
||||
basic_html: "Basic HTML" # TODO: these web-dev concepts will change, don't need to translate
|
||||
basic_css: "Basic CSS"
|
||||
basic_web_scripting: "Basic Web Scripting"
|
||||
|
||||
delta:
|
||||
added: "Added"
|
||||
|
|
|
@ -74,6 +74,7 @@ module.exports = class LevelSession extends CocoModel
|
|||
wait
|
||||
|
||||
recordScores: (scores, level) ->
|
||||
return unless scores
|
||||
state = @get 'state'
|
||||
oldTopScores = state.topScores ? []
|
||||
newTopScores = []
|
||||
|
|
|
@ -261,4 +261,7 @@ me.concept = me.shortString enum: [
|
|||
'vectors'
|
||||
'while_loops'
|
||||
'recursion'
|
||||
'basic_html'
|
||||
'basic_css'
|
||||
'basic_web_scripting'
|
||||
]
|
||||
|
|
|
@ -74,6 +74,13 @@ $UNVEIL_TIME: 1.2s
|
|||
.progress-or-start-container.intro-footer
|
||||
bottom: 30px
|
||||
|
||||
@media screen and ( min-height: 900px )
|
||||
background: transparent
|
||||
border: 1px solid transparent
|
||||
border-width: 124px 76px 64px 40px
|
||||
border-image: url(/images/level/code_editor_background.png) 124 76 64 40 fill round
|
||||
padding: 0 35px 0 15px
|
||||
|
||||
.level-loading-goals
|
||||
text-align: left
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ block content
|
|||
tr
|
||||
td
|
||||
if previousLevelCompleted || view.teacherMode || !passedLastCompletedLevel || levelStatus
|
||||
- var i18n = level.get('type') === 'course-ladder' ? 'play.compete' : 'home.play';
|
||||
- var i18n = level.isType('course-ladder') ? 'play.compete' : 'home.play';
|
||||
button.btn.btn-success.btn-play-level(data-level-slug=level.get('slug'), data-i18n=i18n, data-level-id=level.get('original'))
|
||||
if view.showGameDevButtons
|
||||
- var levelOriginal = level.get('original');
|
||||
|
|
|
@ -64,7 +64,7 @@ block header
|
|||
a
|
||||
span.glyphicon-floppy-disk.glyphicon
|
||||
|
||||
if level.get('type') === 'ladder'
|
||||
if level.isType('ladder')
|
||||
li.dropdown
|
||||
a(data-toggle='dropdown').play-with-team-parent
|
||||
span.glyphicon-play.glyphicon
|
||||
|
|
|
@ -5,7 +5,7 @@ block modal-header-content
|
|||
|
||||
block modal-body-content
|
||||
|
||||
if view.level.get('type') != 'course-ladder'
|
||||
if !view.level.isType('course-ladder')
|
||||
h4.language-selection(data-i18n="ladder.select_your_language") Select your language!
|
||||
.form-group.select-group
|
||||
select#tome-language(name="language")
|
||||
|
|
|
@ -48,7 +48,7 @@ block modal-body-content
|
|||
textarea(data-i18n="[placeholder]play_level.victory_review_placeholder")
|
||||
.clearfix
|
||||
|
||||
if level.get('type', true) === 'hero' || level.get('type') == 'hero-ladder'
|
||||
if level.isType('hero', 'hero-ladder', 'game-dev', 'web-dev')
|
||||
for achievement in achievements
|
||||
- var animate = achievement.completed && !achievement.completedAWhileAgo
|
||||
.achievement-panel(class=achievement.completedAWhileAgo ? 'earned' : '' data-achievement-id=achievement.id data-animate=animate)
|
||||
|
@ -118,7 +118,7 @@ block modal-footer-content
|
|||
.next-level-buttons
|
||||
if readyToRank
|
||||
.ladder-submission-view
|
||||
else if level.get('type') === 'hero-ladder'
|
||||
else if level.isType('hero-ladder')
|
||||
button.btn.btn-illustrated.btn-primary.btn-lg.return-to-ladder-button(data-href="/play/ladder/#{level.get('slug')}#my-matches", data-dismiss="modal", data-i18n="play_level.victory_return_to_ladder") Return to Ladder
|
||||
else
|
||||
button.btn.btn-illustrated.btn-success.btn-lg.world-map-button.next-level-button.hide#continue-button(data-i18n="common.continue") Continue
|
||||
|
|
|
@ -13,7 +13,7 @@ block modal-body-content
|
|||
block modal-footer-content
|
||||
if readyToRank
|
||||
.ladder-submission-view
|
||||
else if level.get('type') === 'ladder'
|
||||
else if level.isType('ladder')
|
||||
a.btn.btn-primary(href="/play/ladder/#{level.get('slug')}#my-matches", data-dismiss="modal", data-i18n="play_level.victory_return_to_ladder") Return to Ladder
|
||||
else
|
||||
a.btn.btn-primary(href="/", data-dismiss="modal", data-i18n="play_level.victory_go_home") Go Home
|
||||
|
|
|
@ -376,7 +376,7 @@ module.exports = class PlayLevelView extends RootView
|
|||
@loadingView.startUnveiling()
|
||||
@loadingView.unveil true
|
||||
else
|
||||
@scriptManager.initializeCamera()
|
||||
@scriptManager?.initializeCamera()
|
||||
|
||||
onLoadingViewUnveiling: (e) ->
|
||||
@selectHero()
|
||||
|
|
|
@ -379,7 +379,7 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
clearInterval @sequentialAnimationInterval
|
||||
@animationComplete = true
|
||||
@updateSavingProgressStatus()
|
||||
Backbone.Mediator.publish 'music-player:enter-menu', terrain: @level.get('terrain', true)
|
||||
Backbone.Mediator.publish 'music-player:enter-menu', terrain: @level.get('terrain', true) or 'forest'
|
||||
|
||||
updateSavingProgressStatus: ->
|
||||
@$el.find('#saving-progress-label').toggleClass('hide', @readyToContinue)
|
||||
|
|
|
@ -42,7 +42,7 @@ module.exports = class CastButtonView extends CocoView
|
|||
spell.view?.createOnCodeChangeHandlers() for spellKey, spell of @spells
|
||||
if @options.level.get('hidesSubmitUntilRun') or @options.level.get('hidesRealTimePlayback') or @options.level.isType('web-dev')
|
||||
@$el.find('.submit-button').hide() # Hide Submit for the first few until they run it once.
|
||||
if @options.session.get('state')?.complete and @options.level.get 'hidesRealTimePlayback'
|
||||
if @options.session.get('state')?.complete and (@options.level.get('hidesRealTimePlayback') or @options.level.isType('web-dev'))
|
||||
@$el.find('.done-button').show()
|
||||
if @options.level.get('slug') in ['course-thornbush-farm', 'thornbush-farm']
|
||||
@$el.find('.submit-button').hide() # Hide submit until first win so that script can explain it.
|
||||
|
@ -76,7 +76,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
|
||||
@options.session.recordScores @world?.scores, @options.level
|
||||
Backbone.Mediator.publish 'level:show-victory', showModal: true
|
||||
|
||||
onSpellChanged: (e) ->
|
||||
|
@ -113,7 +113,7 @@ module.exports = class CastButtonView extends CocoView
|
|||
@winnable = winnable
|
||||
@$el.toggleClass 'winnable', @winnable
|
||||
Backbone.Mediator.publish 'tome:winnability-updated', winnable: @winnable, level: @options.level
|
||||
if @options.level.get 'hidesRealTimePlayback'
|
||||
if @options.level.get('hidesRealTimePlayback') or @options.level.isType('web-dev')
|
||||
@$el.find('.done-button').toggle @winnable
|
||||
else if @winnable and @options.level.get('slug') in ['course-thornbush-farm', 'thornbush-farm']
|
||||
@$el.find('.submit-button').show() # Hide submit until first win so that script can explain it.
|
||||
|
|
Loading…
Reference in a new issue