This commit is contained in:
George Saines 2014-09-02 15:33:28 -07:00
commit e0b49ba2aa
82 changed files with 723 additions and 547 deletions

View file

@ -35,7 +35,6 @@ module.exports = class LevelLoader extends CocoClass
@worldNecessities = []
@listenTo @supermodel, 'resource-loaded', @onWorldNecessityLoaded
@loadSession()
@loadLevel()
@loadAudio()
@playJingle()
@ -44,14 +43,19 @@ module.exports = class LevelLoader extends CocoClass
else
@listenToOnce @supermodel, 'loaded-all', @onSupermodelLoaded
playJingle: ->
return if @headless
# Apparently the jingle, when it tries to play immediately during all this loading, you can't hear it.
# Add the timeout to fix this weird behavior.
f = ->
jingles = ['ident_1', 'ident_2']
AudioPlayer.playInterfaceSound jingles[Math.floor Math.random() * jingles.length]
setTimeout f, 500
# Supermodel (Level) Loading
loadLevel: ->
@level = @supermodel.getModel(Level, @levelID) or new Level _id: @levelID
if @level.loaded
@onLevelLoaded()
else
@level = @supermodel.loadModel(@level, 'level').model
@listenToOnce @level, 'sync', @onLevelLoaded
onLevelLoaded: ->
@loadSession()
@populateLevel()
# Session Loading
@ -83,29 +87,19 @@ module.exports = class LevelLoader extends CocoClass
@listenToOnce @opponentSession, 'sync', @loadDependenciesForSession
loadDependenciesForSession: (session) ->
return if @levelID is 'sky-span' # TODO
# TODO: I think this runs afoul of https://github.com/codecombat/codecombat/issues/1108
# TODO: this shouldn't happen when it's not a hero level, but we don't have level loaded yet,
# and the sessions are being created with default hero config regardless of whether it's a hero level.
if heroConfig = session.get('heroConfig')
url = "/db/thang.type/#{heroConfig.thangType}/version?project=name,components,original"
return unless @level.get('type', true) is 'hero'
heroConfig = session.get('heroConfig')
unless heroConfig
heroConfig = {inventory: {}, thangType: '529ffbf1cf1818f2be000001'} # Temp: assign Tharin as the hero
session.set 'heroConfig', heroConfig
url = "/db/thang.type/#{heroConfig.thangType}/version?project=name,components,original"
@worldNecessities.push @maybeLoadURL(url, ThangType, 'thang')
for itemThangType in _.values(heroConfig.inventory)
url = "/db/thang.type/#{itemThangType}/version?project=name,components,original"
@worldNecessities.push @maybeLoadURL(url, ThangType, 'thang')
for itemThangType in _.values(heroConfig.inventory)
url = "/db/thang.type/#{itemThangType}/version?project=name,components,original"
@worldNecessities.push @maybeLoadURL(url, ThangType, 'thang')
# Supermodel (Level) Loading
loadLevel: ->
@level = @supermodel.getModel(Level, @levelID) or new Level _id: @levelID
if @level.loaded
@populateLevel()
else
@level = @supermodel.loadModel(@level, 'level').model
@listenToOnce @level, 'sync', @onLevelLoaded
onLevelLoaded: ->
@populateLevel()
# Grabbing the rest of the required data for the level
populateLevel: ->
thangIDs = []
@ -167,6 +161,7 @@ module.exports = class LevelLoader extends CocoClass
@loadThangsRequiredFromComponentList thangType.get('components')
loadThangsRequiredFromComponentList: (components) ->
return unless components
requiredThangTypes = []
for component in components when component.config
if component.original is LevelComponent.EquipsID
@ -331,6 +326,15 @@ module.exports = class LevelLoader extends CocoClass
# Initial Sound Loading
playJingle: ->
return if @headless
# Apparently the jingle, when it tries to play immediately during all this loading, you can't hear it.
# Add the timeout to fix this weird behavior.
f = ->
jingles = ['ident_1', 'ident_2']
AudioPlayer.playInterfaceSound jingles[Math.floor Math.random() * jingles.length]
setTimeout f, 500
loadAudio: ->
return if @headless
AudioPlayer.preloadInterfaceSounds ['victory']

View file

@ -428,7 +428,7 @@ module.exports = Surface = class Surface extends CocoClass
pageHeight = $('#page-container').height() - $('#control-bar-view').outerHeight() - $('#playback-view').outerHeight()
newWidth = Math.min pageWidth, pageHeight * aspectRatio
newHeight = newWidth / aspectRatio
else if $('#editor-level-thangs-tab-view')
else if $('#thangs-tab-view')
newWidth = $('#canvas-wrapper').width()
newHeight = newWidth / aspectRatio
else

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "العربية", englishDescription: "Arabi
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "العربية", englishDescription: "Arabi
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "български език", englishDescri
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "български език", englishDescri
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Català", englishDescription: "Catalan", tr
campaign_multiplayer_description: "... on programes cara a cara contra altres jugadors."
campaign_player_created: "Creats pel Jugador"
campaign_player_created_description: "... on lluites contra la creativitat dels teus companys <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Dificultat: "
play_as: "Jugar com"
spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Català", englishDescription: "Catalan", tr
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
campaign_multiplayer_description: "...ve které programujete proti jiným hráčům."
campaign_player_created: "Uživatelsky vytvořené úrovně"
campaign_player_created_description: "...ve kterých bojujete proti kreativitě ostatních <a href=\"/contribute#artisan\">Zdatných Kouzelníků</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Obtížnost: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "dansk", englishDescription: "Danish", trans
campaign_multiplayer_description: "... hvor du koder ansigt-til-ansigt imod andre spillere."
campaign_player_created: "Spillerkreerede"
campaign_player_created_description: "... hvor du kæmper mod dine med-<a href=\"/contribute#artisan\">Kunsthåndværker-troldmænd</a>s kreativitet."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Sværhedsgrad: "
play_as: "Spil Som "
spectate: "Observér"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "dansk", englishDescription: "Danish", trans
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Deutsch (Österreich)", englishDescription:
campaign_multiplayer_description: "... in der Du Kopf-an-Kopf gegen andere Spieler programmierst."
campaign_player_created: "Von Spielern erstellt"
campaign_player_created_description: "... in welchem Du gegen die Kreativität eines <a href=\"/contribute#artisan\">Artisan Zauberers</a> kämpfst."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Schwierigkeit: "
play_as: "Spiele als "
spectate: "Zuschauen"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Deutsch (Österreich)", englishDescription:
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
delta:
added: "hinzugefügt"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Deutsch (Schweiz)", englishDescription: "Ge
campaign_multiplayer_description: "... i dene du Chopf a Chopf geg anderi Spieler spielsch."
campaign_player_created: "Vo Spieler erstellti Level"
campaign_player_created_description: "... i dene du gege d Kreativität vome <a href=\"/contribute#artisan\">Handwerker Zauberer</a> kämpfsch."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Schwierigkeit: "
play_as: "Spiel als"
spectate: "Zueluege"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Deutsch (Schweiz)", englishDescription: "Ge
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription:
campaign_multiplayer_description: "... in der Du Kopf-an-Kopf gegen andere Spieler programmierst."
campaign_player_created: "Von Spielern erstellt"
campaign_player_created_description: "... in welchem Du gegen die Kreativität eines <a href=\"/contribute#artisan\">Artisan Zauberers</a> kämpfst."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Schwierigkeit: "
play_as: "Spiele als "
spectate: "Zuschauen"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription:
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
delta:
added: "hinzugefügt"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "ελληνικά", englishDescription: "Gre
campaign_multiplayer_description: "... στο οποίο μπορείτε να προγραμματίσετε σώμα με σώμα έναντι άλλων παικτών."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Δυσκολία: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "ελληνικά", englishDescription: "Gre
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "English (AU)", englishDescription: "English
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "English (AU)", englishDescription: "English
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "English (UK)", englishDescription: "English
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "English (UK)", englishDescription: "English
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "English (US)", englishDescription: "English
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "English (US)", englishDescription: "English
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@
campaign_multiplayer_description: "... in which you code head-to-head against other players."
campaign_player_created: "Player-Created"
campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
campaign_classic_algorithms: "Classic Algorithms"
campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Difficulty: "
play_as: "Play As"
spectate: "Spectate"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "español (América Latina)", englishDescrip
campaign_multiplayer_description: "... en las que programas cara-a-cara contra otros jugadores."
campaign_player_created: "Creados-Por-Jugadores"
campaign_player_created_description: "... en los que luchas contra la creatividad de tus compañeros <a href=\"/contribute#artisan\">Hechiceros Artesanales</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Dificultad: "
play_as: "Jugar Como "
spectate: "Observar"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "español (América Latina)", englishDescrip
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
campaign_multiplayer_description: "... en las que tu código se enfrentará al de otros jugadores."
campaign_player_created: "Creaciones de los Jugadores"
campaign_player_created_description: "... en las que luchas contra la creatividad de tus compañeros <a href=\"/contribute#artisa\">Magos Artesanos</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Dificultad: "
play_as: "Jugar como"
spectate: "Observar"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
delta:
added: "Añadido"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "فارسی", englishDescription: "Persian",
campaign_multiplayer_description: "... جایی که کد رو به رو شدن با بقیه بازیکنان رو مینویسید."
campaign_player_created: "ایجاد بازیکن"
campaign_player_created_description: "... جایی که در مقابل خلاقیت نیرو هاتون قرار میگیرید <a href=\"/contribute#artisan\">جادوگران آرتیزان</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "سختی: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "فارسی", englishDescription: "Persian",
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "suomi", englishDescription: "Finnish", tran
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "suomi", englishDescription: "Finnish", tran
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "français", englishDescription: "French", t
campaign_multiplayer_description: "... dans laquelle vous coderez en face à face contre d'autres joueurs."
campaign_player_created: "Niveaux créés par les joueurs"
campaign_player_created_description: "... Dans laquelle vous serez confrontés à la créativité des votres.<a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Difficulté: "
play_as: "Jouer comme "
spectate: "Spectateur"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "français", englishDescription: "French", t
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
delta:
added: "Ajouté"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "עברית", englishDescription: "Hebrew",
campaign_multiplayer_description: "..."
campaign_player_created: "תוצרי השחקנים"
campaign_player_created_description: "... שבהם תילחם נגד היצירתיות של <a href=\"/contribute#artisan\">בעלי-המלאכה</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "רמת קושי: "
play_as: "שחק בתור "
spectate: "צופה"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "עברית", englishDescription: "Hebrew",
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "मानक हिन्दी", englishDe
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "मानक हिन्दी", englishDe
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
campaign_multiplayer_description: "... amelyekben a kódod felveheti a versenyt más játékosok kódjával"
campaign_player_created: "Játékosok pályái"
campaign_player_created_description: "...melyekben <a href=\"/contribute#artisan\">Művészi Varázsló</a> társaid ellen kűzdhetsz."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Nehézség: "
play_as: "Játssz mint"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Ind
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Ind
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Italiano", englishDescription: "Italian", t
campaign_multiplayer_description: "... nelle quali programmi faccia a faccia contro altri giocatori."
campaign_player_created: "Creati dai giocatori"
campaign_player_created_description: "... nei quali affronterai la creatività dei tuoi compagni <a href=\"/contribute#artisan\">Stregoni Artigiani</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Difficoltà: "
play_as: "Gioca come "
spectate: "Spettatore"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Italiano", englishDescription: "Italian", t
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "日本語", englishDescription: "Japanese",
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "難易度: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "日本語", englishDescription: "Japanese",
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
campaign_multiplayer_description: "... 이곳에서 당신은 다른 인간 플레이어들과 직접 결투할 수 있습니다."
campaign_player_created: "사용자 직접 제작"
campaign_player_created_description: "... 당신 동료가 고안한 레벨에 도전하세요 <a href=\"/contributeartisan\">마법사 장인</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "난이도: "
play_as: "Play As "
spectate: "관중모드"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Norsk Bokmål", englishDescription: "Norweg
campaign_multiplayer_description: "... hvor du spiller direkte mot andre spillere."
campaign_player_created: "Spiller-Lagde"
campaign_player_created_description: "... hvor du kjemper mot kreativiteten til en av dine medspillende <a href=\"/contribute#artisan\">Artisan Trollmenn</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Vanskelighetsgrad: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Norsk Bokmål", englishDescription: "Norweg
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Nederlands (België)", englishDescription:
campaign_multiplayer_description: "... waarin je direct tegen andere spelers speelt."
campaign_player_created: "Door-spelers-gemaakt"
campaign_player_created_description: "... waarin je ten strijde trekt tegen de creativiteit van andere <a href=\"/contribute#artisan\">Ambachtelijke Tovenaars</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Moeilijkheidsgraad: "
play_as: "Speel als "
spectate: "Toeschouwen"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Nederlands (België)", englishDescription:
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
campaign_multiplayer_description: "... waarin je direct tegen andere spelers speelt."
campaign_player_created: "Door-spelers-gemaakt"
campaign_player_created_description: "... waarin je ten strijde trekt tegen de creativiteit van andere <a href=\"/contribute#artisan\">Ambachtelijke Tovenaars</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Moeilijkheidsgraad: "
play_as: "Speel als "
spectate: "Toeschouwen"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Norwegian Nynorsk", englishDescription: "No
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Norwegian Nynorsk", englishDescription: "No
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Norsk", englishDescription: "Norwegian", tr
campaign_multiplayer_description: "... hvor du spiller direkte mot andre spillere."
campaign_player_created: "Brett laget av andre brukere"
campaign_player_created_description: "... hvor du kjemper mot kreativiteten til en av dine medspillende <a href=\"/contribute#artisan\">Artisan Trollmenn</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Vanskelighetsgrad: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Norsk", englishDescription: "Norwegian", tr
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
campaign_multiplayer_description: "... w których konkurujesz z innymi graczami."
campaign_player_created: "Stworzone przez graczy"
campaign_player_created_description: "... w których walczysz przeciwko dziełom <a href=\"/contribute#artisan\">Czarodziejów Rękodzielnictwa</a>"
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Poziom trudności: "
play_as: "Graj jako "
spectate: "Oglądaj"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
campaign_multiplayer_description: "... nas quais você programará cara-a-cara contra outros jogadores."
campaign_player_created: "Criados por Jogadores"
campaign_player_created_description: "... nos quais você batalhará contra a criatividade dos seus companheiros <a href=\"/contribute#artisan\">feiticeiros Artesãos</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Dificuldade: "
play_as: "Jogar Como "
spectate: "Assistir"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription:
campaign_multiplayer_description: "... onde programa frente-a-frente contra outros jogadores."
campaign_player_created: "Criados por Jogadores"
campaign_player_created_description: "... onde combate contra a criatividade dos seus colegas <a href=\"/contribute#artisan\">Feiticeiros Artesãos</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Dificuldade: "
play_as: "Jogar Como"
spectate: "Espectar"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription:
achievement: "Conquista"
clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
delta:
added: "Adicionados/as"

