Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-11-30 18:03:36 -08:00
commit 68b3144b46
11 changed files with 161 additions and 111 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -28,7 +28,7 @@ module.exports = class Tracker
console.log "Would track analytics pageview: /#{name}" if debugAnalytics
return unless @isProduction and analytics? and not me.isAdmin()
if includeIntegrations
options.integrations = {'All': false}
options = integrations: {'All': false}
for integration in includeIntegrations
options.integrations[integration] = true
analytics.page null, "/#{name}", null, options

View file

@ -86,8 +86,7 @@ module.exports = class MusicPlayer extends CocoClass
return if @inMenu
@inMenu = true
@previousMusic = @currentMusic
terrain = (e.terrain ? 'Dungeon').toLowerCase()
file = "/music/music-menu-#{terrain}"
file = "/music/music-menu"
Backbone.Mediator.publish 'music-player:play-music', file: file, play: true, delay: 1000
onExitMenu: (e) ->

View file

@ -163,8 +163,8 @@ $itemSlotGridHeight: 51px
background-position: (-4 * $itemSlotInnerWidth) 0px
&[data-slot="minion"]
left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 0)
left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 1)
.placeholder
background-position: (-1 * $itemSlotInnerWidth) 0px
@ -172,15 +172,11 @@ $itemSlotGridHeight: 51px
left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 0)
.placeholder
background-position: (-3 * $itemSlotInnerWidth) 0px
// Only for wizards...
//&[data-slot="spellbook"] .placeholder
// background-position: (-2 * $itemSlotInnerWidth) 0px
background-position: (-2 * $itemSlotInnerWidth) 0px
&[data-slot="wrists"]
left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 0)
top: 15px + ($itemSlotGridHeight * 2)
.placeholder
background-position: (-5 * $itemSlotInnerWidth) 0px
@ -198,7 +194,7 @@ $itemSlotGridHeight: 51px
&[data-slot="torso"]
left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 2)
top: 15px + ($itemSlotGridHeight * 3)
.placeholder
background-position: (-8 * $itemSlotInnerWidth) 0px
@ -228,7 +224,7 @@ $itemSlotGridHeight: 51px
&[data-slot="head"]
left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 1)
top: 15px + ($itemSlotGridHeight * 2)
.placeholder
background-position: (-13 * $itemSlotInnerWidth) 0px
@ -240,19 +236,19 @@ $itemSlotGridHeight: 51px
&[data-slot="gloves"]
left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 2)
top: 15px + ($itemSlotGridHeight * 3)
.placeholder
background-position: (-15 * $itemSlotInnerWidth) 0px
&[data-slot="left-hand"]
left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 3)
top: 15px + ($itemSlotGridHeight * 4)
.placeholder
background-position: (-16 * $itemSlotInnerWidth) 0px
&[data-slot="right-hand"]
left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 3)
top: 15px + ($itemSlotGridHeight * 4)
.placeholder
background-position: (-17 * $itemSlotInnerWidth) 0px
@ -272,6 +268,18 @@ $itemSlotGridHeight: 51px
border: 2px solid black
background-color: white
&.Wizard #equipped .item-slot
&[data-slot="right-hand"] .placeholder
background-position: (-20 * $itemSlotInnerWidth) 0px
&[data-slot="left-hand"] .placeholder
background-position: (-3 * $itemSlotInnerWidth) 0px
&.Ranger #equipped .item-slot
&[data-slot="right-hand"] .placeholder
background-position: (-18 * $itemSlotInnerWidth) 0px
&[data-slot="left-hand"] .placeholder
background-position: (-19 * $itemSlotInnerWidth) 0px
//- dragging styling

View file

