mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-02 03:47:09 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
81dde109e5
6 changed files with 38 additions and 25 deletions
|
@ -65,6 +65,8 @@ module.exports = class Mark extends CocoClass
|
||||||
buildBounds: ->
|
buildBounds: ->
|
||||||
@mark = new createjs.Container()
|
@mark = new createjs.Container()
|
||||||
@mark.mouseChildren = false
|
@mark.mouseChildren = false
|
||||||
|
style = @sprite.thang.drawsBoundsStyle
|
||||||
|
return if style is 'corner-text' and @sprite.thang.world.age is 0
|
||||||
|
|
||||||
# Confusingly make some semi-random colors that'll be consistent based on the drawsBoundsIndex
|
# Confusingly make some semi-random colors that'll be consistent based on the drawsBoundsIndex
|
||||||
@drawsBoundsIndex = @sprite.thang.drawsBoundsIndex
|
@drawsBoundsIndex = @sprite.thang.drawsBoundsIndex
|
||||||
|
@ -72,11 +74,11 @@ module.exports = class Mark extends CocoClass
|
||||||
color = "rgba(#{colors[0]}, #{colors[1]}, #{colors[2]}, 0.5)"
|
color = "rgba(#{colors[0]}, #{colors[1]}, #{colors[2]}, 0.5)"
|
||||||
[w, h] = [@sprite.thang.width * Camera.PPM, @sprite.thang.height * Camera.PPM * @camera.y2x]
|
[w, h] = [@sprite.thang.width * Camera.PPM, @sprite.thang.height * Camera.PPM * @camera.y2x]
|
||||||
|
|
||||||
if @sprite.thang.drawsBoundsStyle in ['border-text', 'corner-text']
|
if style in ['border-text', 'corner-text']
|
||||||
@drawsBoundsBorderShape = shape = new createjs.Shape()
|
@drawsBoundsBorderShape = shape = new createjs.Shape()
|
||||||
shape.graphics.setStrokeStyle 5
|
shape.graphics.setStrokeStyle 5
|
||||||
shape.graphics.beginStroke color
|
shape.graphics.beginStroke color
|
||||||
if @sprite.thang.drawsBoundsStyle is 'border-text'
|
if style is 'border-text'
|
||||||
shape.graphics.beginFill color.replace('0.5', '0.25')
|
shape.graphics.beginFill color.replace('0.5', '0.25')
|
||||||
else
|
else
|
||||||
shape.graphics.beginFill color
|
shape.graphics.beginFill color
|
||||||
|
@ -88,13 +90,13 @@ module.exports = class Mark extends CocoClass
|
||||||
shape.graphics.endFill()
|
shape.graphics.endFill()
|
||||||
@mark.addChild shape
|
@mark.addChild shape
|
||||||
|
|
||||||
if @sprite.thang.drawsBoundsStyle is 'border-text'
|
if style is 'border-text'
|
||||||
text = new createjs.Text '' + @drawsBoundsIndex, '20px Arial', color.replace('0.5', '1')
|
text = new createjs.Text '' + @drawsBoundsIndex, '20px Arial', color.replace('0.5', '1')
|
||||||
text.regX = text.getMeasuredWidth() / 2
|
text.regX = text.getMeasuredWidth() / 2
|
||||||
text.regY = text.getMeasuredHeight() / 2
|
text.regY = text.getMeasuredHeight() / 2
|
||||||
text.shadow = new createjs.Shadow('#000000', 1, 1, 0)
|
text.shadow = new createjs.Shadow('#000000', 1, 1, 0)
|
||||||
@mark.addChild text
|
@mark.addChild text
|
||||||
else if @sprite.thang.drawsBoundsStyle is 'corner-text'
|
else if style is 'corner-text'
|
||||||
return if @sprite.thang.world.age is 0
|
return if @sprite.thang.world.age is 0
|
||||||
letter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[@drawsBoundsIndex % 26]
|
letter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[@drawsBoundsIndex % 26]
|
||||||
text = new createjs.Text letter, '14px Arial', '#333333' # color.replace('0.5', '1')
|
text = new createjs.Text letter, '14px Arial', '#333333' # color.replace('0.5', '1')
|
||||||
|
@ -102,9 +104,9 @@ module.exports = class Mark extends CocoClass
|
||||||
text.y = -h / 2 + 2
|
text.y = -h / 2 + 2
|
||||||
@mark.addChild text
|
@mark.addChild text
|
||||||
else
|
else
|
||||||
console.warn @sprite.thang.id, 'didn\'t know how to draw bounds style:', @sprite.thang.drawsBoundsStyle
|
console.warn @sprite.thang.id, 'didn\'t know how to draw bounds style:', style
|
||||||
|
|
||||||
if w > 0 and h > 0 and @sprite.thang.drawsBoundsStyle is 'border-text'
|
if w > 0 and h > 0 and style is 'border-text'
|
||||||
@mark.cache -w / 2, -h / 2, w, h, 2
|
@mark.cache -w / 2, -h / 2, w, h, 2
|
||||||
@lastWidth = @sprite.thang.width
|
@lastWidth = @sprite.thang.width
|
||||||
@lastHeight = @sprite.thang.height
|
@lastHeight = @sprite.thang.height
|
||||||
|
@ -130,7 +132,7 @@ module.exports = class Mark extends CocoClass
|
||||||
@mark.regX = width / 2
|
@mark.regX = width / 2
|
||||||
@mark.regY = height / 2
|
@mark.regY = height / 2
|
||||||
@mark.layerIndex = 10
|
@mark.layerIndex = 10
|
||||||
@mark.cache -1, 0, width+2, height # not actually faster than simple ellipse draw
|
@mark.cache -1, -1, width + 2, height + 2 # not actually faster than simple ellipse draw
|
||||||
|
|
||||||
buildRadius: (range) ->
|
buildRadius: (range) ->
|
||||||
alpha = 0.15
|
alpha = 0.15
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = nativeDescription: "Português europeu", englishDescription: "Portuguese (Portugal)", translation:
|
module.exports = nativeDescription: "Português (Portugal)", englishDescription: "Portuguese (Portugal)", translation:
|
||||||
common:
|
common:
|
||||||
loading: "A carregar..."
|
loading: "A carregar..."
|
||||||
saving: "A guardar..."
|
saving: "A guardar..."
|
||||||
|
@ -12,11 +12,11 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
|
||||||
delay_3_sec: "3 segundos"
|
delay_3_sec: "3 segundos"
|
||||||
delay_5_sec: "5 segundos"
|
delay_5_sec: "5 segundos"
|
||||||
manual: "Manual"
|
manual: "Manual"
|
||||||
# fork: "Fork"
|
fork: "Bifurcar"
|
||||||
play: "Jogar"
|
play: "Jogar"
|
||||||
retry: "Tentar novamente"
|
retry: "Tentar novamente"
|
||||||
# watch: "Watch"
|
watch: "Vigiar"
|
||||||
# unwatch: "Unwatch"
|
unwatch: "Desvigiar"
|
||||||
submit_patch: "Submeter Versão"
|
submit_patch: "Submeter Versão"
|
||||||
|
|
||||||
units:
|
units:
|
||||||
|
@ -37,7 +37,7 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
|
||||||
|
|
||||||
modal:
|
modal:
|
||||||
close: "Fechar"
|
close: "Fechar"
|
||||||
okay: "Okay"
|
okay: "Ok"
|
||||||
|
|
||||||
not_found:
|
not_found:
|
||||||
page_not_found: "Página não encontrada"
|
page_not_found: "Página não encontrada"
|
||||||
|
@ -81,7 +81,7 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
|
||||||
create_account_title: "Criar Conta para Guardar Progresso"
|
create_account_title: "Criar Conta para Guardar Progresso"
|
||||||
description: "É grátis. Só são necessárias umas coisas e fica tudo pronto:"
|
description: "É grátis. Só são necessárias umas coisas e fica tudo pronto:"
|
||||||
email_announcements: "Receber anúncios por e-mail"
|
email_announcements: "Receber anúncios por e-mail"
|
||||||
coppa: "13+ ou não-EUA "
|
coppa: "Mais de 13 anos ou não estado-unidense "
|
||||||
coppa_why: "(Porquê?)"
|
coppa_why: "(Porquê?)"
|
||||||
creating: "A Criar Conta..."
|
creating: "A Criar Conta..."
|
||||||
sign_up: "Registar"
|
sign_up: "Registar"
|
||||||
|
@ -107,7 +107,7 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
|
||||||
adventurer_forum: "fórum do Aventureiro"
|
adventurer_forum: "fórum do Aventureiro"
|
||||||
adventurer_suffix: "."
|
adventurer_suffix: "."
|
||||||
campaign_beginner: "Campanha para Iniciantes"
|
campaign_beginner: "Campanha para Iniciantes"
|
||||||
campaign_beginner_description: "... onde aprende a feitiçaria da programação."
|
campaign_beginner_description: "... onde aprende a magia da programação."
|
||||||
campaign_dev: "Níveis mais Difíceis Aleatórios"
|
campaign_dev: "Níveis mais Difíceis Aleatórios"
|
||||||
campaign_dev_description: "... onde aprende a interface enquanto faz coisas um bocadinho mais difíceis."
|
campaign_dev_description: "... onde aprende a interface enquanto faz coisas um bocadinho mais difíceis."
|
||||||
campaign_multiplayer: "Arenas Multijogador"
|
campaign_multiplayer: "Arenas Multijogador"
|
||||||
|
@ -325,7 +325,7 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
|
||||||
# pass_screen: "They will pass your technical screen."
|
# pass_screen: "They will pass your technical screen."
|
||||||
# pass_screen_blurb: "Review each candidate's code before reaching out. One employer found that 5x as many of our devs passed their technical screen than hiring from Hacker News."
|
# pass_screen_blurb: "Review each candidate's code before reaching out. One employer found that 5x as many of our devs passed their technical screen than hiring from Hacker News."
|
||||||
# make_hiring_easier: "Make my hiring easier, please."
|
# make_hiring_easier: "Make my hiring easier, please."
|
||||||
what: "O Que é o CodeCombat?"
|
what: "O que é o CodeCombat?"
|
||||||
# what_blurb: "CodeCombat is a multiplayer browser programming game. Players write code to control their forces in battle against other developers. We support JavaScript, Python, Lua, Clojure, CoffeeScript, and Io."
|
# what_blurb: "CodeCombat is a multiplayer browser programming game. Players write code to control their forces in battle against other developers. We support JavaScript, Python, Lua, Clojure, CoffeeScript, and Io."
|
||||||
# cost: "How much do we charge?"
|
# cost: "How much do we charge?"
|
||||||
# cost_blurb: "We charge 15% of first year's salary and offer a 100% money back guarantee for 90 days. We don't charge for candidates who are already actively being interviewed at your company."
|
# cost_blurb: "We charge 15% of first year's salary and offer a 100% money back guarantee for 90 days. We don't charge for candidates who are already actively being interviewed at your company."
|
||||||
|
@ -756,20 +756,20 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
|
||||||
# helpful_ambassadors: "Our Helpful Ambassadors:"
|
# helpful_ambassadors: "Our Helpful Ambassadors:"
|
||||||
|
|
||||||
classes:
|
classes:
|
||||||
archmage_title: "Archmage"
|
# archmage_title: "Archmage"
|
||||||
archmage_title_description: "(Coder)"
|
# archmage_title_description: "(Coder)"
|
||||||
artisan_title: "Artisan"
|
artisan_title: "Artesão"
|
||||||
artisan_title_description: "(Construtor de Níveis)"
|
artisan_title_description: "(Construtor de Níveis)"
|
||||||
adventurer_title: "Adventurer"
|
adventurer_title: "Aventureiro"
|
||||||
adventurer_title_description: "(Play-tester de Níveis)"
|
adventurer_title_description: "(Testador de Níveis)"
|
||||||
scribe_title: "Scribe"
|
scribe_title: "Escrivão"
|
||||||
scribe_title_description: "(Editor de Artigos)"
|
scribe_title_description: "(Editor de Artigos)"
|
||||||
diplomat_title: "Diplomat"
|
diplomat_title: "Diplomata"
|
||||||
diplomat_title_description: "(Tradutor)"
|
diplomat_title_description: "(Tradutor)"
|
||||||
ambassador_title: "Ambassador"
|
ambassador_title: "Embaixador"
|
||||||
ambassador_title_description: "(Suporte)"
|
ambassador_title_description: "(Suporte)"
|
||||||
counselor_title: "Counselor"
|
counselor_title: "Conselheiro"
|
||||||
counselor_title_description: "(Expert/ Professor)"
|
counselor_title_description: "(Especialista/Professor)"
|
||||||
|
|
||||||
ladder:
|
ladder:
|
||||||
please_login: "Por favor, faz log in antes de jogar um jogo para o campeonato."
|
please_login: "Por favor, faz log in antes de jogar um jogo para o campeonato."
|
||||||
|
|
|
@ -23,6 +23,7 @@ PropertyDocumentationSchema = c.object {
|
||||||
required: ['name', 'type', 'description']
|
required: ['name', 'type', 'description']
|
||||||
},
|
},
|
||||||
name: {type: 'string', title: 'Name', description: 'Name of the property.'}
|
name: {type: 'string', title: 'Name', description: 'Name of the property.'}
|
||||||
|
codeLanguages: c.array {title: 'Specific Code Languages', description: 'If present, then only the languages specified will show this documentation. Leave unset for language-independent documentation.', format: 'code-languages-array'}, c.shortString(title: 'Code Language', description: 'A specific code language to show this documentation for.', format: 'code-language')
|
||||||
# not actual JS types, just whatever they describe...
|
# not actual JS types, just whatever they describe...
|
||||||
type: c.shortString(title: 'Type', description: 'Intended type of the property.')
|
type: c.shortString(title: 'Type', description: 'Intended type of the property.')
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -210,6 +210,12 @@ class CodeLanguagesObjectTreema extends TreemaNode.nodeMap.object
|
||||||
childPropertiesAvailable: ->
|
childPropertiesAvailable: ->
|
||||||
(key for key in _.keys(codeLanguages) when not @data[key]?)
|
(key for key in _.keys(codeLanguages) when not @data[key]?)
|
||||||
|
|
||||||
|
class CodeLanguageTreema extends TreemaNode.nodeMap.string
|
||||||
|
buildValueForEditing: (valEl) ->
|
||||||
|
super(valEl)
|
||||||
|
valEl.find('input').autocomplete(source: _.keys(codeLanguages), minLength: 0, delay: 0, autoFocus: true)
|
||||||
|
valEl
|
||||||
|
|
||||||
class CodeTreema extends TreemaNode.nodeMap.ace
|
class CodeTreema extends TreemaNode.nodeMap.ace
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super(arguments...)
|
super(arguments...)
|
||||||
|
@ -412,6 +418,7 @@ module.exports.setup = ->
|
||||||
TreemaNode.setNodeSubclass('version', VersionTreema)
|
TreemaNode.setNodeSubclass('version', VersionTreema)
|
||||||
TreemaNode.setNodeSubclass('markdown', LiveEditingMarkup)
|
TreemaNode.setNodeSubclass('markdown', LiveEditingMarkup)
|
||||||
TreemaNode.setNodeSubclass('code-languages-object', CodeLanguagesObjectTreema)
|
TreemaNode.setNodeSubclass('code-languages-object', CodeLanguagesObjectTreema)
|
||||||
|
TreemaNode.setNodeSubclass('code-language', CodeLanguageTreema)
|
||||||
TreemaNode.setNodeSubclass('code', CodeTreema)
|
TreemaNode.setNodeSubclass('code', CodeTreema)
|
||||||
TreemaNode.setNodeSubclass('coffee', CoffeeTreema)
|
TreemaNode.setNodeSubclass('coffee', CoffeeTreema)
|
||||||
TreemaNode.setNodeSubclass('javascript', JavaScriptTreema)
|
TreemaNode.setNodeSubclass('javascript', JavaScriptTreema)
|
||||||
|
|
|
@ -38,6 +38,8 @@ module.exports = class DebugView extends View
|
||||||
@lastFrameRequested = -1
|
@lastFrameRequested = -1
|
||||||
@workerIsSimulating = false
|
@workerIsSimulating = false
|
||||||
@spellHasChanged = false
|
@spellHasChanged = false
|
||||||
|
@currentFrame = 0
|
||||||
|
@frameRate = 10 #only time it won't be set is at very beginning
|
||||||
@debouncedTooltipUpdate = _.debounce @updateTooltipProgress, 100
|
@debouncedTooltipUpdate = _.debounce @updateTooltipProgress, 100
|
||||||
|
|
||||||
pad2: (num) ->
|
pad2: (num) ->
|
||||||
|
|
|
@ -599,6 +599,7 @@ module.exports = class SpellView extends View
|
||||||
null
|
null
|
||||||
|
|
||||||
highlightComments: ->
|
highlightComments: ->
|
||||||
|
return # Slightly buggy and not that great, so let's not do it.
|
||||||
lines = $(@ace.container).find('.ace_text-layer .ace_line_group')
|
lines = $(@ace.container).find('.ace_text-layer .ace_line_group')
|
||||||
session = @aceSession
|
session = @aceSession
|
||||||
top = Math.floor @ace.renderer.getScrollTopRow()
|
top = Math.floor @ace.renderer.getScrollTopRow()
|
||||||
|
|
Loading…
Reference in a new issue