This commit is contained in:
Scott Erickson 2014-02-25 17:15:01 -08:00
commit f89768d76d
56 changed files with 75 additions and 61 deletions

View file

@ -132,7 +132,7 @@ module.exports = class God
angel.destroy() for angel in @angels
@dead = true
Backbone.Mediator.unsubscribe('tome:cast-spells', @onTomeCast, @)
@goalManager.destroy()
@goalManager?.destroy()
@goalManager = null
@fillWorkerPool = null
@simulateWorld = null

View file

@ -113,7 +113,9 @@ module.exports = class LevelBus extends Bus
@changedSessionProperties.teamSpells = true
@session.set({'teamSpells': @teamSpellMap})
@saveSession()
@onSpellChanged e # Save the new spell to the session, too.
console.log spellTeam, me.team, e.spell.spellKey
if spellTeam is me.team
@onSpellChanged e # Save the new spell to the session, too.
onScriptStateChanged: (e) ->
return unless @onPoint()

View file

@ -93,9 +93,6 @@ module.exports = class LevelLoader extends CocoClass
@supermodel.populateModel @level
onSupermodelError: ->
msg = $.i18n.t('play_level.level_load_error',
defaultValue: "Level could not be loaded.")
$('body').append('<div class="alert">' + msg + '</div>')
onSupermodelLoadedOne: (e) ->
@update()

View file