@ -9,7 +9,6 @@
background-size: contain
#level-loading-view
color: blue
width: 100%
height: 100%
position: absolute
@ -21,60 +20,85 @@
.loading-details
position: absolute
top: 20px
top: 86px
left: 50%
$WIDTH: 1000px
$WIDTH: 450px
width: $WIDTH
min-height: 60px
height: 450px
margin-left: (-$WIDTH / 2)
z-index: 100
background-color: rgba(220, 255, 230, 0.6)
background: transparent url(/images/level/code_editor_background.png) no-repeat
background-size: 100% 100%
color: darkslategray
font-size: 15px
border-radius: 30px
padding: 10px
padding: 80px 80px 40px 80px
text-align: center
// http://matthewlein.com/ceaser/ Bounce down a bit, then snap up.
@include transition(top $UNVEIL_TIME cubic-bezier(0.285, -0.595, 0.670, -0.600))
.load-progress
position: absolute
left: 2%
top: 0px
opacity: 0.6
width: 96%
height: 40px
margin: 10px auto 0
.progress
height: 100%
.progress-bar
width: 1%
height: 100%
transition-duration: 0
&.active .progress-bar
transition-duration: 1.2s
#tip-wrapper
position: relative
z-index: 2
top: 10px
font-family: 'Open Sans Condensed'
.level-loading-goals
margin: 30px auto 10px
width: 400px
text-align: left
.panel-heading
font-size: 24px
.goals-title
font-size: 32px
color: black
font-weight: bold
.list-group-item
li
font-size: 20px
color: black
.start-level-button
font-size: 40px
font-variant: small-caps
.progress-or-start-container
position: absolute
bottom: 95px
width: 261px
height: 80px
left: 80px
.load-progress
width: 100%
height: 36px
margin: 20px auto 0 auto
.progress
height: 100%
position: relative
background-color: transparent
.progress-bar
width: 1%
height: 100%
transition-duration: 0
border-radius: 9px
background: transparent url(/images/level/loading_bar_fill.png) no-repeat
&.active .progress-bar
transition-duration: 1.2s
.rim
position: absolute
left: 0
top: 0
width: 100%
height: 100%
background: transparent url(/images/level/loading_bar_rim.png) no-repeat
background-size: 100% 100%
.start-level-button
display: none
width: 100%
margin: 0px auto
font-size: 40px
font-variant: small-caps
#tip-wrapper
position: absolute
z-index: 2
bottom: 40px
left: 25px
width: 401px
color: #666
.left-wing, .right-wing
width: 100%

View file

@ -25,7 +25,8 @@
left: 0px
height: 100%
right: -10px
border: 1px solid transparent
span.code-background
border-width: 124px 76px 64px 40px
border-image: url(/images/level/code_editor_background_border.png) 124 76 64 40 fill round
@ -131,23 +132,31 @@
@include animation(progress-bar-stripes 0.5s linear infinite)
&:not(.user-code-problem)
.ace_gutter-cell.executing:not(.ace_error):not(.ace_warning):not(.ace_info):after
.ace_gutter-cell.executing:not(.ace_error):not(.ace_warning):not(.ace_info)
margin-left: 1px
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowMjgwMTE3NDA3MjA2ODExOEE2REU4Q0M1MTM1MkIxRiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpBQjVEQUNDMzQ4RUIxMUUxOEVGRUUyNzFENDM3RDVFMCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpBQjVEQUNDMjQ4RUIxMUUxOEVGRUUyNzFENDM3RDVFMCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1LjEgTWFjaW50b3NoIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTU1MjE3RDIzMTIwNjgxMThEQkI4NTlBMjQ1QTEwOTUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDI4MDExNzQwNzIwNjgxMThBNkRFOENDNTEzNTJCMUYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7SazaGAAAAiElEQVR42mL8//8/AzUBEwOVweA3kAWboI2jCyhgDwBx4ZH9ey5Qy4UOQHweaHg/EAtQ08sFUIMDqBmGCkC8HmgoCCtQM1ICoK5toGYsg8KzHmjo+UGbDj8AcSMwORkSnQ7xgA3QtPmApISNBTyAGrSBGl6eAMSGxBhGyIVkZT3G0fKQYgAQYACL+C2ZM6PC7AAAAABJRU5ErkJggg==)
background-position: 0px center
// Experimenting with a larger executing-line-pointer
content: "\e072"
position: relative
top: -31px
left: -39px
display: inline-block
font-family: 'Glyphicons Halflings'
font-style: normal
font-weight: normal
line-height: 1
color: white
text-shadow: 0 0 5px black, 0 0 5px black, 0 0 5px black
font-size: 39px
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
// .ace_gutter-cell.executing:not(.ace_error):not(.ace_warning):not(.ace_info):after
//
// // Experimenting with a larger executing-line-pointer
// content: "\e072"
// position: relative
// left: -39px
// font-family: 'Glyphicons Halflings'
// font-style: normal
// font-weight: normal
// color: white
// text-shadow: 0 0 5px black, 0 0 5px black, 0 0 5px black
// -webkit-font-smoothing: antialiased
// -moz-osx-font-smoothing: grayscale
//
// // Chrome likes these, but Firefox does not
// // TODO: Figure out how to make the executing gutter arrow big, and compatible
// display: inline-block
// top: -31px
// line-height: 1
// font-size: 39px
.ace_gutter-cell.executed:not(.ace_error):not(.ace_warning):not(.ace_info)
margin-left: 1px