View file

@ -3,21 +3,21 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
loading: "Se incarcă..."
saving: "Se salvează..."
sending: "Se trimite..."
# send: "Send"
send: "Trimite"
cancel: "Anulează"
save: "Salvează"
# publish: "Publish"
create: "Crează"
publish: "Publica"
create: "Creează"
delay_1_sec: "1 secundă"
delay_3_sec: "3 secunde"
delay_5_sec: "5 secunde"
manual: "Manual"
fork: "Fork"
play: "Joacă"
# retry: "Retry"
retry: "Reîncearca"
# watch: "Watch"
# unwatch: "Unwatch"
# submit_patch: "Submit Patch"
submit_patch: "Înainteaza Patch"
units:
second: "secundă"
@ -26,14 +26,14 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
minutes: "minute"
hour: "oră"
hours: "ore"
# day: "day"
# days: "days"
# week: "week"
# weeks: "weeks"
# month: "month"
# months: "months"
# year: "year"
# years: "years"
day: "zi"
days: "zile"
week: "săptămână"
weeks: "săptămâni"
month: "luna"
months: "luni"
year: "an"
years: "ani"
modal:
close: "Inchide"
@ -44,16 +44,16 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
nav:
play: "Nivele"
# community: "Community"
community: "Communitate"
editor: "Editor"
blog: "Blog"
forum: "Forum"
# account: "Account"
# profile: "Profile"
# stats: "Stats"
# code: "Code"
account: "Cont"
profile: "Profil"
stats: "Statistică"
code: "Cod"
admin: "Admin"
home: "Acasa"
home: "Acasă"
contribute: "Contribuie"
legal: "Confidențialitate și termeni"
about: "Despre"
@ -89,8 +89,8 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
creating: "Se creează contul..."
sign_up: "Înscrie-te"
log_in: "loghează-te cu parola"
# social_signup: "Or, you can sign up through Facebook or G+:"
# required: "You need to log in before you can go that way."
social_signup: "Sau, te poți inregistra cu Facebook sau G+:"
required: "Trebuie să te înregistrezi înaite să parcurgi acest drum."
home:
slogan: "Învață sa scrii cod jucându-te"
@ -103,12 +103,12 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
for_beginners: "Pentru Începători"
multiplayer: "Multiplayer"
for_developers: "Pentru dezvoltatori"
# javascript_blurb: "The language of the web. Great for writing websites, web apps, HTML5 games, and servers."
# python_blurb: "Simple yet powerful, Python is a great general purpose programming language."
# coffeescript_blurb: "Nicer JavaScript syntax."
# clojure_blurb: "A modern Lisp."
# lua_blurb: "Game scripting language."
# io_blurb: "Simple but obscure."
javascript_blurb: "Limbajul web-ului. Perfect pentru crearea website-urilor, web applicații, jocuri HTML5, si servere. The language of the web. Great for writing websites, web apps, HTML5 games, and servers."
python_blurb: "Simplu dar puternic, Python este un limbaj de uz general extraordinar!"
coffeescript_blurb: "JavaScript cu o syntaxă mai placută! Nicer JavaScript syntax."
clojure_blurb: "Un Lisp modern."
lua_blurb: "Limbaj de scripting pentru jocuri."
io_blurb: "Simplu dar obscur."
play:
choose_your_level: "Alege nivelul"
@ -123,11 +123,13 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
campaign_multiplayer_description: "... în care te lupți cap-la-cap contra alti jucători."
campaign_player_created: "Create de jucători"
campaign_player_created_description: "... în care ai ocazia să testezi creativitatea colegilor tai <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Dificultate: "
play_as: "Alege-ți echipa"
spectate: "Spectator"
# players: "players"
# hours_played: "hours played"
players: "jucători"
hours_played: "ore jucate"
contact:
contact_us: "Contact CodeCombat"
@ -139,8 +141,8 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
forum_page: "forumul nostru"
forum_suffix: " în schimb."
send: "Trimite Feedback"
# contact_candidate: "Contact Candidate"
# recruitment_reminder: "Use this form to reach out to candidates you are interested in interviewing. Remember that CodeCombat charges 15% of first-year salary. The fee is due upon hiring the employee and is refundable for 90 days if the employee does not remain employed. Part time, remote, and contract employees are free, as are interns."
contact_candidate: "Contacteaza Candidatul"
recruitment_reminder: "Folosiți acest formular pentru a ajunge la candidații care va intereseaza pentru interviu. CodeCombat percepe 15% din salariu în primul an. Taxa este datorată la angajare și este rambursabilă pentru 90 de zile în cazul în care salariatul nu rămâne angajat. Cele part time, și angajați cu contract la distanță sunt gratuite, așa cum sunt stagiari."
diplomat_suggestion:
title: "Ajută-ne să traducem CodeCombat!"
@ -153,16 +155,16 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
wizard_settings:
title: "Setări Wizard"
customize_avatar: "Personalizează-ți Avatarul"
# active: "Active"
# color: "Color"
# group: "Group"
active: "Activ"
color: "Culoare"
group: "Grup"
clothes: "Haine"
trim: "Margine"
cloud: "Nor"
# team: "Team"
team: "Echipa"
spell: "Vrajă"
boots: "Încălțăminte"
hue: "Culoare"
hue: "Nuanță"
saturation: "Saturație"
lightness: "Luminozitate"
@ -172,7 +174,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
autosave: "Modificările se salvează automat"
me_tab: "Eu"
picture_tab: "Poză"
# upload_picture: "Upload a picture"
upload_picture: "Uploadeaza o imagine"
wizard_tab: "Wizard"
password_tab: "Parolă"
emails_tab: "Email-uri"
@ -181,16 +183,16 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
new_password: "Parolă nouă"
new_password_verify: "Verifică"
email_subscriptions: "Subscripție Email"
# email_subscriptions_none: "No Email Subscriptions."
email_subscriptions_none: "Nu ai subscripții Email."
email_announcements: "Anunțuri"
email_announcements_description: "Primește email-uri cu ultimele știri despre CodeCombat."
email_notifications: "Notificări"
# email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity."
# email_any_notes: "Any Notifications"
# email_any_notes_description: "Disable to stop all activity notification emails."
# email_news: "News"
# email_recruit_notes: "Job Opportunities"
# email_recruit_notes_description: "If you play really well, we may contact you about getting you a (better) job."
email_notifications_summary: "Control pentru notificări email personalizate, legate de activitatea CodeCombat."
email_any_notes: "Orice Notificări"
email_any_notes_description: "Dezactivați pentru a opri toate e-mailurile de notificare a activității. Disable to stop all activity notification emails."
email_news: "Noutăți"
email_recruit_notes: "Oportunități de job-uri"
email_recruit_notes_description: "Daca joci foarte bine, este posibil sa te contactăm pentru obținerea unui loc (mai bun) de muncă."
contributor_emails: "Contributor Class Emails"
contribute_prefix: "Căutăm oameni să se alăture distracției! Intră pe "
contribute_page: "pagina de contribuție"
@ -199,49 +201,49 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
error_saving: "Salvare erori"
saved: "Modificări salvate"
password_mismatch: "Parola nu se potrivește."
# password_repeat: "Please repeat your password."
password_repeat: "Te rugăm sa repeți parola."
# job_profile: "Job Profile"
# job_profile_approved: "Your job profile has been approved by CodeCombat. Employers will be able to see it until you either mark it inactive or it has not been changed for four weeks."
# job_profile_explanation: "Hi! Fill this out, and we will get in touch about finding you a software developer job."
# sample_profile: "See a sample profile"
# view_profile: "View Your Profile"
sample_profile: "Vezi un profil exemplu"
view_profile: "Vizualizează Profilul"
account_profile:
# settings: "Settings"
# edit_profile: "Edit Profile"
# done_editing: "Done Editing"
settings: "Setări"
edit_profile: "Modifica Profil"
done_editing: "Am terminat modificările."
profile_for_prefix: "Profil pentru "
profile_for_suffix: ""
# featured: "Featured"
featured: "Recomandate"
# not_featured: "Not Featured"
# looking_for: "Looking for:"
# last_updated: "Last updated:"
# contact: "Contact"
# active: "Looking for interview offers now"
# inactive: "Not looking for offers right now"
# complete: "complete"
# next: "Next"
# next_city: "city?"
# next_country: "pick your country."
# next_name: "name?"
# next_short_description: "write a short description."
# next_long_description: "describe your desired position."
# next_skills: "list at least five skills."
# next_work: "chronicle your work history."
# next_education: "recount your educational ordeals."
# next_projects: "show off up to three projects you've worked on."
# next_links: "add any personal or social links."
# next_photo: "add an optional professional photo."
# next_active: "mark yourself open to offers to show up in searches."
# example_blog: "Blog"
# example_personal_site: "Personal Site"
# links_header: "Personal Links"
# links_blurb: "Link any other sites or profiles you want to highlight, like your GitHub, your LinkedIn, or your blog."
# links_name: "Link Name"
# links_name_help: "What are you linking to?"
# links_link_blurb: "Link URL"
# basics_header: "Update basic info"
# basics_active: "Open to Offers"
active: "Caut oferte de interviu."
inactive: "Nu caut oferte"
complete: "complet"
next: "Urmatorul"
next_city: "oras?"
next_country: "alege țara."
next_name: "nume?"
next_short_description: "scrie o scurta descriere."
next_long_description: "descrie poziția dorită."
next_skills: "listeaza cel puțin cinci competențe."
next_work: "cronica istoricului dvs. de lucru."
next_education: "povesteste-ne de chinurile educaționale"
next_projects: "scoate in evidență pana la 3 proiecte la care ai lucrat."
next_links: "adăuga orice link-uri personale sau sociale."
next_photo: "adăuga o fotografie profesionala opțională."
next_active: "indica că esti deschis la oferte ca să apară în căutări."
example_blog: "Blog"
example_personal_site: "Site Personal"
links_header: "Link-uri Personale"
links_blurb: "Link către orice alte site-uri sau profiluri pe care doriți să se sublinieze, ca GitHub, LinkedIn, sau blog-ul personal."
links_name: "Nume Link"
links_name_help: "Catre ce faci link?"
links_link_blurb: "Link URL"
basics_header: "Actualizați informații de bază"
basics_active: "Deschis la Oferte"
# basics_active_help: "Want interview offers right now?"
# basics_job_title: "Desired Job Title"
# basics_job_title_help: "What role are you looking for?"
@ -359,15 +361,15 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
done: "Gata"
customize_wizard: "Personalizează Wizard-ul"
home: "Acasă"
# stop: "Stop"
# game_menu: "Game Menu"
stop: "Stop"
game_menu: "Meniul Jocului"
guide: "Ghid"
restart: "Restart"
goals: "Obiective"
# success: "Success!"
# incomplete: "Incomplete"
# timed_out: "Ran out of time"
# failing: "Failing"
success: "Success!"
incomplete: "Incomplet"
timed_out: "Ai ramas fara timp"
failing: "Eşec"
action_timeline: "Timeline-ul acțiunii"
click_to_select: "Apasă pe o unitate pentru a o selecta."
reload_title: "Reîncarcă tot codul?"
@ -397,7 +399,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
hud_continue: "Continuă (apasă shift-space)"
spell_saved: "Vrajă salvată"
skip_tutorial: "Sari peste (esc)"
# keyboard_shortcuts: "Key Shortcuts"
keyboard_shortcuts: "Scurtături Keyboard"
loading_ready: "Gata!"
tip_insert_positions: "Shift+Click oriunde pe harta pentru a insera punctul în editorul de vrăji."
tip_toggle_play: "Pune sau scoate pauza cu Ctrl+P."
@ -421,7 +423,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
# tip_binary: "There are only 10 types of people in the world: those who understand binary, and those who don't."
# tip_commitment_yoda: "A programmer must have the deepest commitment, the most serious mind. ~ Yoda"
# tip_no_try: "Do. Or do not. There is no try. - Yoda"
# tip_patience: "Patience you must have, young Padawan. - Yoda"
tip_patience: "Să ai rabdare trebuie, tinere Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
@ -444,9 +446,9 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
# inventory_caption: "Equip your hero"
# choose_hero_caption: "Choose hero, language"
# save_load_caption: "... and view history"
# options_caption: "Configure settings"
# guide_caption: "Docs and tips"
# multiplayer_caption: "Play with friends!"
options_caption: "Configurarea setărilor"
guide_caption: "Documentație si sfaturi"
multiplayer_caption: "Joaca cu prieteni!"
# inventory:
# temp: "Temp"
@ -660,7 +662,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
nick_description: "Programming wizard, eccentric motivation mage, and upside-down experimenter. Nick poate să facă orice si a ales să dezvolte CodeCombat."
jeremy_description: "Customer support mage, usability tester, and community organizer; probabil ca ați vorbit deja cu Jeremy."
michael_description: "Programmer, sys-admin, and undergrad technical wunderkind, Michael este cel care ține serverele in picioare."
# matt_description: "Bicyclist, Software Engineer, reader of heroic fantasy, connoisseur of peanut butter, sipper of coffee."
matt_description: "Bicyclist, Software Engineer, cititor de fantezie eroică, cunoscator de unt de arahide, sorbitor de cafea."
legal:
page_title: "Aspecte Legale"
@ -831,9 +833,9 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
simulate_all: "RESETEAZĂ ȘI SIMULEAZĂ JOCURI"
games_simulated_by: "Jocuri simulate de tine:"
games_simulated_for: "Jocuri simulate pentru tine:"
# games_simulated: "Games simulated"
# games_played: "Games played"
# ratio: "Ratio"
games_simulated: "Jocuri simulate"
games_played: "Jocuri jucate"
ratio: "Ratie"
leaderboard: "Clasament"
battle_as: "Luptă ca "
summary_your: "Al tău "
@ -852,7 +854,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
no_ranked_matches_pre: "Nici un meci de clasament pentru "
no_ranked_matches_post: " echipă! Joacă împotriva unor concurenți și revino apoi aici pentr a-ți plasa meciul in clasament."
choose_opponent: "Alege un adversar"
# select_your_language: "Select your language!"
select_your_language: "Alege limbă!"
tutorial_play: "Joacă Tutorial-ul"
tutorial_recommended: "Recomandat dacă nu ai mai jucat niciodată înainte"
tutorial_skip: "Sari peste Tutorial"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi
campaign_multiplayer_description: "... в которых вы соревнуетесь в программировании с другими игроками."
campaign_player_created: "Уровни игроков"
campaign_player_created_description: "... в которых вы сражаетесь с креативностью ваших друзей <a href=\"/contribute#artisan\">Ремесленников</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Сложность: "
play_as: "Играть за "
spectate: "Наблюдать"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
delta:
added: "Добавлено"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak",
campaign_multiplayer_description: "... v ktorej si zmeriaš svoje programátorské sily proti ostatným hráčom."
campaign_player_created: "Hráčmi vytvorené úrovne"
campaign_player_created_description: "... v ktorých sa popasuješ s kreativitou svojich <a href=\"/contribute#artisan\">kúzelníckych súdruhov</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Obtiažnosť."
play_as: "Hraj ako"
spectate: "Sleduj"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak",
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "slovenščina", englishDescription: "Sloven
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "slovenščina", englishDescription: "Sloven
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "српски", englishDescription: "Serbian
campaign_multiplayer_description: "... у којима кодираш 1 на 1 мечеве против осталих играча."
campaign_player_created: "Направљено од стране играча"
campaign_player_created_description: "... у којима се бориш против креативности својих колега."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Тежина: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "српски", englishDescription: "Serbian
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr
campaign_multiplayer_description: "... i vilken du tävlar i kodande mot andra spelare"
campaign_player_created: "Spelarskapade"
campaign_player_created_description: "... i vilken du tävlar mot kreativiteten hos andra <a href=\"/contribute#artisan\">Hantverkare</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Svårighetsgrad: "
play_as: "Spela som "
spectate: "Titta på"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Türkçe", englishDescription: "Turkish", t
campaign_multiplayer_description: "Diğer oyuncularla kafa kafaya verip kodlamak için..."
campaign_player_created: "Oyuncuların Oluşturdukları"
campaign_player_created_description: "<a href=\"/contribute#artisan\">Zanaatkâr Büyücüler</a>in yaratıcılıklarına karşı mücadele etmek için..."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Zorluk: "
play_as: "Olarak Oyna"
spectate: "İzleyici olarak katıl"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Türkçe", englishDescription: "Turkish", t
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "українська мова", englishDesc
campaign_multiplayer_description: "... в яких ви програмуєте віч-на-віч із іншими гравцями."
campaign_player_created: "Рівні, створені гравцями"
campaign_player_created_description: "... у яких ви змагаєтесь у креативності із вашими друзями-<a href=\"/contribute#artisan\">Архітекторами</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Складність: "
play_as: "Грати як"
spectate: "Спостерігати"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "українська мова", englishDesc
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "اُردُو", englishDescription: "Urdu",
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "اُردُو", englishDescription: "Urdu",
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "Tiếng Việt", englishDescription: "Vietn
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
campaign_player_created: "Tạo người chơi"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "Khó: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "Tiếng Việt", englishDescription: "Vietn
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "简体中文", englishDescription: "Chinese
campaign_multiplayer_description: "……在这里你可以与其他玩家进行代码肉搏战。"
campaign_player_created: "创建玩家"
campaign_player_created_description: "……在这里你可以与你的小伙伴的创造力战斗 <a href=\"/contribute#artisan\">技术指导</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "难度:"
play_as: "Play As"
spectate: "旁观他人的游戏"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "简体中文", englishDescription: "Chinese
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "繁体中文", englishDescription: "Chinese
campaign_multiplayer_description: "...在這裡你可以和其他玩家進行對戰。"
campaign_player_created: "玩家建立的關卡"
campaign_player_created_description: "...挑戰同伴的創意 <a href=\"/contribute#artisan\">技術指導</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "難度"
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "繁体中文", englishDescription: "Chinese
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "吴语", englishDescription: "Wuu (Simplifi
# campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_player_created: "Player-Created"
# campaign_player_created_description: "... in which you battle against the creativity of your fellow <a href=\"/contribute#artisan\">Artisan Wizards</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
# level_difficulty: "Difficulty: "
# play_as: "Play As"
# spectate: "Spectate"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "吴语", englishDescription: "Wuu (Simplifi
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -123,6 +123,8 @@ module.exports = nativeDescription: "吳語", englishDescription: "Wuu (Traditio
campaign_multiplayer_description: "……徠箇搭爾好搭別人代碼捉跤。"
campaign_player_created: "造玩家"
campaign_player_created_description: "……徠箇搭爾好搭爾夥計造起來個賭打 <a href=\"/contribute#artisan\">技術相幫</a>."
# campaign_classic_algorithms: "Classic Algorithms"
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
level_difficulty: "難度:"
play_as: "Play As"
spectate: "望別人攪遊戲"
@ -953,6 +955,7 @@ module.exports = nativeDescription: "吳語", englishDescription: "Wuu (Traditio
# achievement: "Achievement"
# clas: "CLAs"
# play_counts: "Play Counts"
# feedback: "Feedback"
# delta:
# added: "Added"

