Moved the tips into the level loader screen and gave them i18n.

This commit is contained in:
Scott Erickson 2014-03-16 22:01:21 -07:00
parent 5a8d1b0a2b
commit dc4252a94d
2 changed files with 14 additions and 18 deletions

View file

@ -10,4 +10,12 @@
.progress.progress-striped.active .progress.progress-striped.active
.progress-bar.progress-bar-success .progress-bar.progress-bar-success
h4= tip h4.tip(data-i18n='play_level.tip_insert_positions') You can Shift+Click a position on the map to insert it into the spell editor.
h4.tip(data-i18n='play_level.tip_toggle_play') You can toggle play/paused with Ctrl+P.
h4.tip(data-i18n='play_level.tip_scrub_shortcut') Press Ctrl+[ and Ctrl+] to rewind and fast-forward.
h4.tip(data-i18n='play_level.tip_open_source') CodeCombat is 100% open source!
h4.tip(data-i18n='play_level.tip_baby_coders') In the future, even babies will be Archmages.
h4.tip(data-i18n='play_level.tip_morale_improves') Loading will continue until morale improves.
h4.tip(data-i18n='play_level.tip_beta_launch') CodeCombat launched its beta in October, 2013.
h4.tip(data-i18n='play_level.tip_js_beginning') JavaScript is just the beginning.
h4.tip(data-i18n='play_level.tip_all_species') We believe in equal opportunities to learn programming for all species.

View file

@ -2,18 +2,6 @@ View = require 'views/kinds/CocoView'
template = require 'templates/play/level/level_loading' template = require 'templates/play/level/level_loading'
tips = [
"Tip: you can shift+click a position on the map to insert it into the spell editor."
"You can toggle play/paused with ctrl+p."
"Pressing ctrl+[ and ctrl+] rewinds and fast-forwards."
"CodeCombat is 100% open source!"
"In the future, even babies will be Archmages."
"Loading will continue until morale improves."
"CodeCombat launched its beta in October, 2013."
"JavaScript is just the beginning."
"We believe in equal opportunities to learn programming for all species."
]
module.exports = class LevelLoadingView extends View module.exports = class LevelLoadingView extends View
id: "level-loading-view" id: "level-loading-view"
template: template template: template
@ -21,6 +9,11 @@ module.exports = class LevelLoadingView extends View
subscriptions: subscriptions:
'level-loader:progress-changed': 'onLevelLoaderProgressChanged' 'level-loader:progress-changed': 'onLevelLoaderProgressChanged'
afterRender: ->
tips = @$el.find('.tip').addClass('secret')
tip = _.sample(tips)
$(tip).removeClass('secret')
onLevelLoaderProgressChanged: (e) -> onLevelLoaderProgressChanged: (e) ->
@progress = e.progress @progress = e.progress
@updateProgressBar() @updateProgressBar()
@ -47,8 +40,3 @@ module.exports = class LevelLoadingView extends View
onUnveilEnded: => onUnveilEnded: =>
return if @destroyed return if @destroyed
Backbone.Mediator.publish 'onLoadingViewUnveiled', view: @ Backbone.Mediator.publish 'onLoadingViewUnveiled', view: @
getRenderData: (c={}) ->
super c
c.tip = _.sample tips
c