@ -220,7 +220,7 @@ module.exports = class Simulator
#functionParameters: # TODOOOOO
if methodName is 'hear'
aetherOptions.functionParameters = ['speaker', 'message', 'data']
console.log "creating aether with options", aetherOptions
#console.log "creating aether with options", aetherOptions
return new Aether aetherOptions
class SimulationTask

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "العربية", englishDescription: "Arabi
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "български език", englishDescri
# gravatar_profile_link: "Full Gravatar Profile"
play_level:
level_load_error: "Нивото не може да бъде заредено."
level_load_error: "Нивото не може да бъде заредено: "
done: "Готово"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
gravatar_profile_link: "Účet Gravatar"
play_level:
level_load_error: "Úroveň se nepodařilo otevřít."
level_load_error: "Úroveň se nepodařilo otevřít: "
done: "Hotovo"
grid: "Mřížka"
customize_wizard: "Upravit Kouzelníka"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "dansk", englishDescription: "Danish", trans
gravatar_profile_link: "Fuld Gravatar Profil"
play_level:
level_load_error: "Banen kunne ikke indlæses."
level_load_error: "Banen kunne ikke indlæses: "
done: "Færdig"
grid: "Gitter"
customize_wizard: "Tilpas troldmand"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Deutsch", englishDescription: "German", tra
gravatar_profile_link: "Gravatar Profil"
play_level:
level_load_error: "Level konnte nicht geladen werden."
level_load_error: "Level konnte nicht geladen werden: "
done: "Fertig"
grid: "Raster"
customize_wizard: "Bearbeite den Zauberer"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "ελληνικά", englishDescription: "Gre
gravatar_profile_link: "Πλήρη προφίλ \"Gravatar\""
play_level:
level_load_error: "Το επίπεδο δεν μπόρεσε να φορτωθεί"
level_load_error: "Το επίπεδο δεν μπόρεσε να φορτωθεί: "
done: "Έτοιμο"
grid: "Πλέγμα"
customize_wizard: "Προσαρμόστε τον Μάγο"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "English (AU)", englishDescription: "English
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "English (UK)", englishDescription: "English
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "English (US)", englishDescription: "English
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
gravatar_profile_link: "Full Gravatar Profile"
play_level:
level_load_error: "Level could not be loaded."
level_load_error: "Level could not be loaded: "
done: "Done"
grid: "Grid"
customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "español (América Latina)", englishDescrip
gravatar_profile_link: "Perfil Gravatar Completo"
play_level:
level_load_error: "El nivel no puede ser cargado."
level_load_error: "El nivel no puede ser cargado: "
done: "Listo"
grid: "Cuadricula"
customize_wizard: "Personalizar Hechicero"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
gravatar_profile_link: "Perfil de Gravatar completo"
play_level:
level_load_error: "No se pudo cargar el nivel."
level_load_error: "No se pudo cargar el nivel: "
done: "Hecho"
grid: "Cuadrícrula"
customize_wizard: "Personalizar Mago"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "español", englishDescription: "Spanish", t
gravatar_profile_link: "Prefil de Gravatar completo"
play_level:
level_load_error: "No se pudo cargar el nivel."
level_load_error: "No se pudo cargar el nivel: "
done: "Hecho"
grid: "Cuadrícrula"
customize_wizard: "Personalizar Mago"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "فارسی", englishDescription: "Persian",
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "suomi", englishDescription: "Finnish", tran
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "français", englishDescription: "French", t
gravatar_profile_link: "Profil Gravatar complet"
play_level:
level_load_error: "Le niveau ne peut pas être chargé."
level_load_error: "Le niveau ne peut pas être chargé: "
done: "Fait"
grid: "Grille"
customize_wizard: "Personnaliser le magicien"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "עברית", englishDescription: "Hebrew",
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "मानक हिन्दी", englishDe
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
# gravatar_profile_link: "Full Gravatar Profile"
play_level:
level_load_error: "A pályát nem sikerült betölteni."
level_load_error: "A pályát nem sikerült betölteni: "
done: "Kész"
grid: "Rács"
customize_wizard: "Varázsló testreszabása"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Ind
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "italiano", englishDescription: "Italian", t
gravatar_profile_link: "Profilo Gravatar completo"
play_level:
level_load_error: "Il livello non può essere caricato."
level_load_error: "Il livello non può essere caricato: "
done: "Fatto"
grid: "Griglia"
customize_wizard: "Personalizza stregone"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "日本語", englishDescription: "Japanese",
# gravatar_profile_link: "Full Gravatar Profile"
play_level:
level_load_error: "レベルがロード出来ませんでした"
level_load_error: "レベルがロード出来ませんでした: "
done: "完了"
grid: "グリッド"
customize_wizard: "魔法使いの設定"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "English (AU)", englishDescription: "English
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Norsk Bokmål", englishDescription: "Norweg
gravatar_profile_link: "Full Gravatar Profil"
play_level:
level_load_error: "Nivået kunne ikke bli lastet."
level_load_error: "Nivået kunne ikke bli lastet: "
done: "Ferdig"
grid: "Grid"
customize_wizard: "Spesiallag Trollmann"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Nederlands", englishDescription: "Dutch", t
gravatar_profile_link: "Volledig Gravatar Profiel"
play_level:
level_load_error: "Level kon niet geladen worden."
level_load_error: "Level kon niet geladen worden: "
done: "Klaar"
grid: "Raster"
customize_wizard: "Pas Tovenaar aan"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "English (AU)", englishDescription: "English
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Norsk", englishDescription: "Norwegian", tr
gravatar_profile_link: "Full Gravatar Profil"
play_level:
level_load_error: "Nivået kunne ikke bli lastet."
level_load_error: "Nivået kunne ikke bli lastet: "
done: "Ferdig"
grid: "Grid"
customize_wizard: "Spesiallag Trollmann"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
gravatar_profile_link: "Profil Gravatar"
play_level:
level_load_error: "Nie udało się wczytać poziomu."
level_load_error: "Nie udało się wczytać poziomu: "
done: "Zrobione"
grid: "Siatka"
customize_wizard: "Spersonalizuj Czarodzieja"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
gravatar_profile_link: "Perfil Completo do Gravatar"
play_level:
level_load_error: "O estágio não pôde ser carregado."
level_load_error: "O estágio não pôde ser carregado: "
done: "Pronto"
grid: "Grade"
customize_wizard: "Personalize o feiticeiro"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
gravatar_profile_link: "Perfil Gravatar completo"
play_level:
level_load_error: "O nível não pôde ser carregado."
level_load_error: "O nível não pôde ser carregado: "
done: "Concluir"
grid: "Grelha"
customize_wizard: "Personalizar Feiticeiro"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "português", englishDescription: "Portugues
gravatar_profile_link: "Perfil Completo do Gravatar"
play_level:
level_load_error: "O estágio não pôde ser carregado."
level_load_error: "O estágio não pôde ser carregado: "
done: "Pronto"
grid: "Grade"
customize_wizard: "Personalize o feiticeiro"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi
gravatar_profile_link: "Полный профиль на Gravatar"
play_level:
level_load_error: "Уровень не может быть загружен."
level_load_error: "Уровень не может быть загружен: "
done: "Готово"
grid: "Сетка"
customize_wizard: "Настройки волшебника"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak",
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "slovenščina", englishDescription: "Sloven
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "српски", englishDescription: "Serbian
gravatar_profile_link: "Цео Граватар налог"
play_level:
level_load_error: "Ниво није могао бити учитан."
level_load_error: "Ниво није могао бити учитан: "
done: "Урађено"
grid: "Мрежа"
customize_wizard: "Прилагоди Чаробњака"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr
gravatar_profile_link: "Hela Gravatar profilen"
play_level:
level_load_error: "Nivån kunde inte laddas."
level_load_error: "Nivån kunde inte laddas: "
done: "Klar"
grid: "Rutnät"
customize_wizard: "Finjustera Trollkarl"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra
# gravatar_profile_link: "Full Gravatar Profile"
play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
done: "เสร็จสิ้น"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Türkçe", englishDescription: "Turkish", t
gravatar_profile_link: "Tam Gravatar Profili"
play_level:
level_load_error: "Seviye yüklenemedi"
level_load_error: "Seviye yüklenemedi: "
done: "Tamamdır"
grid: "Harita Bölmeleri"
customize_wizard: "Sihirbazı Düzenle"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "українська мова", englishDesc
gravatar_profile_link: "Повний профіль Gravatar"
play_level:
level_load_error: "Неможливо завантажити рівень."
level_load_error: "Неможливо завантажити рівень: "
done: "Готово"
grid: "Решітка"
customize_wizard: "Налаштування персонажа"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "اُردُو", englishDescription: "Urdu",
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "Tiếng Việt", englishDescription: "Vietn
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "简体中文", englishDescription: "Chinese
gravatar_profile_link: "完善 Gravatar 资料"
play_level:
level_load_error: "关卡不能载入"
level_load_error: "关卡不能载入: "
done: "完成"
grid: "格子"
customize_wizard: "自定义向导"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "繁体中文", englishDescription: "Chinese
gravatar_profile_link: "完善 Gravatar 資料"
play_level:
level_load_error: "載入關卡時發生錯誤"
level_load_error: "載入關卡時發生錯誤: "
done: "完成"
grid: "格子"
customize_wizard: "自定義巫師"