View file

@ -4,9 +4,19 @@
.loading-details.loading-container
.load-progress
.progress
.progress-bar.progress-bar-success
.level-loading-goals.secret
.goals-title(data-i18n="play_level.goals") Goals
ul.list-unstyled
.errors
.progress-or-start-container
button.start-level-button.btn.btn-lg.btn-success.header-fontneedsclick(data-i18n="play_level.loading_start") Start Level
.load-progress
.progress
.progress-bar.progress-bar-success
.rim
#tip-wrapper
strong.tip(data-i18n='play_level.tip_toggle_play') Toggle play/paused with Ctrl+P.
@ -41,11 +51,3 @@
strong.tip.rare
span(data-i18n='play_level.tip_harry') Yer a Wizard,
span= me.get('name', true)
.errors
.panel.panel-default.level-loading-goals.secret
.panel-heading.header-font(data-i18n="play_level.goals") Goals
ul.list-group
button.start-level-button.btn.btn-lg.btn-success.header-font.secret.needsclick(data-i18n="play_level.loading_start") Start Level

View file

@ -63,7 +63,7 @@ module.exports = class WorldMapView extends RootView
@getLevelPlayCounts()
$(window).on 'resize', @onWindowResize
@playAmbientSound()
@probablyCachedMusic = storage.load("loaded-menu-music-#{@terrain}")
@probablyCachedMusic = storage.load("loaded-menu-music")
musicDelay = if @probablyCachedMusic then 1000 else 10000
@playMusicTimeout = _.delay (=> @playMusic() unless @destroyed), musicDelay
@hadEverChosenHero = me.get('heroConfig')?.thangType
@ -280,9 +280,9 @@ module.exports = class WorldMapView extends RootView
playMusic: ->
@musicPlayer = new MusicPlayer()
musicFile = {dungeon: '/music/music-menu-dungeon', forest: '/music/music-menu-grass'}[@terrain]
musicFile = '/music/music-menu'
Backbone.Mediator.publish 'music-player:play-music', play: true, file: musicFile
storage.save("loaded-menu-music-#{@terrain}", true) unless @probablyCachedMusic
storage.save("loaded-menu-music", true) unless @probablyCachedMusic
preloadTopHeroes: ->
for heroID in ['captain', 'knight']

View file

@ -44,7 +44,7 @@ module.exports = class LevelLoadingView extends CocoView
goalCount = 0
for goalID, goal of @level.get('goals') when (not goal.team or goal.team is e.team) and not goal.hiddenGoal
name = utils.i18n goal, 'name'
goalList.append $('<li class="list-group-item">' + name + '</li>')
goalList.append $('<li>' + name + '</li>')
++goalCount
if goalCount
goalContainer.removeClass('secret')
@ -68,8 +68,8 @@ module.exports = class LevelLoadingView extends CocoView
@unveil()
else
Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'level_loaded', volume: 0.75 # old: loading_ready
@$el.find('.progress').addClass 'active progress-striped'
@$el.find('.start-level-button').removeClass 'secret'
@$el.find('.progress').hide()
@$el.find('.start-level-button').show()
startUnveiling: (e) ->
@playSound 'menu-button-click'

View file

