Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-10-15 10:36:28 -07:00
commit e560d74787
4 changed files with 84 additions and 68 deletions

View file

@ -77,4 +77,5 @@ module.exports = class MusicPlayer extends CocoClass
destroy: -> destroy: ->
me.off 'change:music', @onMusicSettingChanged, @ me.off 'change:music', @onMusicSettingChanged, @
@fadeOutCurrentMusic()
super() super()

View file

@ -107,13 +107,13 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
send_password: "Recuperar senha" send_password: "Recuperar senha"
recovery_sent: "Email de recuperação enviado." recovery_sent: "Email de recuperação enviado."
# items: items:
# armor: "Armor" armor: "Armadura"
# hands: "Hands" hands: "Mãos"
# accessories: "Accessories" accessories: "Accessórios"
# books: "Books" books: "Livross"
# minions: "Minions" minions: "Minions"
# misc: "Misc" misc: "Diversos"
common: common:
loading: "Carregando..." loading: "Carregando..."
@ -128,8 +128,8 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
fork: "Fork" fork: "Fork"
play: "Jogar" # When used as an action verb, like "Play next level" play: "Jogar" # When used as an action verb, like "Play next level"
retry: "Tente novamente" retry: "Tente novamente"
# watch: "Watch" watch: "Observar"
# unwatch: "Unwatch" unwatch: "Não Observar"
submit_patch: "Enviar arranjo" submit_patch: "Enviar arranjo"
general: general:
@ -182,15 +182,15 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
play_level: play_level:
done: "Pronto" done: "Pronto"
home: "Início" home: "Início"
# skip: "Skip" skip: "Pular"
# game_menu: "Game Menu" game_menu: "Menu do Jogo"
guide: "Guia" guide: "Guia"
restart: "Reiniciar" restart: "Reiniciar"
goals: "Objetivos" goals: "Objetivos"
# goal: "Goal" goal: "Objetivo"
success: "Sucesso!" success: "Sucesso!"
incomplete: "Incompleto" incomplete: "Incompleto"
# timed_out: "Ran out of time" timed_out: "Tempo esgotado"
failing: "Falta" failing: "Falta"
action_timeline: "Linha do Tempo das Ações" action_timeline: "Linha do Tempo das Ações"
click_to_select: "Clique em um personagem para selecioná-lo." click_to_select: "Clique em um personagem para selecioná-lo."
@ -204,7 +204,7 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
victory_rate_the_level: "Avalie o estágio: " # Only in old-style levels. victory_rate_the_level: "Avalie o estágio: " # Only in old-style levels.
victory_return_to_ladder: "Retornar para a Ladder" victory_return_to_ladder: "Retornar para a Ladder"
victory_play_next_level: "Jogar o próximo estágio" # Only in old-style levels. victory_play_next_level: "Jogar o próximo estágio" # Only in old-style levels.
# victory_play_continue: "Continue" victory_play_continue: "Continue"
victory_go_home: "Ir à página inicial" # Only in old-style levels. victory_go_home: "Ir à página inicial" # Only in old-style levels.
victory_review: "Diga-nos mais!" # Only in old-style levels. victory_review: "Diga-nos mais!" # Only in old-style levels.
victory_hour_of_code_done: "Terminou?" victory_hour_of_code_done: "Terminou?"
@ -219,23 +219,23 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
# tome_cast_button_run: "Run" # tome_cast_button_run: "Run"
# tome_cast_button_running: "Running" # tome_cast_button_running: "Running"
# tome_cast_button_ran: "Ran" # tome_cast_button_ran: "Ran"
# tome_submit_button: "Submit" tome_submit_button: "Enviar"
# tome_reload_method: "Reload original code for this method" # Title text for individual method reload button. # tome_reload_method: "Reload original code for this method" # Title text for individual method reload button.
# tome_select_method: "Select a Method" tome_select_method: "Selecione um Método"
# tome_see_all_methods: "See all methods you can edit" # Title text for method list selector (shown when there are multiple programmable methdos). # tome_see_all_methods: "See all methods you can edit" # Title text for method list selector (shown when there are multiple programmable methdos).
tome_select_a_thang: "Selecione alguém para " tome_select_a_thang: "Selecione alguém para "
tome_available_spells: "Feitiços Disponíveis" tome_available_spells: "Feitiços Disponíveis"
# tome_your_skills: "Your Skills" tome_your_skills: "Suas habilidades"
hud_continue: "Continue (tecle Shift+Space)" hud_continue: "Continue (tecle Shift+Space)"
spell_saved: "Feitiço Salvo" spell_saved: "Feitiço Salvo"
skip_tutorial: "Pular (esc)" skip_tutorial: "Pular (esc)"
# keyboard_shortcuts: "Key Shortcuts" keyboard_shortcuts: "Teclas de atalho"
loading_ready: "Pronto!" loading_ready: "Pronto!"
# loading_start: "Start Level" loading_start: "Iniciar fase"
# time_current: "Now:" time_current: "Agora:"
# time_total: "Max:" time_total: "Máximo:"
# time_goto: "Go to:" time_goto: "Ir para:"
# infinite_loop_try_again: "Try Again" infinite_loop_try_again: "Tentar novamente"
# infinite_loop_reset_level: "Reset Level" # infinite_loop_reset_level: "Reset Level"
# infinite_loop_comment_out: "Comment Out My Code" # infinite_loop_comment_out: "Comment Out My Code"
# tip_toggle_play: "Toggle play/paused with Ctrl+P." # tip_toggle_play: "Toggle play/paused with Ctrl+P."
@ -270,39 +270,39 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
customize_wizard: "Personalize o feiticeiro" customize_wizard: "Personalize o feiticeiro"
game_menu: game_menu:
# inventory_tab: "Inventory" inventory_tab: "Inventário"
# choose_hero_tab: "Restart Level" choose_hero_tab: "Reiniciar Nível"
# save_load_tab: "Save/Load" save_load_tab: "Salvar/Carregar"
# options_tab: "Options" options_tab: "Opções"
# guide_tab: "Guide" guide_tab: "Guia"
multiplayer_tab: "Multijogador" multiplayer_tab: "Multijogador"
# inventory_caption: "Equip your hero" inventory_caption: "Equipar seu herói"
# choose_hero_caption: "Choose hero, language" # choose_hero_caption: "Choose hero, language"
# save_load_caption: "... and view history" # save_load_caption: "... and view history"
# options_caption: "Configure settings" # options_caption: "Configure settings"
# guide_caption: "Docs and tips" guide_caption: "Documentos e dicas"
# multiplayer_caption: "Play with friends!" # multiplayer_caption: "Play with friends!"
# inventory: # inventory:
# choose_inventory: "Equip Items" # choose_inventory: "Equip Items"
# choose_hero: choose_hero:
# choose_hero: "Choose Your Hero" choose_hero: "Escolha seu Herói"
# programming_language: "Programming Language" programming_language: "Linguagem de Programação"
# programming_language_description: "Which programming language do you want to use?" programming_language_description: "Qual Linguagem de Programação você gostaria de usar?"
# status: "Status" status: "Status"
# weapons: "Weapons" weapons: "Armas"
# health: "Health" health: "Vida"
# speed: "Speed" speed: "Velocidade"
# save_load: save_load:
# granularity_saved_games: "Saved" granularity_saved_games: "Salvo"
# granularity_change_history: "History" granularity_change_history: "Histórico"
options: options:
# general_options: "General Options" # Check out the Options tab in the Game Menu while playing a level # general_options: "General Options" # Check out the Options tab in the Game Menu while playing a level
# volume_label: "Volume" volume_label: "Volume"
# music_label: "Music" music_label: "Música"
# music_description: "Turn background music on/off." # music_description: "Turn background music on/off."
# autorun_label: "Autorun" # autorun_label: "Autorun"
# autorun_description: "Control automatic code execution." # autorun_description: "Control automatic code execution."
@ -333,21 +333,21 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
why_paragraph_2_italic_caps: "NÃO MÃE EU PRECISO TERMINAR ESSE NÍVEL!" why_paragraph_2_italic_caps: "NÃO MÃE EU PRECISO TERMINAR ESSE NÍVEL!"
why_paragraph_2_suffix: "É por isso que o CodeCombat é um jogo multijogador, não uma aula que imita um jogo. Nós não iremos parar até você não conseguir parar--mas agora, isso é uma coisa boa." why_paragraph_2_suffix: "É por isso que o CodeCombat é um jogo multijogador, não uma aula que imita um jogo. Nós não iremos parar até você não conseguir parar--mas agora, isso é uma coisa boa."
why_paragraph_3: "Se você vai se viciar em algum jogo, fique viciado nesse e se torne um dos magos da era da tecnologia." why_paragraph_3: "Se você vai se viciar em algum jogo, fique viciado nesse e se torne um dos magos da era da tecnologia."
# press_title: "Bloggers/Press" press_title: "Bloggers/Imprensa"
# press_paragraph_1_prefix: "Want to write about us? Feel free to download and use all of the resources included in our" press_paragraph_1_prefix: "Quer escrever sobre nós? Fique à vontade para baixar e usar todos recursos inclusos em nosso"
# press_paragraph_1_link: "press packet" press_paragraph_1_link: "Midia Kit"
# press_paragraph_1_suffix: ". All logos and images may be used without contacting us directly." press_paragraph_1_suffix: ". Todas as logomarcas e imagens podem ser usadas sem nos contactar previamente."
# team: "Team" team: "Time"
# george_title: "CEO" george_title: "CEO"
# george_blurb: "Businesser" george_blurb: "Administrador" # Businesser
# scott_title: "Programmer" scott_title: "Programador"
# scott_blurb: "Reasonable One" scott_blurb: "O Sensato"
# nick_title: "Programmer" nick_title: "Programador"
# nick_blurb: "Motivation Guru" nick_blurb: "Guru Motivacional"
# michael_title: "Programmer" michael_title: "Programador"
# michael_blurb: "Sys Admin" michael_blurb: "Administrador de Sistemas"
# matt_title: "Programmer" matt_title: "PProgramador"
# matt_blurb: "Bicyclist" matt_blurb: "O Ciclista"
versions: versions:
save_version_title: "Salvar nova versão" save_version_title: "Salvar nova versão"
@ -410,12 +410,12 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
wizard_tab: "Feiticeiro" wizard_tab: "Feiticeiro"
wizard_color: "Cor das Roupas do Feiticeiro" wizard_color: "Cor das Roupas do Feiticeiro"
# keyboard_shortcuts: keyboard_shortcuts:
# keyboard_shortcuts: "Keyboard Shortcuts" keyboard_shortcuts: "Atalhos do Teclado"
# space: "Space" space: "Espaço"
# enter: "Enter" enter: "Enter"
# escape: "Escape" escape: "Esc"
# shift: "Shift" shift: "Shift"
# cast_spell: "Cast current spell." # cast_spell: "Cast current spell."
# run_real_time: "Run in real time." # run_real_time: "Run in real time."
# continue_script: "Continue past current script." # continue_script: "Continue past current script."
@ -443,8 +443,8 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
# find_us: "Find us on these sites" # find_us: "Find us on these sites"
# social_blog: "Read the CodeCombat blog on Sett" # social_blog: "Read the CodeCombat blog on Sett"
# social_discource: "Join the discussion on our Discourse forum" # social_discource: "Join the discussion on our Discourse forum"
# social_facebook: "Like CodeCombat on Facebook" social_facebook: "Curta o CodeCombat no Facebook"
# social_twitter: "Follow CodeCombat on Twitter" social_twitter: "Siga o CodeCombat no Twitter"
# social_gplus: "Join CodeCombat on Google+" # social_gplus: "Join CodeCombat on Google+"
# social_hipchat: "Chat with us in the public CodeCombat HipChat room" # social_hipchat: "Chat with us in the public CodeCombat HipChat room"
contribute_to_the_project: "Contribuir para o projeto" contribute_to_the_project: "Contribuir para o projeto"
@ -472,7 +472,7 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
back: "Voltar" back: "Voltar"
revert: "Reverter" revert: "Reverter"
revert_models: "Reverter Modelos" revert_models: "Reverter Modelos"
# pick_a_terrain: "Pick A Terrain" pick_a_terrain: "Escolha um Terreno"
small: "Pequeno" small: "Pequeno"
# grassy: "Grassy" # grassy: "Grassy"
# fork_title: "Fork New Version" # fork_title: "Fork New Version"