View file

@ -12,12 +12,12 @@ module.exports = class Level extends CocoModel
o = @denormalize supermodel, session
# Figure out Components
o.levelComponents = _.cloneDeep (lc.attributes for lc in supermodel.getModels LevelComponent)
o.levelComponents = $.extend true, [], (lc.attributes for lc in supermodel.getModels LevelComponent)
@sortThangComponents o.thangs, o.levelComponents, 'Level Thang'
@fillInDefaultComponentConfiguration o.thangs, o.levelComponents
# Figure out Systems
systemModels = _.cloneDeep (ls.attributes for ls in supermodel.getModels LevelSystem)
systemModels = $.extend true, [], (ls.attributes for ls in supermodel.getModels LevelSystem)
o.systems = @sortSystems o.systems, systemModels
@fillInDefaultSystemConfiguration o.systems
@ -30,7 +30,7 @@ module.exports = class Level extends CocoModel
denormalize: (supermodel, session) ->
o = $.extend true, {}, @attributes
if @get('type') is 'hero'
if @get('type', true) is 'hero'
# TOOD: figure out if/when/how we are doing this for non-Hero levels that aren't expecting denormalization.
for levelThang in o.thangs
@denormalizeThang(levelThang, supermodel, session)
@ -93,7 +93,7 @@ module.exports = class Level extends CocoModel
system2 = _.find levelSystems, {original: d.original}
visit system2
#console.log 'sorted systems adding', systemModel.name
sorted.push {model: systemModel, config: _.cloneDeep system.config}
sorted.push {model: systemModel, config: $.extend true, {}, system.config}
originalsSeen[system.original] = true
visit system for system in levelSystems ? []
sorted
@ -140,7 +140,7 @@ module.exports = class Level extends CocoModel
for component in thang.components or []
continue unless lc = _.find levelComponents, {original: component.original}
component.config ?= {}
TreemaUtils.populateDefaults(component.config, lc.configSchema)
TreemaUtils.populateDefaults(component.config, lc.configSchema, tv4)
@lastType = 'component'
@lastOriginal = component.original
@walkDefaults component.config, lc.configSchema.properties
@ -148,7 +148,7 @@ module.exports = class Level extends CocoModel
fillInDefaultSystemConfiguration: (levelSystems) ->
for system in levelSystems ? []
system.config ?= {}
TreemaUtils.populateDefaults(system.config, system.model.configSchema)
TreemaUtils.populateDefaults(system.config, system.model.configSchema, tv4)
@lastType = 'system'
@lastOriginal = system.model.name
@walkDefaults system.config, system.model.configSchema.properties

