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'
|
||||
@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'
|
||||
console.log 'storing', prop, 'as', value if prop is 'myTiles'
|
||||
@props.push clone(value, true)
|
||||
else
|
||||
@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.
|
||||
stringPieces = ['\x1D'] # Group Separator
|
||||
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
|
||||
stringPieces.push element, '\x1E' # Record Separator(s)
|
||||
value = stringPieces.join('')
|
||||
|
|
|
@ -173,8 +173,8 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
|
|||
email_announcements: "Bejelentések"
|
||||
email_announcements_description: "Szeretnél levelet kapni a legújabb fejlesztéseinkről?"
|
||||
email_notifications: "Értesítések"
|
||||
# email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity."
|
||||
email_any_notes: "Bármely értesítés"
|
||||
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 megjegyzés"
|
||||
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_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
|
||||
$childSize: $height - 2 * $childMargin
|
||||
height: $height
|
||||
width: 80%
|
||||
width: -webkit-calc(100% - 100px)
|
||||
width: calc(100% - 100px)
|
||||
width: 90%
|
||||
width: -webkit-calc(100% - 50px)
|
||||
width: calc(100% - 50px)
|
||||
padding: 0px 8px
|
||||
border-width: 3px
|
||||
border-image: url(/images/level/code_editor_tab_background.png) 4 fill repeat
|
||||
text-align: center
|
||||
white-space: nowrap
|
||||
position: relative
|
||||
|
||||
&.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)
|
||||
|
@ -34,6 +35,11 @@
|
|||
.spell-list-button, .thang-avatar-wrapper
|
||||
float: left
|
||||
|
||||
.spell-tool-buttons
|
||||
position: absolute
|
||||
right: 0px
|
||||
top: 0px
|
||||
|
||||
.reload-code
|
||||
float: right
|
||||
display: none
|
||||
|
@ -66,6 +72,7 @@
|
|||
|
||||
code
|
||||
margin-top: 7px
|
||||
font-size: 1vw
|
||||
|
||||
.spell-list-entry-view:not(.spell-tab)
|
||||
cursor: pointer
|
||||
|
@ -110,4 +117,4 @@ html.no-borderimage
|
|||
border-width: 0
|
||||
border-image: none
|
||||
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
|
||||
|
||||
block content
|
||||
|
||||
|
||||
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!
|
||||
|
@ -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!
|
||||
|
||||
ul
|
||||
li
|
||||
li
|
||||
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.
|
||||
li
|
||||
li
|
||||
a(href="/editor/thang", data-i18n="editor.thang_title")
|
||||
| : modify or import new art assets for the game using our powerful editor.
|
||||
li
|
||||
li
|
||||
a(href="/editor/article", data-i18n="editor.article_title")
|
||||
| : edit or create documentation used in CodeCombat levels.
|
||||
|
||||
|
@ -35,51 +35,51 @@ block content
|
|||
|
||||
ul
|
||||
|
||||
li We write about our progress and current projects on our
|
||||
a(href="http://blog.codecombat.com", data-i18n="nav.blog")
|
||||
li We write about our progress and current projects on our
|
||||
a.spl(href="http://blog.codecombat.com", data-i18n="nav.blog")
|
||||
| .
|
||||
li Participate in our active user community by checking out our
|
||||
a(href="http://discourse.codecombat.com", data-i18n="nav.forum")
|
||||
li Participate in our active user community by checking out our
|
||||
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
|
||||
a(href="https://www.facebook.com/codecombat", data-i18n="community.facebook")
|
||||
li For regular news about learning to code, games, and education, check out our
|
||||
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
|
||||
a(href="https://twitter.com/CodeCombat", data-i18n="community.twitter")
|
||||
li For realtime status or to have a quick chat, follow us on
|
||||
a.spl(href="https://twitter.com/CodeCombat", data-i18n="community.twitter")
|
||||
| .
|
||||
li Don't like Facebook? We're on
|
||||
a(href="https://plus.google.com/115285980638641924488/posts", data-i18n="community.gplus")
|
||||
li Don't like Facebook? We're on
|
||||
a.spl(href="https://plus.google.com/115285980638641924488/posts", data-i18n="community.gplus")
|
||||
| .
|
||||
li You can also find us in our
|
||||
a(href="http://www.hipchat.com/g3plnOKqa", data-i18n="editor.hipchat_url")
|
||||
li You can also find us in our
|
||||
a.spl(href="http://www.hipchat.com/g3plnOKqa", data-i18n="editor.hipchat_url")
|
||||
|
||||
.community_columns
|
||||
|
||||
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
|
||||
|
||||
li
|
||||
a(href="/contribute#archmage", data-i18n="classes.archmage_title")
|
||||
li
|
||||
a(href="/contribute#archmage", data-i18n="classes.archmage_title")
|
||||
| : contribute by writing code.
|
||||
li
|
||||
a(href="/contribute#artisan", data-i18n="classes.artisan_title")
|
||||
li
|
||||
a(href="/contribute#artisan", data-i18n="classes.artisan_title")
|
||||
| : build new game levels.
|
||||
li
|
||||
a(href="/contribute#adventurer", data-i18n="classes.adventurer_title")
|
||||
li
|
||||
a(href="/contribute#adventurer", data-i18n="classes.adventurer_title")
|
||||
| : test new game levels.
|
||||
li
|
||||
a(href="/contribute#scribe", data-i18n="classes.scribe_title")
|
||||
li
|
||||
a(href="/contribute#scribe", data-i18n="classes.scribe_title")
|
||||
| : write educational documentation.
|
||||
li
|
||||
a(href="/contribute#diplomat", data-i18n="classes.diplomat_title")
|
||||
li
|
||||
a(href="/contribute#diplomat", data-i18n="classes.diplomat_title")
|
||||
| : translate site content.
|
||||
li
|
||||
a(href="/contribute#ambassador", data-i18n="classes.ambassador_title")
|
||||
li
|
||||
a(href="/contribute#ambassador", data-i18n="classes.ambassador_title")
|
||||
| : support our community of educators and coders.
|
||||
|
||||
| Check out the
|
||||
a(href="/contribute", data-i18n="nav.contribute")
|
||||
| Check out the
|
||||
a.spl(href="/contribute", data-i18n="nav.contribute")
|
||||
| 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'
|
||||
li.dropdown
|
||||
a(data-toggle='dropdown')
|
||||
a(data-toggle='dropdown').play-with-team-parent
|
||||
span.glyphicon-play.glyphicon
|
||||
ul.dropdown-menu
|
||||
li.dropdown-header Play As Which Team?
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
code #{methodSignature}
|
||||
|
||||
.btn.btn-small.fullscreen-code(title="Expand code editor")
|
||||
i.icon-fullscreen
|
||||
i.icon-resize-small
|
||||
|
||||
.btn.btn-small.reload-code(title="Reload original code for " + spell.name)
|
||||
i.icon-repeat
|
||||
.spell-tool-buttons
|
||||
.btn.btn-small.fullscreen-code(title="Expand code editor")
|
||||
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.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)
|
||||
i.icon-magnet
|
||||
|
||||
|
||||
.clearfix
|
||||
.clearfix
|
|
@ -26,6 +26,7 @@ module.exports = class EditorLevelView extends View
|
|||
events:
|
||||
'click #play-button': 'onPlayLevel'
|
||||
'click .play-with-team-button': 'onPlayLevel'
|
||||
'click .play-with-team-parent': 'onPlayLevelTeamSelect'
|
||||
'click #commit-level-start-button': 'startCommittingLevel'
|
||||
'click #fork-level-start-button': 'startForkingLevel'
|
||||
'click #level-history-button': 'showVersionHistory'
|
||||
|
@ -77,6 +78,12 @@ module.exports = class EditorLevelView extends View
|
|||
@listenTo @patchesView, 'accepted-patch', -> location.reload()
|
||||
@$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) ->
|
||||
team = $(e.target).data('team')
|
||||
sendLevel = =>
|
||||
|
|
|
@ -66,6 +66,7 @@ sizes = {
|
|||
'borderSize': {
|
||||
'x':4
|
||||
'y':4
|
||||
'thickness':2
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,36 +115,38 @@ module.exports = class TerrainRandomizeModal extends ModalView
|
|||
|
||||
randomizeBorder: (preset, presetSize) ->
|
||||
for i in _.range(0-sizes.floorSize.x/2+sizes.borderSize.x, presetSize.x-sizes.floorSize.x/2, sizes.borderSize.x)
|
||||
@thangs.push {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'x': i
|
||||
'y': 0-sizes.floorSize.x/2
|
||||
for j in _.range(sizes.borderSize.thickness)
|
||||
@thangs.push {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'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 {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'x': i
|
||||
'y': presetSize.y - sizes.borderSize.y
|
||||
@thangs.push {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'x': i + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
|
||||
'y': presetSize.y - sizes.borderSize.y + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for i in _.range(0-sizes.floorSize.y/2, presetSize.y-sizes.borderSize.y, sizes.borderSize.y)
|
||||
@thangs.push {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'x': 0-sizes.floorSize.x/2+sizes.borderSize.x
|
||||
'y': i
|
||||
for j in _.range(3)
|
||||
@thangs.push {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'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 {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'x': presetSize.x - sizes.borderSize.x - sizes.floorSize.x/2
|
||||
'y': i
|
||||
@thangs.push {
|
||||
'id': @getRandomThang(preset.borders)
|
||||
'pos': {
|
||||
'x': presetSize.x - sizes.borderSize.x - sizes.floorSize.x/2 + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
|
||||
'y': i + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
randomizeDecorations: (preset, presetSize)->
|
||||
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.
|
||||
# The web worker Aether won't track state, so don't have to worry about updating it
|
||||
finishUpdatingAether = (aether) =>
|
||||
@displayAether aether
|
||||
@displayAether aether, codeIsAsCast
|
||||
@lastUpdatedAetherSpellThang = @spellThang
|
||||
@guessWhetherFinished aether if fromCodeChange
|
||||
|
||||
|
@ -396,10 +396,9 @@ module.exports = class SpellView extends View
|
|||
@aceSession.setAnnotations []
|
||||
@highlightCurrentLine {} # This'll remove all highlights
|
||||
|
||||
displayAether: (aether) ->
|
||||
displayAether: (aether, isCast=false) ->
|
||||
@displayedAether = aether
|
||||
isCast = 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
|
||||
isCast = isCast or not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'}
|
||||
problem.destroy() for problem in @problems # Just in case another problem was added since clearAetherDisplay() ran.
|
||||
@problems = []
|
||||
annotations = []
|
||||
|
|
|
@ -64,7 +64,7 @@ exports.config =
|
|||
'stylesheets/app.css': /^(app|vendor|bower_components)/
|
||||
order:
|
||||
before: [
|
||||
'app/styles/bootstrap.scss'
|
||||
'app/styles/bootstrap/*'
|
||||
'vendor/styles/nanoscroller.scss'
|
||||
]
|
||||
templates:
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
"nodemon": "0.7.5",
|
||||
"marked": "0.2.x",
|
||||
"telepath-brunch": "https://github.com/nwinter/telepath-brunch/tarball/master",
|
||||
"bower": "~1.2.8",
|
||||
"bower": "~1.3.8",
|
||||
"bless-brunch": "~1.6.1",
|
||||
"karma-script-launcher": "~0.1.0",
|
||||
"karma-chrome-launcher": "~0.1.2",
|
||||
|
|
Loading…
Reference in a new issue