From dc4252a94d5409a0ba628a73ecbab538c8106ab4 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sun, 16 Mar 2014 22:01:21 -0700 Subject: [PATCH] Moved the tips into the level loader screen and gave them i18n. --- app/templates/play/level/level_loading.jade | 10 ++++++++- .../play/level/level_loading_view.coffee | 22 +++++-------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/app/templates/play/level/level_loading.jade b/app/templates/play/level/level_loading.jade index 8a1936f3f..5899823ca 100644 --- a/app/templates/play/level/level_loading.jade +++ b/app/templates/play/level/level_loading.jade @@ -10,4 +10,12 @@ .progress.progress-striped.active .progress-bar.progress-bar-success - h4= tip \ No newline at end of file + 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. diff --git a/app/views/play/level/level_loading_view.coffee b/app/views/play/level/level_loading_view.coffee index 47ef06fbc..d933bb416 100644 --- a/app/views/play/level/level_loading_view.coffee +++ b/app/views/play/level/level_loading_view.coffee @@ -2,24 +2,17 @@ View = require 'views/kinds/CocoView' 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 id: "level-loading-view" template: template subscriptions: 'level-loader:progress-changed': 'onLevelLoaderProgressChanged' + + afterRender: -> + tips = @$el.find('.tip').addClass('secret') + tip = _.sample(tips) + $(tip).removeClass('secret') onLevelLoaderProgressChanged: (e) -> @progress = e.progress @@ -47,8 +40,3 @@ module.exports = class LevelLoadingView extends View onUnveilEnded: => return if @destroyed Backbone.Mediator.publish 'onLoadingViewUnveiled', view: @ - - getRenderData: (c={}) -> - super c - c.tip = _.sample tips - c