View file

@ -3,10 +3,14 @@ CocoModel = require './CocoModel'
module.exports = class LevelComponent extends CocoModel
@className: 'LevelComponent'
@schema: require 'schemas/models/level_component'
@EquipsID: '53e217d253457600003e3ebb'
@ItemID: '53e12043b82921000051cdf9'
@AttacksID: '524b7ba57fc0f6d519000016'
@PhysicalID: '524b75ad7fc0f6d519000001'
@ExistsID: '524b4150ff92f1f4f8000024'
@LandID: '524b7aff7fc0f6d519000006'
@CollidesID: '524b7b857fc0f6d519000012'
urlRoot: '/db/level.component'
set: (key, val, options) ->

View file

@ -212,6 +212,11 @@ LevelSchema = c.object {
thangs: []
systems: []
victory: {}
type: 'hero'
goals: [
{id: 'ogres-die', name: 'Ogres must die.', killThangs: ['ogres'], worldEndsAfter: 3}
{id: 'humans-survive', name: 'Humans must survive.', saveThangs: ['humans'], howMany: 1, worldEndsAfter: 3, hiddenGoal: true}
]
}
c.extendNamedProperties LevelSchema # let's have the name be the first property
_.extend LevelSchema.properties,
@ -240,6 +245,7 @@ _.extend LevelSchema.properties,
banner: {type: 'string', format: 'image-file', title: 'Banner'}
goals: c.array {title: 'Goals', description: 'An array of goals which are visible to the player and can trigger scripts.'}, GoalSchema
type: c.shortString(title: 'Type', description: 'What kind of level this is.', 'enum': ['campaign', 'ladder', 'ladder-tutorial', 'hero'])
terrain: c.terrainString
showsGuide: c.shortString(title: 'Shows Guide', description: 'If the guide is shown at the beginning of the level.', 'enum': ['first-time', 'always'])
c.extendBasicProperties LevelSchema, 'level'

View file

@ -106,6 +106,7 @@ _.extend ThangTypeSchema.properties,
containers: c.object {title: 'Containers', additionalProperties: ContainerObjectSchema}
animations: c.object {title: 'Animations', additionalProperties: RawAnimationObjectSchema}
kind: c.shortString {enum: ['Unit', 'Floor', 'Wall', 'Doodad', 'Misc', 'Mark', 'Item'], default: 'Misc', title: 'Kind'}
terrains: c.array {title: 'Terrains', description: 'If specified, limits this ThangType to levels with matching terrains.', uniqueItems: true}, c.terrainString
actions: c.object {title: 'Actions', additionalProperties: {$ref: '#/definitions/action'}}
soundTriggers: c.object {title: 'Sound Triggers', additionalProperties: c.array({}, {$ref: '#/definitions/sound'})},

View file

@ -200,3 +200,5 @@ me.activity = me.object {description: 'Stats on an activity'},
first: me.date()
last: me.date()
count: {type: 'integer', minimum: 0}
me.terrainString = me.shortString {enum: ['Grass', 'Dungeon', 'Indoor'], title: 'Terrain', description: 'Which terrain type this is.'}

View file

@ -43,5 +43,19 @@ module.exports =
'level:reload-thang-type': c.object {required: ['thangType']},
thangType: {type: 'object'}
'editor:random-terrain-generated': c.object {required: ['thangs']},
'editor:random-terrain-generated': c.object {required: ['thangs', 'terrain']},
thangs: c.array {}, {type: 'object'}
terrain: c.terrainString
'editor:terrain-changed': c.object {required: ['terrain']},
terrain:
oneOf: [
c.terrainString
{type: ['null', 'undefined']}
]
'editor:thang-type-kind-changed': c.object {required: ['kind']},
kind: {type: 'string'}
'editor:thang-type-color-groups-changed': c.object {required: ['colorGroups']},
colorGroups: {type: 'object'}

View file

@ -25,7 +25,7 @@ module.exports =
viewClass: {type: 'function'}
viewArgs: {type: 'array'}
'achievements:new': c.object {required: 'earnedAchievements'},
'achievements:new': c.object {required: ['earnedAchievements']},
earnedAchievements: {type: 'object'}
'ladder:game-submitted': c.object {required: ['session', 'level']},

View file

@ -0,0 +1,76 @@
@import "../../bootstrap/mixins"
#add-thangs-view
$addPaletteIconColumns: 6
$addPaletteIconWidth: 40px
$addPaletteIconPadding: 0px
$addPaletteIconMargin: 4px
$addPaletteWidth: ($addPaletteIconWidth + 2 * $addPaletteIconPadding + 2 * $addPaletteIconMargin) * $addPaletteIconColumns + 20
width: $addPaletteWidth
background: white
box-sizing: border-box
position: absolute
right: 0
top: 0
bottom: 0
padding: 5px
border: 1px solid
input
width: 100%
margin-top: 5px
#thangs-list
position: absolute
left: 8px
top: 80px
bottom: 0px
overflow: scroll
margin: 0
h3
margin: 0 0 10px
width: 100%
h4
margin: 0 0 10px
clear: both
padding: 5px
background: rgba(150, 150, 150, 0.5)
width: $addPaletteWidth - 20px
box-sizing: border-box
.clearfix
margin-bottom: 20px
.add-thang-palette-icon
position: relative
float: left
background: white
padding: $addPaletteIconPadding
margin: $addPaletteIconMargin
cursor: pointer
width: $addPaletteIconWidth
height: $addPaletteIconWidth
img
position: absolute
width: $addPaletteIconWidth
height: $addPaletteIconWidth
transition: box-shadow 0.25s ease-out
&:hover
$hoverScaleIncreaseFactor: 0.2
outline: 1px dotted blue
img
left: -($hoverScaleIncreaseFactor / 2) * $addPaletteIconWidth
top: -($hoverScaleIncreaseFactor / 2) * $addPaletteIconWidth
width: (1 + $hoverScaleIncreaseFactor) * $addPaletteIconWidth
height: (1 + $hoverScaleIncreaseFactor) * $addPaletteIconWidth
&.selected
outline: 1px solid blue
@include box-shadow(0px 5px 25px rgba(79, 79, 213, 0.6))
background: #add8e6

View file

@ -0,0 +1,85 @@
@import "../../bootstrap/mixins"
#thangs-tab-view
$extantThangsWidth: 300px
position: absolute
top: 0
bottom: 0
overflow: hidden
left: 0
right: 0
#thangs-container-toggle
left: 0
#thangs-palette-toggle
right: 0
.toggle
position: absolute
z-index: 12
padding: 8px
.thangs-container
background: white
width: $extantThangsWidth
position: absolute
left: 0
top: 0
bottom: 0
z-index: 11
padding: 5px
border: 1px solid black
h3
text-align: right
margin: 0
.editor-nano-container
height: 90%
position: relative
top: 20px
#thangs-treema
position: absolute
top: 37px
left: 0
right: 0
bottom: 0
overflow: scroll
margin: 0
outline: thin
border: none
border-top: 1px solid black
.treema-children .treema-row *
cursor: pointer !important
.world-container
margin-left: 0
margin-right: 0
box-sizing: border-box
.world-container
position: relative
#canvas-wrapper
width: 100%
position: relative
text-align: center
#randomize-button
position: absolute
top: 45%
height: 40px
// Below snatched from play/level.sass; should refactor?
canvas#surface
background-color: #ddd
width: 100%
display: block
z-index: 1
border: 1px solid black

View file