@ -13,25 +13,34 @@ regJoin = (s) -> new RegExp(s.replace(/\//, '[\\\/\\\\]'))
#- Build the config
exports.config =
paths:
public: 'public'
watched: [
'app',
'vendor',
'test/app',
'app',
'vendor',
'test/app',
'test/demo'
]
conventions:
ignored: (path) -> _.str.startsWith(sysPath.basename(path), '_')
sourceMaps: 'absoluteUrl'
overrides:
production:
sourceMaps: 'absoluteUrl'
onCompile: (files) ->
# For some reason, production brunch produces two entries, the first of which is wrong:
# //# sourceMappingURL=public/javascripts/app.js.map
# //# sourceMappingURL=/javascripts/app.js.map
# So we remove the ones that have public in them.
exec = require('child_process').exec
for file in files
exec "perl -pi -e 's/\\/\\/# sourceMappingURL=public.*//g' #{file.path}"
exec c
files:
javascripts:
defaultExtension: 'coffee'
@ -50,12 +59,12 @@ exports.config =
'app/locale/locale.coffee'
'app/lib/sprites/SpriteBuilder.coffee' # loaded by ThangType
]
#- Wads. Groups of modules by folder which are loaded as a group when needed.
'javascripts/app/lib.js': regJoin('^app/lib')
'javascripts/app/views/play.js': regJoin('^app/views/play')
'javascripts/app/views/editor.js': regJoin('^app/views/editor')
#- world.js, used by the worker to generate the world in game
'javascripts/world.js': [
regJoin('^app/lib/world(?!/test)')
@ -72,7 +81,7 @@ exports.config =
regJoin('^bower_components/(?!(aether|d3|treema))')
'bower_components/treema/treema-utils.js'
]
#- Other vendor libraries in separate bunches
# Include box2dweb for profiling and IE9
@ -81,18 +90,18 @@ exports.config =
'javascripts/box2d.js': regJoin('^vendor/scripts/Box2dWeb-2.1.a.3')
'javascripts/lodash.js': regJoin('^bower_components/lodash/dist/lodash.js')
'javascripts/aether.js': regJoin('^bower_components/aether/build/aether.js')
# Any vendor libraries we don't want the client to load immediately
'javascripts/app/vendor/d3.js': regJoin('^bower_components/d3')
'javascripts/app/vendor/coffeescript.js': 'vendor/scripts/coffeescript.js'
'javascripts/app/vendor/difflib.js': 'vendor/scripts/difflib.js'
'javascripts/app/vendor/diffview.js': 'vendor/scripts/diffview.js'
'javascripts/app/vendor/treema.js': 'bower_components/treema/treema.js'
#- test, demo libraries
'javascripts/test-app.js': regJoin('^test/app/')
'javascripts/demo-app.js': regJoin('^test/demo/')
#- More output files are generated at the below
order:
@ -117,7 +126,7 @@ exports.config =
'vendor/scripts/async.js'
'vendor/scripts/jquery-ui-1.11.1.js.custom.js'
]
stylesheets:
defaultExtension: 'sass'
joinTo:
@ -127,7 +136,7 @@ exports.config =
'app/styles/bootstrap/*'
'vendor/styles/nanoscroller.scss'
]
templates:
defaultExtension: 'jade'
joinTo:
@ -172,7 +181,6 @@ exports.config =
defn = if path in needHeaders then commonjsHeader else ''
return defn
#- Find all .coffee and .jade files in /app
dirStack = ['./app']
@ -197,9 +205,9 @@ for file in coffeeFiles
inputFile = file.replace('./app', 'app')
outputFile = file.replace('.coffee', '.js').replace('./app', 'javascripts/app')
exports.config.files.javascripts.joinTo[outputFile] = inputFile
numBundles = 0
for file in jadeFiles
inputFile = file.replace('./app', 'app')
outputFile = file.replace('.jade', '.js').replace('./app', 'javascripts/app')
@ -213,4 +221,4 @@ for file in jadeFiles
exports.config.files.templates.joinTo[possibleViewFilePath] = inputFile
numBundles += 1
console.log "Got #{coffeeFiles.length} coffee files and #{jadeFiles.length} jade files (bundled #{numBundles} of them together)."
console.log "Got #{coffeeFiles.length} coffee files and #{jadeFiles.length} jade files (bundled #{numBundles} of them together)."