View file

@ -5,6 +5,8 @@ CocoCollection = require 'collections/CocoCollection'
AudioPlayer = require 'lib/AudioPlayer' AudioPlayer = require 'lib/AudioPlayer'
PlayLevelModal = require 'views/play/modal/PlayLevelModal' PlayLevelModal = require 'views/play/modal/PlayLevelModal'
ThangType = require 'models/ThangType' ThangType = require 'models/ThangType'
MusicPlayer = require 'lib/surface/MusicPlayer'
storage = require 'lib/storage'
class LevelSessionsCollection extends CocoCollection class LevelSessionsCollection extends CocoCollection
url: '' url: ''
@ -37,6 +39,9 @@ module.exports = class WorldMapView extends RootView
@getLevelPlayCounts() @getLevelPlayCounts()
$(window).on 'resize', @onWindowResize $(window).on 'resize', @onWindowResize
@playAmbientSound() @playAmbientSound()
@probablyCachedMusic = storage.load("loaded-menu-music-#{@terrain}")
musicDelay = if @probablyCachedMusic then 1000 else 10000
@playMusicTimeout = _.delay (=> @playMusic() unless @destroyed), musicDelay
@preloadTopHeroes() @preloadTopHeroes()
@hadEverChosenHero = me.get('heroConfig')?.thangType @hadEverChosenHero = me.get('heroConfig')?.thangType
@ -45,6 +50,8 @@ module.exports = class WorldMapView extends RootView
if ambientSound = @ambientSound if ambientSound = @ambientSound
# Doesn't seem to work; stops immediately. # Doesn't seem to work; stops immediately.
createjs.Tween.get(ambientSound).to({volume: 0.0}, 1500).call -> ambientSound.stop() createjs.Tween.get(ambientSound).to({volume: 0.0}, 1500).call -> ambientSound.stop()
@musicPlayer?.destroy()
clearTimeout @playMusicTimeout
super() super()
getLevelPlayCounts: -> getLevelPlayCounts: ->
@ -129,6 +136,7 @@ module.exports = class WorldMapView extends RootView
levelID = $(e.target).parents('.level').data('level-id') levelID = $(e.target).parents('.level').data('level-id')
@$levelInfo = @$el.find(".level-info-container[data-level-id=#{levelID}]").show() @$levelInfo = @$el.find(".level-info-container[data-level-id=#{levelID}]").show()
@adjustLevelInfoPosition e @adjustLevelInfoPosition e
@endHighlight()
onMouseLeaveLevel: (e) -> onMouseLeaveLevel: (e) ->
return if application.isIPadApp return if application.isIPadApp
@ -202,6 +210,12 @@ module.exports = class WorldMapView extends RootView
@ambientSound = createjs.Sound.play src, loop: -1, volume: 0.1 @ambientSound = createjs.Sound.play src, loop: -1, volume: 0.1
createjs.Tween.get(@ambientSound).to({volume: 1.0}, 1000) createjs.Tween.get(@ambientSound).to({volume: 1.0}, 1000)
playMusic: ->
@musicPlayer = new MusicPlayer()
musicFile = {Dungeon: '/music/music-menu-dungeon', Grass: '/music/music-menu-grass'}[@terrain]
Backbone.Mediator.publish 'music-player:play-music', play: true, file: musicFile
storage.save("loaded-menu-music-#{@terrain}", true) unless @probablyCachedMusic
preloadTopHeroes: -> preloadTopHeroes: ->
for heroID in ['captain', 'knight'] for heroID in ['captain', 'knight']
url = "/db/thang.type/#{ThangType.heroes[heroID]}/version" url = "/db/thang.type/#{ThangType.heroes[heroID]}/version"