@ -1,265 +0,0 @@
@import "../../bootstrap/mixins"
$mobile: 1050px
#editor-level-thangs-tab-view
$addPaletteIconColumns: 3
$extantThangsWidth: 300px
$addPaletteIconWidth: 40px
$addPaletteIconPadding: 0px
$addPaletteIconMargin: 4px
$addPaletteWidth: ($addPaletteIconWidth + 2 * $addPaletteIconPadding + 2 * $addPaletteIconMargin) * $addPaletteIconColumns + 20
#toggle
display: none
position: absolute
z-index: 11
left: -14px
@media screen and (max-width: $mobile)
display: block
.toggle
left: 0
.toggle
display: none
float: none
z-index: 11
position: absolute
right: -14px
z-index: 11
margin: 0
padding: 8px
@media screen and (max-width: $mobile)
display: block
.thangs-column
background-color: #E4CF8C
@media screen and (max-width: $mobile)
display: block
h3
@media screen and (max-width: $mobile)
display: none
#all-thangs
display: block
@media screen and (max-width: $mobile)
display: none
.thangs-container
width: $extantThangsWidth
position: absolute
left: 0
top: 0
bottom: 0
z-index: 11
@media screen and (max-width: $mobile)
width: auto
left: 18px
bottom: -18px
.btn-group
margin: 0
@media screen and (max-width: $mobile)
margin: 5px
h3
margin: 0 -20px 0 0
.editor-nano-container
height: 90%
position: relative
top: 20px
#thangs-treema
height: 100%
width: 100%
position: absolute
left: 0
right: 0
bottom: 0
overflow: scroll
margin: 0
outline: thin
@media screen and (max-width: $mobile)
margin: 5px
top: 40px
&.hide-except-Unit
.treema-node
display: none
.treema-node.treema-Unit
display: block
&.hide-except-Doodad
.treema-node
display: none
.treema-node.treema-Doodad
display: block
&.hide-except-Floor
.treema-node
display: none
.treema-node.treema-Floor
display: block
&.hide-except-Wall
.treema-node
display: none
.treema-node.treema-Wall
display: block
&.hide-except-Item
.treema-node
display: none
.treema-node.treema-Item
display: block
&.hide-except-Misc
.treema-node
display: none
.treema-node.treema-Misc
display: block
.treema-children .treema-row *
cursor: pointer !important
.world-container
margin-left: $extantThangsWidth
margin-right: $addPaletteWidth
@media screen and (max-width: $mobile)
margin-left: 0
margin-right: 0
padding: 0 20px
box-sizing: border-box
h3
margin: 0 -10px 0 0
text-align: center
.add-thangs-palette
width: $addPaletteWidth
box-sizing: border-box
position: absolute
right: 0
top: 0
bottom: 0
@media screen and (max-width: $mobile)
display: none
right: 18px
z-index: 11
width: $addPaletteWidth + 10
bottom: -15px
//height: auto
//padding-bottom: 10px
input
width: $addPaletteWidth
margin: 0
margin-top: 5px
padding-left: 5px
@media screen and (max-width: $mobile)
margin: 0 5px
#thangs-list-container
height: 90%
#thangs-list
position: relative
right: 0
top: 10px
bottom: 10px
overflow: scroll
height: 100%
margin: 0
@media screen and (max-width: $mobile)
margin: 0 5px
h3
margin: 0 -20px 0 0
width: 100%
h4
margin: 0 0 10px
clear: both
padding: 5px
background: rgba(150, 150, 150, 0.5)
width: $addPaletteWidth - 20px
box-sizing: border-box
.clearfix
margin-bottom: 20px
.add-thang-palette-icon
position: relative
float: left
background: white
padding: $addPaletteIconPadding
margin: $addPaletteIconMargin
cursor: pointer
width: $addPaletteIconWidth
height: $addPaletteIconWidth
img
position: absolute
width: $addPaletteIconWidth
height: $addPaletteIconWidth
transition: box-shadow 0.25s ease-out
&:hover
$hoverScaleIncreaseFactor: 0.2
outline: 1px dotted blue
img
left: -($hoverScaleIncreaseFactor / 2) * $addPaletteIconWidth
top: -($hoverScaleIncreaseFactor / 2) * $addPaletteIconWidth
width: (1 + $hoverScaleIncreaseFactor) * $addPaletteIconWidth
height: (1 + $hoverScaleIncreaseFactor) * $addPaletteIconWidth
&.selected
outline: 1px solid blue
@include box-shadow(0px 5px 25px rgba(79, 79, 213, 0.6))
background: #add8e6
.world-container
position: relative
#canvas-wrapper
width: 100%
position: relative
text-align: center
#randomize-button
position: absolute
top: 45%
height: 40px
// Below snatched from play/level.sass; should refactor?
canvas#surface
background-color: #ddd
width: 100%
display: block
z-index: 1
$GI: 0.5 // gradient intensity; can tweak this 0-1
.gradient
position: absolute
z-index: 10
#canvas-left-gradient
left: 0px
width: 5px
background: linear-gradient(to left, rgba(0,0,0,0) 0%,rgba(0,0,0,0.8*$GI) 100%)
bottom: 0
top: 0
#canvas-top-gradient
top: 0
height: 5px
left: 0
right: 0
background: linear-gradient(to top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.8*$GI) 100%)

View file

@ -18,7 +18,7 @@ block header
ul.nav.navbar-nav.nav-tabs
li.active
a(href="#editor-level-thangs-tab-view", data-toggle="tab", data-i18n="editor.level_tab_thangs") Thangs
a(href="#thangs-tab-view", data-toggle="tab", data-i18n="editor.level_tab_thangs") Thangs
li
a(href="#editor-level-scripts-tab-view", data-toggle="tab", data-i18n="editor.level_tab_scripts") Scripts
li
@ -115,7 +115,7 @@ block header
block outer_content
.outer-content
div.tab-content#level-editor-tabs
div.tab-pane.active#editor-level-thangs-tab-view
div.tab-pane.active#thangs-tab-view
div.tab-pane#editor-level-scripts-tab-view

View file

@ -21,3 +21,8 @@ block modal-body-content
label
input(type="checkbox", name="queryOptions" id="#{goal.id}" value="#{goal.id}")
span.spl= goal.name
block modal-footer
.modal-footer
button.btn(data-dismiss="modal", data-i18n="common.cancel") Cancel
button#save-new-achievement-link.btn.btn-primary.new-model-submit(data-i18n="common.create") Create

View file

@ -0,0 +1,22 @@
button.toggle.btn-primary#thangs-container-toggle
span.icon-list
button.toggle.btn-primary#thangs-palette-toggle
span.icon-plus
.thangs-container.hide#all-thangs
h3(data-i18n="editor.level_tab_thangs_title") Current Thangs
#thangs-treema(title="Double click to configure a thang")
.world-container
#canvas-wrapper
button.btn.btn-primary(id="randomize-button", data-toggle="coco-modal", data-target="editor/level/modals/TerrainRandomizeModal", data-i18n="editor.randomize", title="Randomize Terrain") Randomize
ul.dropdown-menu#contextmenu
li#delete
a(data-i18n="editor.delete") Delete
li#duplicate
a(data-i18n="editor.duplicate") Duplicate
canvas(width=924, height=589)#surface
#canvas-left-gradient.gradient
#canvas-top-gradient.gradient
#add-thangs-view
#level-thang-edit-view.secret

View file

@ -1,39 +0,0 @@
div#toggle
button.navbar-toggle.toggle.btn-primary#thangs-container-toggle(type="button", data-toggle="collapse", data-target="#all-thangs")
span.icon-list
button.navbar-toggle.toggle.btn-primary#thangs-palette-toggle(type="button", data-toggle="collapse", data-target="#add-thangs-column")
span.icon-plus
.thangs-container.thangs-column#all-thangs
h3(data-i18n="editor.level_tab_thangs_title") Current Thangs
.btn-group(data-toggle="buttons-radio")#extant-thangs-filter
button.btn.btn-primary(data-i18n="editor.level_tab_thangs_all") All
button.btn.btn-primary(value="Unit", title="Unit")
i.icon-user
button.btn.btn-primary(value="Wall", title="Wall")
i.icon-home
button.btn.btn-primary(value="Floor", title="Floor")
i.icon-globe
button.btn.btn-primary(value="Doodad", title="Doodad")
i.icon-leaf
button.btn.btn-primary(value="Item", title="Item")
i.icon-gift
button.btn.btn-primary(value="Misc", title="Misc")
i.icon-question-sign
.editor-nano-container.nano
#thangs-treema.nano-content(title="Double click to configure a thang")
.world-container.thangs-column
h3(data-i18n="editor.level_tab_thangs_conditions") Starting Conditions
#canvas-wrapper
button.btn.btn-primary(id="randomize-button", data-toggle="coco-modal", data-target="editor/level/modals/TerrainRandomizeModal", data-i18n="editor.randomize", title="Randomize Terrain") Randomize
ul.dropdown-menu#contextmenu
li#delete
a(data-i18n="editor.delete") Delete
li#duplicate
a(data-i18n="editor.duplicate") Duplicate
canvas(width=924, height=589)#surface
#canvas-left-gradient.gradient
#canvas-top-gradient.gradient
.add-thangs-palette.thangs-column#add-thangs-column
#level-thang-edit-view.secret

View file

@ -8,8 +8,9 @@ block modal-body-content
- if (!showDevBits) { // Not done yet.
- submenus.splice(4, 1);
- submenus.splice(2, 1);
- submenus.splice(0, 1);
- }
- if (!showInventory)
- submenus.splice(0, 1);
ul.nav.nav-tabs
for submenu, index in submenus
li(class=index ? "" : "active")
@ -19,10 +20,6 @@ block modal-body-content
.tab-content
for submenu, index in submenus
.tab-pane(id=submenu + '-view')
h3= submenu + submenu + submenu
p
| Lorem ipsum dolor sit amet, charetra varius quam sit amet vulputate.
| Quisque mauris augue, molestie tincidunt condimentum vitae, gravida a libero.
.clearfix
block modal-footer

View file

@ -19,7 +19,8 @@ block modal-body-content
tr
td
input(type="checkbox", value=data._id).select
td #{data.version.major}.#{data.version.minor}
td
a(href="/editor/#{page}/#{data._id}") #{data.version.major}.#{data.version.minor}
td= moment(data.created).format('l')
td= data.creator
td #{data.commitMessage}

View file