View file

@ -158,7 +158,7 @@ module.exports = nativeDescription: "中文", englishDescription: "Chinese", tra
# gravatar_profile_link: "Full Gravatar Profile"
# play_level:
# level_load_error: "Level could not be loaded."
# level_load_error: "Level could not be loaded: "
# done: "Done"
# grid: "Grid"
# customize_wizard: "Customize Wizard"

View file

@ -38,3 +38,6 @@
color: black
text-shadow: 0 1px 0 white
.alert-warning h2
color: black
text-align: center

View file

@ -2,6 +2,12 @@ extends /templates/base
block content
if notFound
div(class="alert alert-warning")
h2
span(data-i18n="play_level.level_load_error") Level could not be loaded:
| #{notFound}
h1(data-i18n="play.choose_your_level") Choose Your Level
p
span(data-i18n="play.adventurer_prefix") You can jump to any level below, or discuss the levels on

View file

@ -342,4 +342,5 @@ module.exports = class HUDView extends View
@addMoreMessage = null
@animateEnterButton = null
clearInterval(@messageInterval) if @messageInterval
clearTimeout @hintNextSelectionTimeout if @hintNextSelectionTimeout
super()

View file

@ -97,8 +97,7 @@ module.exports = class PlayLevelView extends View
localStorage["lastLevel"] = @levelID
onLevelLoadError: (e) =>
msg = $.i18n.t('play_level.level_load_error', defaultValue: "Level could not be loaded.")
@$el.html('<div class="alert">' + msg + '</div>')
application.router.navigate "/play?not_found=#{@levelID}", {trigger: true}
setLevel: (@level, @supermodel) ->
@god?.level = @level.serialize @supermodel
@ -136,17 +135,23 @@ module.exports = class PlayLevelView extends View
team = @getQueryVariable("team") ? @world.teamForPlayer(0)
opponentSpells = []
for spellTeam, spells of @session.get('teamSpells') or {}
for spellTeam, spells of @session.get('teamSpells') ? otherSession?.get('teamSpells') ? {}
continue if spellTeam is team or not team
opponentSpells = opponentSpells.concat spells
otherSession = @levelLoader.opponentSession
opponentCode = otherSession?.get('submittedCode') or {}
console.log "otherSession", otherSession, "opponentSpells", opponentSpells
myCode = @session.get('code') or {}
for spell in opponentSpells
c = opponentCode[spell]
if c then myCode[spell] = c else delete myCode[spell]
[thang, spell] = spell.split '/'
c = opponentCode[thang]?[spell]
console.log "Got opponent code", c, "for", spell, "and had my code", myCode[spell]
myCode[thang] ?= {}
if c then myCode[thang][spell] = c else delete myCode[thang][spell]
console.log "Going to set session code from", _.cloneDeep(myCode)
@session.set('code', myCode)
console.log "Just set session code to", _.cloneDeep(@session.get('code'))
if @session.get('multiplayer') and otherSession?
# For now, ladderGame will disallow multiplayer, because session code combining doesn't play nice yet.
@session.set 'multiplayer', false
@ -423,7 +428,7 @@ module.exports = class PlayLevelView extends View
AudioPlayer.preloadSoundReference sound
destroy: ->
@supermodel.off 'error', @onLevelLoadError
@supermodel?.off 'error', @onLevelLoadError
@levelLoader?.off 'loaded-all', @onLevelLoaderLoaded
@levelLoader?.destroy()
@surface?.destroy()
@ -436,7 +441,7 @@ module.exports = class PlayLevelView extends View
@bus?.destroy()
#@instance.save() unless @instance.loading
console.profileEnd?() if PROFILE_ME
@session.off 'change:multiplayer', @onMultiplayerChanged, @
@session?.off 'change:multiplayer', @onMultiplayerChanged, @
@onLevelLoadError = null
@onLevelLoaderLoaded = null
@onSupermodelLoadedOne = null

View file

@ -8,7 +8,7 @@ module.exports = class PlayView extends View
getRenderData: (context={}) ->
context = super(context)
context.home = true
context.notFound = @getQueryVariable 'not_found'
tutorials = [
{
name: 'Rescue Mission'