View file

@ -101,12 +101,13 @@ module.exports = class PlayLevelModal extends ModalView
@chooseHeroView.$el.add('#choose-inventory-button, #choose-hero-header').removeClass 'secret' @chooseHeroView.$el.add('#choose-inventory-button, #choose-hero-header').removeClass 'secret'
@inventoryView.$el.add('#choose-hero-button, #play-level-button, #choose-inventory-header').addClass 'secret' @inventoryView.$el.add('#choose-hero-button, #play-level-button, #choose-inventory-header').addClass 'secret'
@chooseHeroView.onShown() @chooseHeroView.onShown()
@inventoryView.endHighlight()
onClickPlayLevel: (e) -> onClickPlayLevel: (e) ->
return if @$el.find('#play-level-button').prop 'disabled' return if @$el.find('#play-level-button').prop 'disabled'
@showLoading() @showLoading()
ua = navigator.userAgent.toLowerCase() ua = navigator.userAgent.toLowerCase()
unless hasGoneFullScreenOnce or (/safari/.test(ua) and not /chrome/.test(ua)) unless hasGoneFullScreenOnce or (/safari/.test(ua) and not /chrome/.test(ua)) or $(window).height() >= 658 # Min vertical resolution needed at 1366px wide
@toggleFullscreen() @toggleFullscreen()
hasGoneFullScreenOnce = true hasGoneFullScreenOnce = true
@updateConfig => @updateConfig =>