@ -12,6 +12,28 @@ nodes = require '../level/treema_nodes'
ThangType = require 'models/ThangType'
CocoCollection = require 'collections/CocoCollection'
LC = (componentName, config) -> original: LevelComponent[componentName + 'ID'], majorVersion: 0, config: config
DEFAULT_COMPONENTS =
Unit: [LC('Equips')]
Floor: [
LC('Exists', stateless: true)
LC('Physical', width: 20, height: 17, depth: 2, shape: 'sheet', pos: {x: 10, y: 8.5, z: 1})
LC('Land')
]
Wall: [
LC('Exists', stateless: true)
LC('Physical', width: 4, height: 4, depth: 12, shape: 'box', pos: {x: 2, y: 2, z: 6})
LC('Collides', collisionType: 'static', collisionCategory: 'obstacles', mass: 1000, fixedRotation: true, restitution: 1)
]
Doodad: [
LC('Exists', stateless: true)
LC('Physical')
LC('Collides', collisionType: 'static', fixedRotation: true)
]
Misc: [LC('Exists'), LC('Physical')]
Mark: []
Item: [LC('Item')]
class ItemThangTypeSearchCollection extends CocoCollection
url: '/db/thang.type?view=items&project=original,name,version,slug,kind,components'
model: ThangType
@ -20,6 +42,9 @@ module.exports = class ThangComponentsEditView extends CocoView
id: 'thang-components-edit-view'
template: template
subscriptions:
'editor:thang-type-kind-changed': 'onThangTypeKindChanged'
events:
'click #add-components-button': 'onAddComponentsButtonClicked'
@ -33,11 +58,11 @@ module.exports = class ThangComponentsEditView extends CocoView
@world = options.world
@level = options.level
@loadComponents(@components)
setThangType: (@thangType) ->
return unless componentRefs = @thangType?.get('components')
@loadComponents(componentRefs)
loadComponents: (components) ->
for componentRef in components
# just to handle if ever somehow the same component is loaded twice, through bad data and alike
@ -73,7 +98,7 @@ module.exports = class ThangComponentsEditView extends CocoView
type: 'object'
default: defaultValue
additionalProperties: Level.schema.properties.thangs.items.properties.components.items
},
},
data: $.extend true, {}, components
callbacks: {select: @onSelectComponent, change: @onComponentsTreemaChanged}
nodeClasses:
@ -256,7 +281,7 @@ module.exports = class ThangComponentsEditView extends CocoView
thangComponent.config = e.config
foundComponent = true
break
if not foundComponent
@components.push({
original: e.component.get('original')
@ -269,7 +294,7 @@ module.exports = class ThangComponentsEditView extends CocoView
if subview.component.get('original') is e.component.get('original')
_.defer -> subview.setIsDefaultComponent(false)
break
@updateComponentsList()
@reportChanges()
@ -344,18 +369,24 @@ module.exports = class ThangComponentsEditView extends CocoView
@loadComponents(sparseComponents)
@components = @components.concat(sparseComponents)
@onComponentsChanged()
onThangTypeKindChanged: (e) ->
return unless defaultComponents = DEFAULT_COMPONENTS[e.kind]
for component in defaultComponents when not _.find(@components, original: component.original)
@components.push component
@onComponentsAdded()
destroy: ->
@componentsTreema?.destroy()
super()
class ThangComponentsObjectNode extends TreemaObjectNode
addNewChild: -> @addNewChildForKey('') # HACK to get the object adding to act more like adding to an array
getChildren: ->
children = super(arguments...)
children.sort(@sortFunction)
sortFunction: (a, b) =>
a = a.value ? a.defaultData
b = b.value ? b.defaultData

View file

@ -35,7 +35,9 @@ module.exports = class RelatedAchievementsView extends CocoView
c
onNewAchievementSaved: (achievement) ->
app.router.navigate('/editor/achievement/' + (achievement.get('slug') or achievement.id), {trigger: true})
# We actually open the new tab in NewAchievementModal, so we don't replace this window.
#url = '/editor/achievement/' + (achievement.get('slug') or achievement.id)
#app.router.navigate(, {trigger: true}) # Let's open a new tab instead.
makeNewAchievement: ->
modal = new NewAchievementModal model: Achievement, modelLabel: 'Achievement', level: @level

View file

@ -8,6 +8,9 @@ module.exports = class NewAchievementModal extends NewModelModal
template: template
plain: false
events:
'click #save-new-achievement-link': 'onAchievementSubmitted'
constructor: (options) ->
super options
@level = options.level
@ -18,6 +21,11 @@ module.exports = class NewAchievementModal extends NewModelModal
console.debug 'level', c.level
c
onAchievementSubmitted: (e) ->
slug = _.string.slugify @$el.find('#name').val()
url = "/editor/achievement/#{slug}"
window.open url, '_blank'
createQuery: ->
checked = @$el.find('[name=queryOptions]:checked')
checkedValues = ($(check).val() for check in checked)

View file

@ -3,17 +3,21 @@ template = require 'templates/editor/level/modal/terrain_randomize'
CocoModel = require 'models/CocoModel'
clusters = {
'hero': {
'thangs': ['Hero Placeholder']
'margin': 1
}
'rocks': {
'thangs': ['Rock 1', 'Rock 2', 'Rock 3', 'Rock 4', 'Rock 5', 'Rock Cluster 1', 'Rock Cluster 2', 'Rock Cluster 3']
'margin': 1
}
'trees': {
'thangs': ['Tree 1', 'Tree 2', 'Tree 3', 'Tree 4']
'margin': 0
'margin': 0.5
}
'shrubs': {
'thangs': ['Shrub 1', 'Shrub 2', 'Shrub 3']
'margin': 0
'margin': 0.5
}
'houses': {
'thangs': ['House 1', 'House 2', 'House 3', 'House 4']
@ -83,6 +87,7 @@ clusters = {
presets = {
'dungeon': {
'terrainName': 'Dungeon'
'type':'dungeon'
'borders':'dungeon_wall'
'borderNoise':0
@ -97,6 +102,14 @@ presets = {
'thickness': [2,2]
'cluster': 'dungeon_wall'
}
'hero': {
'num': [1, 1]
'width': 2
'height': 2
'clusters': {
'hero': [1, 1]
}
}
'Barrels': {
'num': [1,1]
'width': [8, 12]
@ -116,6 +129,7 @@ presets = {
}
}
'indoor': {
'terrainName': 'Indoor'
'type':'indoor'
'borders':'indoor_wall'
'borderNoise':0
@ -130,6 +144,14 @@ presets = {
'thickness': [2,2]
'cluster': 'indoor_wall'
}
'hero': {
'num': [1, 1]
'width': 2
'height': 2
'clusters': {
'hero': [1, 1]
}
}
'furniture': {
'num':[1,2]
'width': 15
@ -141,6 +163,7 @@ presets = {
}
}
'grassy': {
'terrainName': 'Grass'
'type':'grassy'
'borders':'trees'
'borderNoise':1
@ -148,6 +171,14 @@ presets = {
'borderThickness':3
'floors':'grass_floor'
'decorations': {
'hero': {
'num': [1, 1]
'width': 2
'height': 2
'clusters': {
'hero': [1, 1]
}
}
'house': {
'num':[1,2] #min-max
'width': 15
@ -195,8 +226,8 @@ thangSizes = {
'borderSize': {
'x':4
'y':4
}
}
}}
module.exports = class TerrainRandomizeModal extends ModalView
id: 'terrain-randomize-modal'
@ -215,7 +246,7 @@ module.exports = class TerrainRandomizeModal extends ModalView
presetType = target.attr 'data-preset-type'
presetSize = target.attr 'data-preset-size'
@randomizeThangs presetType, presetSize
Backbone.Mediator.publish 'editor:random-terrain-generated', thangs: @thangs
Backbone.Mediator.publish 'editor:random-terrain-generated', thangs: @thangs, terrain: presets[presetType].terrainName
@hide()
randomizeThangs: (presetName, presetSize) ->
@ -280,7 +311,7 @@ module.exports = class TerrainRandomizeModal extends ModalView
'id': @getRandomThang(clusters['torch'].thangs)
'pos': {
'x': i + preset.borderSize
'y': presetSize.y - preset.borderSize
'y': presetSize.y - preset.borderSize / 2
}
'margin': clusters['torch'].margin
}
@ -289,7 +320,7 @@ module.exports = class TerrainRandomizeModal extends ModalView
'id': @getRandomThang(clusters['chains'].thangs)
'pos': {
'x': i + preset.borderSize
'y': presetSize.y - preset.borderSize
'y': presetSize.y - preset.borderSize / 2
}
'margin': clusters['chains'].margin
}
@ -346,53 +377,57 @@ module.exports = class TerrainRandomizeModal extends ModalView
continue
buildRoom: (preset, presetSize, room) ->
grid = preset.borderSize
while true
rect = {
'width':presetSize.sizeFactor * (room.width[0] + preset.borderSize * _.random(0, (room.width[1] - room.width[0])/preset.borderSize))
'height':presetSize.sizeFactor * (room.height[0] + preset.borderSize * _.random(0, (room.height[1] - room.height[0])/preset.borderSize))
'width':presetSize.sizeFactor * (room.width[0] + grid * _.random(0, (room.width[1] - room.width[0])/grid))
'height':presetSize.sizeFactor * (room.height[0] + grid * _.random(0, (room.height[1] - room.height[0])/grid))
}
# This logic isn't quite right--it makes the rooms bigger than intended--but it's snapping correctly, which is fine for now.
rect.width = Math.round((rect.width - grid) / (2 * grid)) * 2 * grid + grid
rect.height = Math.round((rect.height - grid) / (2 * grid)) * 2 * grid + grid
roomThickness = _.random(room.thickness[0], room.thickness[1])
rect.x = _.random(rect.width/2 + preset.borderSize * (roomThickness+1.5), presetSize.x - rect.width/2 - preset.borderSize * (roomThickness+1.5))
rect.y = _.random(rect.height/2 + preset.borderSize * (roomThickness+2.5), presetSize.y - rect.height/2 - preset.borderSize * (roomThickness+3.5))
rect.x = _.random(rect.width/2 + grid * (roomThickness+1.5), presetSize.x - rect.width/2 - grid * (roomThickness+1.5))
rect.y = _.random(rect.height/2 + grid * (roomThickness+2.5), presetSize.y - rect.height/2 - grid * (roomThickness+3.5))
# Snap room walls to the wall grid.
rect.x = Math.round((rect.x - preset.borderSize / 2) / preset.borderSize) * preset.borderSize + preset.borderSize / 2
rect.y = Math.round((rect.y - preset.borderSize / 2) / preset.borderSize) * preset.borderSize + preset.borderSize / 2
rect.x = Math.round((rect.x - grid / 2) / grid) * grid
rect.y = Math.round((rect.y - grid / 2) / grid) * grid
break if @addRect {
'x': rect.x
'y': rect.y
'width': rect.width + 2.5 * roomThickness * preset.borderSize
'height': rect.height + 2.5 * roomThickness * preset.borderSize
'width': rect.width + 2.5 * roomThickness * grid
'height': rect.height + 2.5 * roomThickness * grid
}
xRange = _.range(rect.x - rect.width/2 + preset.borderSize, rect.x + rect.width/2, preset.borderSize)
xRange = _.range(rect.x - rect.width/2 + grid, rect.x + rect.width/2, grid)
topDoor = _.random(1) > 0.5
topDoorX = xRange[_.random(0, xRange.length-1)]
bottomDoor = if not topDoor then true else _.random(1) > 0.5
bottomDoorX = xRange[_.random(0, xRange.length-1)]
for t in _.range(0, roomThickness+1)
for i in _.range(rect.x - rect.width/2 - (t-1) * preset.borderSize, rect.x + rect.width/2 + t * preset.borderSize, preset.borderSize)
for i in _.range(rect.x - rect.width/2 - (t-1) * grid, rect.x + rect.width/2 + t * grid, grid)
# Bottom wall
thang = {
'id': @getRandomThang(clusters[room.cluster].thangs)
'pos': {
'x': i
'y': rect.y - rect.height/2 - t * preset.borderSize
'y': rect.y - rect.height/2 - t * grid
}
'margin': clusters[room.cluster].margin
}
if i is bottomDoorX and bottomDoor
thang.id = @getRandomThang(clusters['doors'].thangs)
thang.pos.y -= preset.borderSize/3
thang.pos.y -= grid/3
@addThang thang unless i is bottomDoorX and t isnt roomThickness and bottomDoor
if t is roomThickness and i isnt rect.x - rect.width/2 - (t-1) * preset.borderSize and preset.type is 'dungeon'
if ( i isnt bottomDoorX and i isnt bottomDoorX + preset.borderSize ) or not bottomDoor
if t is roomThickness and i isnt rect.x - rect.width/2 - (t-1) * grid and preset.type is 'dungeon'
if ( i isnt bottomDoorX and i isnt bottomDoorX + grid ) or not bottomDoor
@addThang {
'id': @getRandomThang(clusters['torch'].thangs)
'pos': {
'x': thang.pos.x - preset.borderSize / 2
'y': thang.pos.y + preset.borderSize / 2
'x': thang.pos.x - grid / 2
'y': thang.pos.y + grid
}
'margin': clusters['torch'].margin
}
@ -402,22 +437,22 @@ module.exports = class TerrainRandomizeModal extends ModalView
'id': @getRandomThang(clusters[room.cluster].thangs)
'pos': {
'x': i
'y': rect.y + rect.height/2 + t * preset.borderSize
'y': rect.y + rect.height/2 + t * grid
}
'margin': clusters[room.cluster].margin
}
if i is topDoorX and topDoor
thang.id = @getRandomThang(clusters['doors'].thangs)
thang.pos.y -= preset.borderSize
thang.pos.y -= grid
@addThang thang unless i is topDoorX and t isnt roomThickness and topDoor
for t in _.range(0, roomThickness)
for i in _.range(rect.y - rect.height/2 - t * preset.borderSize, rect.y + rect.height/2 + (t+1) * preset.borderSize, preset.borderSize)
for i in _.range(rect.y - rect.height/2 - t * grid, rect.y + rect.height/2 + (t+1) * grid, grid)
# Left wall
@addThang {
'id': @getRandomThang(clusters[room.cluster].thangs)
'pos': {
'x': rect.x - rect.width/2 - t * preset.borderSize
'x': rect.x - rect.width/2 - t * grid
'y': i
}
'margin': clusters[room.cluster].margin
@ -427,7 +462,7 @@ module.exports = class TerrainRandomizeModal extends ModalView
@addThang {
'id': @getRandomThang(clusters[room.cluster].thangs)
'pos': {
'x': rect.x + rect.width/2 + t * preset.borderSize
'x': rect.x + rect.width/2 + t * grid
'y': i
}
'margin': clusters[room.cluster].margin

View file

@ -13,12 +13,13 @@ module.exports = class SettingsTabView extends CocoView
# not thangs or scripts or the backend stuff
editableSettings: [
'name', 'description', 'documentation', 'nextLevel', 'background', 'victory', 'i18n', 'icon', 'goals',
'type', 'showsGuide', 'banner', 'employerDescription'
'type', 'terrain', 'showsGuide', 'banner', 'employerDescription'
]
subscriptions:
'editor:level-loaded': 'onLevelLoaded'
'editor:thangs-edited': 'onThangsEdited'
'editor:random-terrain-generated': 'onRandomTerrainGenerated'
constructor: (options) ->
super options
@ -47,6 +48,7 @@ module.exports = class SettingsTabView extends CocoView
@settingsTreema = @$el.find('#settings-treema').treema treemaOptions
@settingsTreema.build()
@settingsTreema.open()
@lastTerrain = data.terrain
getThangIDs: ->
(t.id for t in @level.get('thangs') ? [])
@ -56,11 +58,17 @@ module.exports = class SettingsTabView extends CocoView
for key in @editableSettings
continue if @settingsTreema.data[key] is undefined
@level.set key, @settingsTreema.data[key]
if (terrain = @settingsTreema.data.terrain) isnt @lastTerrain
@lastTerrain = terrain
Backbone.Mediator.publish 'editor:terrain-changed', terrain: terrain
onThangsEdited: (e) ->
# Update in-place so existing Treema nodes refer to the same array.
@thangIDs?.splice(0, @thangIDs.length, @getThangIDs()...)
onRandomTerrainGenerated: (e) ->
@settingsTreema.set '/terrain', e.terrain
destroy: ->
@settingsTreema?.destroy()
super()

View file

@ -17,6 +17,7 @@ module.exports = class SystemsTabView extends CocoView
'editor:edit-level-system': 'editLevelSystem'
'editor:level-system-editing-ended': 'onLevelSystemEditingEnded'
'editor:level-loaded': 'onLevelLoaded'
'editor:terrain-changed': 'onTerrainChanged'
events:
'click #add-system-button': 'addLevelSystem'
@ -103,6 +104,20 @@ module.exports = class SystemsTabView extends CocoView
@removeSubView @levelSystemEditView
@levelSystemEditView = null
onTerrainChanged: (e) ->
defaultPathfinding = e.terrain in ['Dungeon', 'Indoor']
return unless AI = @systemsTreema.get 'original=528110f30268d018e3000001'
return if AI.config?.findsPaths is defaultPathfinding
AI.config ?= {}
AI.config.findsPaths = defaultPathfinding
@systemsTreema.set 'original=528110f30268d018e3000001', AI
noty {
text: "AI System defaulted pathfinding to #{defaultPathfinding} for terrain #{e.terrain}."
layout: 'topCenter'
timeout: 5000
type: 'information'
}
buildDefaultSystems: ->
[
{original: '528112c00268d018e3000008', majorVersion: 0} # Event
@ -120,8 +135,11 @@ module.exports = class SystemsTabView extends CocoView
{original: '528111b30268d018e3000004', majorVersion: 0} # Alliance
{original: '528114e60268d018e300001a', majorVersion: 0} # UI
{original: '528114040268d018e3000011', majorVersion: 0} # Physics
{original: '52ae4f02a4dcd4415200000b', majorVersion: 0} # Display
{original: '52e953e81b2028d102000004', majorVersion: 0} # Effect
{original: '52f1354370fb890000000005', majorVersion: 0} # Magic
]
destroy: ->
@systemsTreema?.destroy()
super()
@ -146,8 +164,9 @@ class LevelSystemNode extends TreemaObjectNode
buildValueForDisplay: (valEl, data) ->
return super valEl unless data.original and @system
name = "#{@system.get('name')} v#{@system.get('version').major}"
@buildValueForDisplaySimply valEl, "#{name}"
name = @system.get 'name'
name += " v#{@system.get('version').major}" if @system.get('version').major
@buildValueForDisplaySimply valEl, name
onEnterPressed: (e) ->
super e

View file

@ -1,5 +1,5 @@
CocoView = require 'views/kinds/CocoView'
add_thangs_template = require 'templates/editor/level/add_thangs'
add_thangs_template = require 'templates/editor/level/add-thangs-view'
ThangType = require 'models/ThangType'
CocoCollection = require 'collections/CocoCollection'
@ -11,8 +11,8 @@ class ThangTypeSearchCollection extends CocoCollection
@url += "&term=#{term}" if term
module.exports = class AddThangsView extends CocoView
id: 'add-thangs-column'
className: 'add-thangs-palette thangs-column'
id: 'add-thangs-view'
className: 'add-thangs-palette hide'
template: add_thangs_template
events:

View file

@ -1,6 +1,6 @@
CocoView = require 'views/kinds/CocoView'
AddThangsView = require './AddThangsView'
thangs_template = require 'templates/editor/level/thangs_tab'
thangs_template = require 'templates/editor/level/thangs-tab-view'
Level = require 'models/Level'
ThangType = require 'models/ThangType'
LevelComponent = require 'models/LevelComponent'
@ -15,17 +15,15 @@ ComponentsCollection = require 'collections/ComponentsCollection'
MOVE_MARGIN = 0.15
MOVE_SPEED = 13
# Essential component original ids
componentOriginals =
'existence.Exists': '524b4150ff92f1f4f8000024'
'physics.Physical': '524b75ad7fc0f6d519000001'
# Let us place these on top of other Thangs
overlappableThangTypeNames = ['Torch', 'Chains', 'Bird', 'Cloud 1', 'Cloud 2', 'Cloud 3', 'Waterfall', 'Obstacle']
class ThangTypeSearchCollection extends CocoCollection
url: '/db/thang.type?project=original,name,version,slug,kind,components'
model: ThangType
module.exports = class ThangsTabView extends CocoView
id: 'editor-level-thangs-tab-view'
id: 'thangs-tab-view'
className: 'tab-pane active'
template: thangs_template
@ -40,6 +38,7 @@ module.exports = class ThangsTabView extends CocoView
'editor:view-switched': 'onViewSwitched'
'sprite:dragged': 'onSpriteDragged'
'sprite:mouse-up': 'onSpriteMouseUp'
'sprite:mouse-down': 'onSpriteMouseDown'
'sprite:double-clicked': 'onSpriteDoubleClicked'
'surface:stage-mouse-up': 'onStageMouseUp'
'editor:random-terrain-generated': 'onRandomTerrainGenerated'
@ -49,7 +48,7 @@ module.exports = class ThangsTabView extends CocoView
'click #delete': 'onDeleteClicked'
'click #duplicate': 'onDuplicateClicked'
'click #thangs-container-toggle': 'toggleThangsContainer'
# 'click #thangs-palette-toggle': 'toggleThangsPalette'
'click #thangs-palette-toggle': 'toggleThangsPalette'
# 'click .add-thang-palette-icon': 'toggleThangsPalette'
shortcuts:
@ -96,17 +95,6 @@ module.exports = class ThangsTabView extends CocoView
context.groups = groups
context
onWindowResize: (e) ->
$('#thangs-list').height('100%')
thangsHeaderHeight = $('#thangs-header').height()
oldHeight = $('#thangs-list').height()
if $(document).width() < 1050
$('#thangs-list').height(oldHeight - thangsHeaderHeight - 40)
else
$('#thangs-list').height(oldHeight - thangsHeaderHeight - 80)
$('#all-thangs').collapse 'show'
$('#add-thangs-column').collapse 'show'
undo: (e) ->
if not @editThangView then @thangsTreema.undo() else @editThangView.undo()
@ -190,10 +178,11 @@ module.exports = class ThangsTabView extends CocoView
super()
onViewSwitched: (e) ->
@selectAddThang()
@selectAddThang null, true
@surface?.spriteBoss?.selectSprite null, null
onSpriteMouseDown: (e) ->
@dragged = false
# Sprite clicks happen after stage clicks, but we need to know whether a sprite is being clicked.
# clearTimeout @backgroundAddClickTimeout
# if e.originalEvent.nativeEvent.button == 2
@ -208,6 +197,7 @@ module.exports = class ThangsTabView extends CocoView
onSpriteDragged: (e) ->
return unless @selectedExtantThang and e.thang?.id is @selectedExtantThang?.id
@dragged = true
@surface.camera.dragDisabled = true
{stageX, stageY} = e.originalEvent
wop = @surface.camera.screenToWorld x: stageX, y: stageY
@ -226,14 +216,13 @@ module.exports = class ThangsTabView extends CocoView
@surface.camera.dragDisabled = false
return unless @selectedExtantThang and e.thang?.id is @selectedExtantThang?.id
pos = @selectedExtantThang.pos
physicalOriginal = componentOriginals['physics.Physical']
path = "id=#{@selectedExtantThang.id}/components/original=#{physicalOriginal}" # TODO: hack
path = "id=#{@selectedExtantThang.id}/components/original=#{LevelComponent.PhysicalID}"
physical = @thangsTreema.get path
return if not physical or (physical.config.pos.x is pos.x and physical.config.pos.y is pos.y)
@thangsTreema.set path + '/config/pos', x: pos.x, y: pos.y, z: pos.z
onSpriteDoubleClicked: (e) ->
return unless e.thang
return unless e.thang and not @dragged
@editThang thangID: e.thang.id
onRandomTerrainGenerated: (e) ->
@ -255,9 +244,12 @@ module.exports = class ThangsTabView extends CocoView
if e.thang and (key.alt or key.meta)
# We alt-clicked, so create a clone addThang
@selectAddThangType e.thang.spriteName, @selectedExtantThang
else if e.thang and not (@addThangSprite and @addThangType is 'Blood Torch Test') # TODO: figure out which Thangs can be placed on other Thangs
else if @justAdded()
# Skip double insert due to extra selection event
null
else if e.thang and not (@addThangSprite and @addThangType.get('name') in overlappableThangTypeNames)
# We clicked on a Thang (or its Treema), so select the Thang
@selectAddThang null
@selectAddThang null, true
@selectedExtantThangClickTime = new Date()
treemaThang = _.find @thangsTreema.childrenTreemas, (treema) => treema.data.id is @selectedExtantThang.id
if treemaThang
@ -270,16 +262,13 @@ module.exports = class ThangsTabView extends CocoView
else if @addThangSprite
# We clicked on the background when we had an add Thang selected, so add it
@addThang @addThangType, @addThangSprite.thang.pos
@lastAddTime = new Date()
# Commented out this bit so the extant thangs treema editor can select invisible thangs like arrows.
# Couldn't spot any bugs... But if there are any, better come up with a better solution.
# else
# # We clicked on the background, so deselect anything selected
# @thangsTreema.deselectAll()
justAdded: -> @lastAddTime and (new Date() - @lastAddTime) < 150
selectAddThang: (e) =>
selectAddThang: (e, forceDeselect=false) =>
return if e? and $(e.target).closest('#thang-search').length # Ignore if you're trying to search thangs
return unless e? and $(e.target).closest('#editor-level-thangs-tab-view').length or key.isPressed('esc')
return unless (e? and $(e.target).closest('#thangs-tab-view').length) or key.isPressed('esc') or forceDeselect
if e then target = $(e.target) else target = @$el.find('.add-thangs-palette') # pretend to click on background if no event
return true if target.attr('id') is 'surface'
target = target.closest('.add-thang-palette-icon')
@ -316,11 +305,11 @@ module.exports = class ThangsTabView extends CocoView
createEssentialComponents: (defaultComponents) ->
physicalConfig = {pos: {x: 10, y: 10, z: 1}}
if physicalOriginal = _.find(defaultComponents ? [], original: componentOriginals['physics.Physical'])
if physicalOriginal = _.find(defaultComponents ? [], original: LevelComponent.PhysicalID)
physicalConfig.pos.z = physicalOriginal.config?.pos?.z ? 1 # Get the z right
[
{original: componentOriginals['existence.Exists'], majorVersion: 0, config: {}}
{original: componentOriginals['physics.Physical'], majorVersion: 0, config: physicalConfig}
{original: LevelComponent.ExistsID, majorVersion: 0, config: {}}
{original: LevelComponent.PhysicalID, majorVersion: 0, config: physicalConfig}
]
createAddThang: ->
@ -405,6 +394,11 @@ module.exports = class ThangsTabView extends CocoView
thang.isSelectable = not thang.isLand for thang in @world.thangs # let us select walls and such
@surface?.setWorld @world
@selectAddThangType @addThangType, @cloneSourceThang if @addThangType # make another addThang sprite, since the World just refreshed
# update selection, since the thangs have been remade
if @selectedExtantThang
@selectedExtantSprite = @surface.spriteBoss.sprites[@selectedExtantThang.id]
@selectedExtantThang = @selectedExtantSprite?.thang
Backbone.Mediator.publish 'editor:thangs-edited', thangs: @world.thangs
onTreemaThangSelected: (e, selectedTreemas) =>
@ -423,12 +417,15 @@ module.exports = class ThangsTabView extends CocoView
addThang: (thangType, pos, batchInsert=false) ->
@$el.find('#randomize-button').hide()
if batchInsert
thangID = "Random #{thangType.get('name')} #{@thangsBatch.length}"
if thangType.get('name') is 'Hero Placeholder'
thangID = 'Hero Placeholder'
return if @level.get('type') isnt 'hero' or @thangsTreema.get "id=#{thangID}"
else
thangID = "Random #{thangType.get('name')} #{@thangsBatch.length}"
else
thangID = Thang.nextID(thangType.get('name'), @world) until thangID and not @thangsTreema.get "id=#{thangID}"
if @cloneSourceThang
components = _.cloneDeep @thangsTreema.get "id=#{@cloneSourceThang.id}/components"
@selectAddThang null
else if @level.get('type') is 'hero'
components = [] # Load them all from default ThangType Components
else
@ -450,7 +447,8 @@ module.exports = class ThangsTabView extends CocoView
thangData = @thangsTreema.get "id=#{e.thangID}"
@editThangView = new LevelThangEditView thangData: thangData, level: @level, world: @world, supermodel: @supermodel # supermodel needed for checkForMissingSystems
@insertSubView @editThangView
@$el.find('.thangs-column').hide()
@$el.find('>').hide()
@editThangView.$el.show()
Backbone.Mediator.publish 'editor:view-switched', {}
onLevelThangEdited: (e) ->
@ -461,7 +459,7 @@ module.exports = class ThangsTabView extends CocoView
@removeSubView @editThangView
@editThangView = null
@onThangsChanged()
@$el.find('.thangs-column').show()
@$el.find('>').show()
preventDefaultContextMenu: (e) ->
return unless $(e.target).closest('#canvas-wrapper').length
@ -485,11 +483,10 @@ module.exports = class ThangsTabView extends CocoView
@selectAddThangType @selectedExtantThang.spriteName, @selectedExtantThang
toggleThangsContainer: (e) ->
$('#all-thangs').toggle()
$('#all-thangs').toggleClass('hide')
toggleThangsPalette: (e) ->
$('#add-thangs-column').toggle()
@onWindowResize e
$('#add-thangs-view').toggleClass('hide')
class ThangsNode extends TreemaNode.nodeMap.array
valueClass: 'treema-array-replacement'
@ -518,11 +515,8 @@ class ThangNode extends TreemaObjectNode
s = "#{data.thangType}"
if isObjectID s
unless name = ThangNode.thangNameMap[s]
thangType = _.find @settings.supermodel.getModels(ThangType), (m) -> m.get('original') is s and m.get('kind')
thangType = _.find @settings.supermodel.getModels(ThangType), (m) -> m.get('original') is s
name = ThangNode.thangNameMap[s] = thangType.get 'name'
ThangNode.thangKindMap[s] = thangType.get 'kind'
kind = ThangNode.thangKindMap[s]
@$el.addClass "treema-#{kind}"
s = name
s += ' - ' + data.id if data.id isnt s
if pos

View file

@ -136,6 +136,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView
onColorGroupsChanged: =>
@thangType.set('colorGroups', @colorGroups.data)
Backbone.Mediator.publish 'editor:thang-type-color-groups-changed', colorGroups: @colorGroups.data
onColorGroupSelected: (e, selected) =>
@$el.find('#color-group-settings').toggle selected.length > 0

View file

@ -44,6 +44,7 @@ module.exports = class ThangTypeEditView extends RootView
'keyup .play-with-level-input': 'onPlayLevelKeyUp'
subscriptions:
'editor:thang-type-color-groups-changed': 'onColorGroupsChanged'
'editor:save-new-version': 'saveNewThangType'
# init / render
@ -102,6 +103,11 @@ module.exports = class ThangTypeEditView extends RootView
onComponentsChanged: (components) =>
@thangType.set 'components', components
onColorGroupsChanged: (e) ->
@temporarilyIgnoringChanges = true
@treema.set 'colorGroups', e.colorGroups
@temporarilyIgnoringChanges = false
makeDot: (color) ->
circle = new createjs.Shape()
circle.graphics.beginFill(color).beginStroke('black').drawCircle(0, 0, 5)
@ -380,8 +386,10 @@ module.exports = class ThangTypeEditView extends RootView
el = @$el.find('#thang-type-treema')
@treema = @$el.find('#thang-type-treema').treema(options)
@treema.build()
@lastKind = data.kind
pushChangesToPreview: =>
return if @temporarilyIgnoringChanges
# TODO: This doesn't delete old Treema keys you deleted
for key, value of @treema.data
@thangType.set(key, value)
@ -389,6 +397,11 @@ module.exports = class ThangTypeEditView extends RootView
@refreshAnimation()
@updateDots()
@updatePortrait()
if (kind = @treema.data.kind) isnt @lastKind
@lastKind = kind
Backbone.Mediator.publish 'editor:thang-type-kind-changed', kind: kind
if kind in ['Doodad', 'Floor', 'Wall'] and not @treema.data.terrains
@treema.set '/terrains', ['Grass', 'Dungeon', 'Indoor'] # So editors know to set them.
onSelectNode: (e, selected) =>
selected = selected[0]

View file

@ -18,6 +18,7 @@ module.exports = class GameMenuModal extends ModalView
constructor: (options) ->
super options
@options.showDevBits = me.isAdmin() or /https?:\/\/localhost/.test(window.location.href)
@options.showInventory = @options.level.get('type', true) is 'hero'
events:
'change input.select': 'onSelectionChanged'
@ -25,13 +26,14 @@ module.exports = class GameMenuModal extends ModalView
getRenderData: (context={}) ->
context = super(context)
context.showDevBits = @options.showDevBits
context.showInventory = @options.showInventory
context
afterRender: ->
super()
@$el.toggleClas
@insertSubView new submenuView @options for submenuView in submenuViews
(if @options.showDevBits then @subviews.inventory_view else @subviews.choose_hero_view).$el.addClass 'active'
(if @options.showInventory then @subviews.inventory_view else @subviews.choose_hero_view).$el.addClass 'active'
onHidden: ->
subview.onHidden?() for subviewKey, subview of @subviews

View file

@ -1,6 +1,5 @@
ModalView = require 'views/kinds/ModalView'
template = require 'templates/modal/versions'
tableTemplate = require 'templates/kinds/table'
DeltaView = require 'views/editor/DeltaView'
PatchModal = require 'views/editor/PatchModal'
nameLoader = require 'lib/NameLoader'

View file

@ -112,12 +112,14 @@ describe 'LevelLoader', ->
requests = jasmine.Ajax.requests.all()
urls = (r.url for r in requests)
expect('/db/level.component/jumps/version/0' in urls).toBeTruthy()
it 'is idempotent', ->
levelLoader = new LevelLoader({supermodel:new SuperModel(), sessionID: 'id', levelID: 'id'})
# first load Tharin by the 'normal' session load
responses = { '/db/level_session/id': sessionWithTharinWithHelmet }
responses = '/db/level/id': levelWithOgreWithMace
jasmine.Ajax.requests.sendResponses(responses)
responses = '/db/level_session/id': sessionWithTharinWithHelmet
jasmine.Ajax.requests.sendResponses(responses)
numRequestsBefore = jasmine.Ajax.requests.count()
@ -126,21 +128,21 @@ describe 'LevelLoader', ->
levelLoader.loadDependenciesForSession(session)
levelLoader.loadDependenciesForSession(session)
levelLoader.loadDependenciesForSession(session)
numRequestsAfter = jasmine.Ajax.requests.count()
expect(numRequestsBefore).toBe(numRequestsAfter)
numRequestsAfter = jasmine.Ajax.requests.count()
expect(numRequestsAfter).toBe(numRequestsBefore)
it 'loads thangs for items that the level thangs have in their Equips component configs', ->
new LevelLoader({supermodel:supermodel = new SuperModel(), sessionID: 'id', levelID: 'id'})
responses = {
'/db/level/id': levelWithOgreWithMace
responses = {
'/db/level/id': levelWithOgreWithMace
}
jasmine.Ajax.requests.sendResponses(responses)
requests = jasmine.Ajax.requests.all()
urls = (r.url for r in requests)
expect('/db/thang.type/mace/version?project=name,components,original' in urls).toBeTruthy()
it 'loads components which are inherited by level thangs from thang type default components', ->
new LevelLoader({supermodel:new SuperModel(), sessionID: 'id', levelID: 'id'})
@ -152,7 +154,7 @@ describe 'LevelLoader', ->
requests = jasmine.Ajax.requests.all()
urls = (r.url for r in requests)
expect('/db/level.component/physical/version/0' in urls).toBeTruthy()
it 'loads item thang types which are inherited by level thangs from thang type default equips component configs', ->
new LevelLoader({supermodel:new SuperModel(), sessionID: 'id', levelID: 'id'})
@ -164,7 +166,7 @@ describe 'LevelLoader', ->
requests = jasmine.Ajax.requests.all()
urls = (r.url for r in requests)
expect('/db/thang.type/wand/version?project=name,components,original' in urls).toBeTruthy()
it 'loads components for item thang types which are inherited by level thangs from thang type default equips component configs', ->
new LevelLoader({supermodel:new SuperModel(), sessionID: 'id', levelID: 'id'})