mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-02 03:47:09 -05:00
commit
aaf9bf1253
12 changed files with 98 additions and 82 deletions
|
@ -30,6 +30,7 @@ module.exports = class ThangState
|
||||||
if type is 'Vector'
|
if type is 'Vector'
|
||||||
@props.push value?.copy() # could try storing [x, y, z] or {x, y, z} here instead if this is expensive
|
@props.push value?.copy() # could try storing [x, y, z] or {x, y, z} here instead if this is expensive
|
||||||
else if type is 'object' or type is 'array'
|
else if type is 'object' or type is 'array'
|
||||||
|
console.log 'storing', prop, 'as', value if prop is 'myTiles'
|
||||||
@props.push clone(value, true)
|
@props.push clone(value, true)
|
||||||
else
|
else
|
||||||
@props.push value
|
@props.push value
|
||||||
|
@ -144,7 +145,7 @@ module.exports = class ThangState
|
||||||
# We make sure the array keys won't collide with any string keys by using some unprintable characters.
|
# We make sure the array keys won't collide with any string keys by using some unprintable characters.
|
||||||
stringPieces = ['\x1D'] # Group Separator
|
stringPieces = ['\x1D'] # Group Separator
|
||||||
for element in value
|
for element in value
|
||||||
if element and element.isThang
|
if element and element.id # Was checking element.isThang, but we can't store non-strings anyway
|
||||||
element = element.id
|
element = element.id
|
||||||
stringPieces.push element, '\x1E' # Record Separator(s)
|
stringPieces.push element, '\x1E' # Record Separator(s)
|
||||||
value = stringPieces.join('')
|
value = stringPieces.join('')
|
||||||
|
|
|
@ -173,8 +173,8 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
|
||||||
email_announcements: "Bejelentések"
|
email_announcements: "Bejelentések"
|
||||||
email_announcements_description: "Szeretnél levelet kapni a legújabb fejlesztéseinkről?"
|
email_announcements_description: "Szeretnél levelet kapni a legújabb fejlesztéseinkről?"
|
||||||
email_notifications: "Értesítések"
|
email_notifications: "Értesítések"
|
||||||
# email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity."
|
email_notifications_summary: "CodeCombat tevékenységedre vonatkozó személyre szóló, automatikus értesítések beállításai."
|
||||||
email_any_notes: "Bármely értesítés"
|
email_any_notes: "Bármely megjegyzés"
|
||||||
email_any_notes_description: "Minden tevékenységgel kapcsolatos e-mail értesítés letiltása."
|
email_any_notes_description: "Minden tevékenységgel kapcsolatos e-mail értesítés letiltása."
|
||||||
email_recruit_notes: "Álláslehetőségek"
|
email_recruit_notes: "Álláslehetőségek"
|
||||||
email_recruit_notes_description: "Ha igazán jól játszol lehet, hogy felveszzük veled a kapcsolatot és megbeszéljük, hogy szerezzünk-e neked egy (jobb) állást."
|
email_recruit_notes_description: "Ha igazán jól játszol lehet, hogy felveszzük veled a kapcsolatot és megbeszéljük, hogy szerezzünk-e neked egy (jobb) állást."
|
||||||
|
|
1
app/styles/bootstrap.scss
vendored
1
app/styles/bootstrap.scss
vendored
|
@ -1 +0,0 @@
|
||||||
@import "bootstrap/bootstrap";
|
|
|
@ -13,13 +13,14 @@
|
||||||
$childMargin: 2px
|
$childMargin: 2px
|
||||||
$childSize: $height - 2 * $childMargin
|
$childSize: $height - 2 * $childMargin
|
||||||
height: $height
|
height: $height
|
||||||
width: 80%
|
width: 90%
|
||||||
width: -webkit-calc(100% - 100px)
|
width: -webkit-calc(100% - 50px)
|
||||||
width: calc(100% - 100px)
|
width: calc(100% - 50px)
|
||||||
padding: 0px 8px
|
padding: 0px 8px
|
||||||
border-width: 3px
|
border-width: 3px
|
||||||
border-image: url(/images/level/code_editor_tab_background.png) 4 fill repeat
|
border-image: url(/images/level/code_editor_tab_background.png) 4 fill repeat
|
||||||
text-align: center
|
white-space: nowrap
|
||||||
|
position: relative
|
||||||
|
|
||||||
&.read-only
|
&.read-only
|
||||||
background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%,rgba(0,0,0,0.2) 100%), url(/images/level/code_editor_tab_background.png)
|
background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%,rgba(0,0,0,0.2) 100%), url(/images/level/code_editor_tab_background.png)
|
||||||
|
@ -34,6 +35,11 @@
|
||||||
.spell-list-button, .thang-avatar-wrapper
|
.spell-list-button, .thang-avatar-wrapper
|
||||||
float: left
|
float: left
|
||||||
|
|
||||||
|
.spell-tool-buttons
|
||||||
|
position: absolute
|
||||||
|
right: 0px
|
||||||
|
top: 0px
|
||||||
|
|
||||||
.reload-code
|
.reload-code
|
||||||
float: right
|
float: right
|
||||||
display: none
|
display: none
|
||||||
|
@ -66,6 +72,7 @@
|
||||||
|
|
||||||
code
|
code
|
||||||
margin-top: 7px
|
margin-top: 7px
|
||||||
|
font-size: 1vw
|
||||||
|
|
||||||
.spell-list-entry-view:not(.spell-tab)
|
.spell-list-entry-view:not(.spell-tab)
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
|
@ -110,4 +117,4 @@ html.no-borderimage
|
||||||
border-width: 0
|
border-width: 0
|
||||||
border-image: none
|
border-image: none
|
||||||
background: transparent url(/images/level/code_editor_tab_background.png) no-repeat
|
background: transparent url(/images/level/code_editor_tab_background.png) no-repeat
|
||||||
background-size: 100% 100%
|
background-size: 100% 100%
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
extends /templates/base
|
extends /templates/base
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
|
||||||
h1(data-i18n="community.main_title") CodeCombat Community
|
h1(data-i18n="community.main_title") CodeCombat Community
|
||||||
|
|
||||||
p There are dozens of ways you can get involved with CodeCombat. Check out the resources we've built, decide what sounds the most fun, and we look forward to working with you!
|
p There are dozens of ways you can get involved with CodeCombat. Check out the resources we've built, decide what sounds the most fun, and we look forward to working with you!
|
||||||
|
@ -15,13 +15,13 @@ block content
|
||||||
p We have built several tools that enable users to get not only edit, but also build new game content!
|
p We have built several tools that enable users to get not only edit, but also build new game content!
|
||||||
|
|
||||||
ul
|
ul
|
||||||
li
|
li
|
||||||
a(href="/editor/level", data-i18n="community.level_editor")
|
a(href="/editor/level", data-i18n="community.level_editor")
|
||||||
| : fork, edit, or build your own CodeCombat levels. New levels can be kept private or published to the community.
|
| : fork, edit, or build your own CodeCombat levels. New levels can be kept private or published to the community.
|
||||||
li
|
li
|
||||||
a(href="/editor/thang", data-i18n="editor.thang_title")
|
a(href="/editor/thang", data-i18n="editor.thang_title")
|
||||||
| : modify or import new art assets for the game using our powerful editor.
|
| : modify or import new art assets for the game using our powerful editor.
|
||||||
li
|
li
|
||||||
a(href="/editor/article", data-i18n="editor.article_title")
|
a(href="/editor/article", data-i18n="editor.article_title")
|
||||||
| : edit or create documentation used in CodeCombat levels.
|
| : edit or create documentation used in CodeCombat levels.
|
||||||
|
|
||||||
|
@ -35,51 +35,51 @@ block content
|
||||||
|
|
||||||
ul
|
ul
|
||||||
|
|
||||||
li We write about our progress and current projects on our
|
li We write about our progress and current projects on our
|
||||||
a(href="http://blog.codecombat.com", data-i18n="nav.blog")
|
a.spl(href="http://blog.codecombat.com", data-i18n="nav.blog")
|
||||||
| .
|
| .
|
||||||
li Participate in our active user community by checking out our
|
li Participate in our active user community by checking out our
|
||||||
a(href="http://discourse.codecombat.com", data-i18n="nav.forum")
|
a.spl(href="http://discourse.codecombat.com", data-i18n="nav.forum")
|
||||||
| .
|
| .
|
||||||
li For regular news about learning to code, games, and education, check out our
|
li For regular news about learning to code, games, and education, check out our
|
||||||
a(href="https://www.facebook.com/codecombat", data-i18n="community.facebook")
|
a.spl(href="https://www.facebook.com/codecombat", data-i18n="community.facebook")
|
||||||
| .
|
| .
|
||||||
li For realtime status or to have a quick chat, follow us on
|
li For realtime status or to have a quick chat, follow us on
|
||||||
a(href="https://twitter.com/CodeCombat", data-i18n="community.twitter")
|
a.spl(href="https://twitter.com/CodeCombat", data-i18n="community.twitter")
|
||||||
| .
|
| .
|
||||||
li Don't like Facebook? We're on
|
li Don't like Facebook? We're on
|
||||||
a(href="https://plus.google.com/115285980638641924488/posts", data-i18n="community.gplus")
|
a.spl(href="https://plus.google.com/115285980638641924488/posts", data-i18n="community.gplus")
|
||||||
| .
|
| .
|
||||||
li You can also find us in our
|
li You can also find us in our
|
||||||
a(href="http://www.hipchat.com/g3plnOKqa", data-i18n="editor.hipchat_url")
|
a.spl(href="http://www.hipchat.com/g3plnOKqa", data-i18n="editor.hipchat_url")
|
||||||
|
|
||||||
.community_columns
|
.community_columns
|
||||||
|
|
||||||
h2 Contribute
|
h2 Contribute
|
||||||
|
|
||||||
p Put your skills to use helping us teach the world to code. We have a lot of roles you can consider, and if we don't have a role for you, let us know:
|
p Put your skills to use helping us teach the world to code. We have a lot of roles you can consider, and if we don't have a role for you, let us know:
|
||||||
|
|
||||||
ul
|
ul
|
||||||
|
|
||||||
li
|
li
|
||||||
a(href="/contribute#archmage", data-i18n="classes.archmage_title")
|
a(href="/contribute#archmage", data-i18n="classes.archmage_title")
|
||||||
| : contribute by writing code.
|
| : contribute by writing code.
|
||||||
li
|
li
|
||||||
a(href="/contribute#artisan", data-i18n="classes.artisan_title")
|
a(href="/contribute#artisan", data-i18n="classes.artisan_title")
|
||||||
| : build new game levels.
|
| : build new game levels.
|
||||||
li
|
li
|
||||||
a(href="/contribute#adventurer", data-i18n="classes.adventurer_title")
|
a(href="/contribute#adventurer", data-i18n="classes.adventurer_title")
|
||||||
| : test new game levels.
|
| : test new game levels.
|
||||||
li
|
li
|
||||||
a(href="/contribute#scribe", data-i18n="classes.scribe_title")
|
a(href="/contribute#scribe", data-i18n="classes.scribe_title")
|
||||||
| : write educational documentation.
|
| : write educational documentation.
|
||||||
li
|
li
|
||||||
a(href="/contribute#diplomat", data-i18n="classes.diplomat_title")
|
a(href="/contribute#diplomat", data-i18n="classes.diplomat_title")
|
||||||
| : translate site content.
|
| : translate site content.
|
||||||
li
|
li
|
||||||
a(href="/contribute#ambassador", data-i18n="classes.ambassador_title")
|
a(href="/contribute#ambassador", data-i18n="classes.ambassador_title")
|
||||||
| : support our community of educators and coders.
|
| : support our community of educators and coders.
|
||||||
|
|
||||||
| Check out the
|
| Check out the
|
||||||
a(href="/contribute", data-i18n="nav.contribute")
|
a.spl(href="/contribute", data-i18n="nav.contribute")
|
||||||
| page to find out more about the roles and how you can get started.
|
| page to find out more about the roles and how you can get started.
|
||||||
|
|
|
@ -49,7 +49,7 @@ block header
|
||||||
|
|
||||||
if level.get('type') === 'ladder'
|
if level.get('type') === 'ladder'
|
||||||
li.dropdown
|
li.dropdown
|
||||||
a(data-toggle='dropdown')
|
a(data-toggle='dropdown').play-with-team-parent
|
||||||
span.glyphicon-play.glyphicon
|
span.glyphicon-play.glyphicon
|
||||||
ul.dropdown-menu
|
ul.dropdown-menu
|
||||||
li.dropdown-header Play As Which Team?
|
li.dropdown-header Play As Which Team?
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
|
|
||||||
code #{methodSignature}
|
code #{methodSignature}
|
||||||
|
|
||||||
.btn.btn-small.fullscreen-code(title="Expand code editor")
|
.spell-tool-buttons
|
||||||
i.icon-fullscreen
|
.btn.btn-small.fullscreen-code(title="Expand code editor")
|
||||||
i.icon-resize-small
|
i.icon-fullscreen
|
||||||
|
i.icon-resize-small
|
||||||
.btn.btn-small.reload-code(title="Reload original code for " + spell.name)
|
|
||||||
i.icon-repeat
|
.btn.btn-small.reload-code(title="Reload original code for " + spell.name)
|
||||||
|
i.icon-repeat
|
||||||
|
|
||||||
|
.btn.btn-small.beautify-code(title="Ctrl+Shift+B: Beautify code for " + spell.name)
|
||||||
|
i.icon-magnet
|
||||||
|
|
||||||
.btn.btn-small.beautify-code(title="Ctrl+Shift+B: Beautify code for " + spell.name)
|
.clearfix
|
||||||
i.icon-magnet
|
|
||||||
|
|
||||||
|
|
||||||
.clearfix
|
|
|
@ -26,6 +26,7 @@ module.exports = class EditorLevelView extends View
|
||||||
events:
|
events:
|
||||||
'click #play-button': 'onPlayLevel'
|
'click #play-button': 'onPlayLevel'
|
||||||
'click .play-with-team-button': 'onPlayLevel'
|
'click .play-with-team-button': 'onPlayLevel'
|
||||||
|
'click .play-with-team-parent': 'onPlayLevelTeamSelect'
|
||||||
'click #commit-level-start-button': 'startCommittingLevel'
|
'click #commit-level-start-button': 'startCommittingLevel'
|
||||||
'click #fork-level-start-button': 'startForkingLevel'
|
'click #fork-level-start-button': 'startForkingLevel'
|
||||||
'click #level-history-button': 'showVersionHistory'
|
'click #level-history-button': 'showVersionHistory'
|
||||||
|
@ -77,6 +78,12 @@ module.exports = class EditorLevelView extends View
|
||||||
@listenTo @patchesView, 'accepted-patch', -> location.reload()
|
@listenTo @patchesView, 'accepted-patch', -> location.reload()
|
||||||
@$el.find('#level-watch-button').find('> span').toggleClass('secret') if @level.watching()
|
@$el.find('#level-watch-button').find('> span').toggleClass('secret') if @level.watching()
|
||||||
|
|
||||||
|
onPlayLevelTeamSelect: (e) ->
|
||||||
|
if @childWindow and not @childWindow.closed
|
||||||
|
# We already have a child window open, so we don't need to ask for a team; we'll use its existing team.
|
||||||
|
e.stopImmediatePropagation()
|
||||||
|
@onPlayLevel e
|
||||||
|
|
||||||
onPlayLevel: (e) ->
|
onPlayLevel: (e) ->
|
||||||
team = $(e.target).data('team')
|
team = $(e.target).data('team')
|
||||||
sendLevel = =>
|
sendLevel = =>
|
||||||
|
|
|
@ -66,6 +66,7 @@ sizes = {
|
||||||
'borderSize': {
|
'borderSize': {
|
||||||
'x':4
|
'x':4
|
||||||
'y':4
|
'y':4
|
||||||
|
'thickness':2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,36 +115,38 @@ module.exports = class TerrainRandomizeModal extends ModalView
|
||||||
|
|
||||||
randomizeBorder: (preset, presetSize) ->
|
randomizeBorder: (preset, presetSize) ->
|
||||||
for i in _.range(0-sizes.floorSize.x/2+sizes.borderSize.x, presetSize.x-sizes.floorSize.x/2, sizes.borderSize.x)
|
for i in _.range(0-sizes.floorSize.x/2+sizes.borderSize.x, presetSize.x-sizes.floorSize.x/2, sizes.borderSize.x)
|
||||||
@thangs.push {
|
for j in _.range(sizes.borderSize.thickness)
|
||||||
'id': @getRandomThang(preset.borders)
|
@thangs.push {
|
||||||
'pos': {
|
'id': @getRandomThang(preset.borders)
|
||||||
'x': i
|
'pos': {
|
||||||
'y': 0-sizes.floorSize.x/2
|
'x': i + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
|
||||||
|
'y': 0 - sizes.floorSize.x/2 + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
@thangs.push {
|
||||||
@thangs.push {
|
'id': @getRandomThang(preset.borders)
|
||||||
'id': @getRandomThang(preset.borders)
|
'pos': {
|
||||||
'pos': {
|
'x': i + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
|
||||||
'x': i
|
'y': presetSize.y - sizes.borderSize.y + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
|
||||||
'y': presetSize.y - sizes.borderSize.y
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for i in _.range(0-sizes.floorSize.y/2, presetSize.y-sizes.borderSize.y, sizes.borderSize.y)
|
for i in _.range(0-sizes.floorSize.y/2, presetSize.y-sizes.borderSize.y, sizes.borderSize.y)
|
||||||
@thangs.push {
|
for j in _.range(3)
|
||||||
'id': @getRandomThang(preset.borders)
|
@thangs.push {
|
||||||
'pos': {
|
'id': @getRandomThang(preset.borders)
|
||||||
'x': 0-sizes.floorSize.x/2+sizes.borderSize.x
|
'pos': {
|
||||||
'y': i
|
'x': 0-sizes.floorSize.x/2+sizes.borderSize.x + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
|
||||||
|
'y': i + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
@thangs.push {
|
||||||
@thangs.push {
|
'id': @getRandomThang(preset.borders)
|
||||||
'id': @getRandomThang(preset.borders)
|
'pos': {
|
||||||
'pos': {
|
'x': presetSize.x - sizes.borderSize.x - sizes.floorSize.x/2 + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
|
||||||
'x': presetSize.x - sizes.borderSize.x - sizes.floorSize.x/2
|
'y': i + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
|
||||||
'y': i
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
randomizeDecorations: (preset, presetSize)->
|
randomizeDecorations: (preset, presetSize)->
|
||||||
for name, decoration of preset.decorations
|
for name, decoration of preset.decorations
|
||||||
|
|
|
@ -368,7 +368,7 @@ module.exports = class SpellView extends View
|
||||||
# Now that that's figured out, perform the update.
|
# Now that that's figured out, perform the update.
|
||||||
# The web worker Aether won't track state, so don't have to worry about updating it
|
# The web worker Aether won't track state, so don't have to worry about updating it
|
||||||
finishUpdatingAether = (aether) =>
|
finishUpdatingAether = (aether) =>
|
||||||
@displayAether aether
|
@displayAether aether, codeIsAsCast
|
||||||
@lastUpdatedAetherSpellThang = @spellThang
|
@lastUpdatedAetherSpellThang = @spellThang
|
||||||
@guessWhetherFinished aether if fromCodeChange
|
@guessWhetherFinished aether if fromCodeChange
|
||||||
|
|
||||||
|
@ -396,10 +396,9 @@ module.exports = class SpellView extends View
|
||||||
@aceSession.setAnnotations []
|
@aceSession.setAnnotations []
|
||||||
@highlightCurrentLine {} # This'll remove all highlights
|
@highlightCurrentLine {} # This'll remove all highlights
|
||||||
|
|
||||||
displayAether: (aether) ->
|
displayAether: (aether, isCast=false) ->
|
||||||
@displayedAether = aether
|
@displayedAether = aether
|
||||||
isCast = not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'}
|
isCast = isCast or not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'}
|
||||||
isCast = isCast or @spell.language isnt 'javascript' # Since we don't have linting for other languages
|
|
||||||
problem.destroy() for problem in @problems # Just in case another problem was added since clearAetherDisplay() ran.
|
problem.destroy() for problem in @problems # Just in case another problem was added since clearAetherDisplay() ran.
|
||||||
@problems = []
|
@problems = []
|
||||||
annotations = []
|
annotations = []
|
||||||
|
|
|
@ -64,7 +64,7 @@ exports.config =
|
||||||
'stylesheets/app.css': /^(app|vendor|bower_components)/
|
'stylesheets/app.css': /^(app|vendor|bower_components)/
|
||||||
order:
|
order:
|
||||||
before: [
|
before: [
|
||||||
'app/styles/bootstrap.scss'
|
'app/styles/bootstrap/*'
|
||||||
'vendor/styles/nanoscroller.scss'
|
'vendor/styles/nanoscroller.scss'
|
||||||
]
|
]
|
||||||
templates:
|
templates:
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
"nodemon": "0.7.5",
|
"nodemon": "0.7.5",
|
||||||
"marked": "0.2.x",
|
"marked": "0.2.x",
|
||||||
"telepath-brunch": "https://github.com/nwinter/telepath-brunch/tarball/master",
|
"telepath-brunch": "https://github.com/nwinter/telepath-brunch/tarball/master",
|
||||||
"bower": "~1.2.8",
|
"bower": "~1.3.8",
|
||||||
"bless-brunch": "~1.6.1",
|
"bless-brunch": "~1.6.1",
|
||||||
"karma-script-launcher": "~0.1.0",
|
"karma-script-launcher": "~0.1.0",
|
||||||
"karma-chrome-launcher": "~0.1.2",
|
"karma-chrome-launcher": "~0.1.2",
|
||||||
|
|
Loading…
Reference in a new issue