Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-12-10 11:28:16 -08:00
commit b91140bcad
17 changed files with 81 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -37,14 +37,7 @@ module.exports = class SpriteParser
blocks = @findBlocks ast, source
containers = _.filter blocks, {kind: 'Container'}
movieClips = _.filter blocks, {kind: 'MovieClip'}
if movieClips.length
# First movie clip is root, so do it last
movieClips = movieClips[1 ... movieClips.length].concat([movieClips[0]])
# first container isn't necessarily root... actually the last one is root in blue-cart
# else if containers.length
# # First container is root, so do it last
# containers = containers[1 ... containers.length].concat([containers[0]])
mainClip = _.last(movieClips) ? _.last(containers)
@animationName = mainClip.name
for container, index in containers
@ -69,17 +62,24 @@ module.exports = class SpriteParser
break
continue unless container.bounds and instructions.length
@addContainer {c: instructions, b: container.bounds}, container.name
childrenMovieClips = []
for movieClip, index in movieClips
if index is 0
for bounds in movieClip.frameBounds
bounds[0] -= @width / 2
bounds[1] -= @height / 2
movieClip.bounds[0] -= @width / 2
movieClip.bounds[1] -= @height / 2
lastBounds = null
# fill in bounds which are null...
for bounds, boundsIndex in movieClip.frameBounds
if not bounds
movieClip.frameBounds[boundsIndex] = _.clone(lastBounds)
else
lastBounds = bounds
localGraphics = @getGraphicsFromBlock(movieClip, source)
[shapeKeys, localShapes] = @getShapesFromBlock movieClip, source
localContainers = @getContainersFromMovieClip movieClip, source, true
localAnimations = @getAnimationsFromMovieClip movieClip, source, true
for animation in localAnimations
childrenMovieClips.push(animation.gn)
localTweens = @getTweensFromMovieClip movieClip, source, localShapes, localContainers, localAnimations
@addAnimation {
shapes: localShapes
@ -90,6 +90,14 @@ module.exports = class SpriteParser
bounds: movieClip.bounds
frameBounds: movieClip.frameBounds
}, movieClip.name
for movieClip in movieClips
if movieClip.name not in childrenMovieClips
for bounds in movieClip.frameBounds
bounds[0] -= @width / 2
bounds[1] -= @height / 2
movieClip.bounds[0] -= @width / 2
movieClip.bounds[1] -= @height / 2
@saveToModel()
return movieClips[0]?.name

View file

@ -230,8 +230,8 @@ kbd
.popover
border-style: solid
border-image: url(/images/level/popover_background.png) 29 39 fill stretch
border-width: 15px 20px
border-image: url(/images/level/popover_border_background.png) 16 12 fill stretch
border-width: 16px 12px
.arrow
display: none
.btn

View file

@ -8,8 +8,8 @@
max-width: 400px
padding: 10px
border-style: solid
border-image: url(/images/level/popover_background.png) 18 fill round
border-width: 8px
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
border-width: 8px 6px
.progress
position: relative
span

View file

@ -10,8 +10,8 @@
right: 10%
padding: 4%
border-style: solid
border-image: url(/images/level/popover_background.png) 18 fill round
border-width: 15px
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
border-width: 16px 12px
html.no-borderimage
#spell-list-view

View file

@ -12,8 +12,8 @@
overflow: scroll
padding: 4%
border-style: solid
border-image: url(/images/level/popover_background.png) 18 fill round
border-width: 15px
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
border-width: 16px 12px
.thang-avatar-view
cursor: pointer

View file

@ -56,8 +56,8 @@ body:not(.dialogue-view-active)
max-width: 600px
padding: 0
border-style: solid
border-image: url(/images/level/popover_background.png) 29 39 fill stretch
border-width: 15px 20px
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
border-width: 16px 12px
@include box-shadow(0 0 0 #000)
// Jiggle animation

View file

@ -83,9 +83,9 @@
z-index: 10
pointer-events: none
border-style: solid
border-image: url(/images/level/popover_background.png) 29 39 fill stretch
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
padding: 0
border-width: 15px 20px
border-width: 16px 12px
font-variant: small-caps
text-overflow: ellipsis
font-size: 13px

View file

@ -38,8 +38,8 @@
.popover
padding: 10px 10px 30px 10px
border-style: solid
border-image: url(/images/level/popover_background.png) 18 fill round
border-width: 15px
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
border-width: 16px 12px
@include box-shadow(0 0 0 #000)
h1:not(.not-code), h2:not(.not-code), h3:not(.not-code), h4:not(.not-code), h5:not(.not-code), h6:not(.not-code)

View file

@ -110,6 +110,9 @@ $heroCanvasHeight: 265px
background-color: goldenrod
@include filter(contrast(50%) brightness(65%))
&.ie
@include opacity(0.35)
.lock-indicator
position: absolute
width: 40%

View file

@ -199,6 +199,15 @@ $gameControlMargin: 30px
&.started .glyphicon-star
left: 0.5px
img.hero-portrait
width: 120%
position: absolute
bottom: 75%
left: 75%
border: 1px solid black
border-radius: 100%
background: white
.level-shadow
z-index: 1
@ -250,11 +259,11 @@ $gameControlMargin: 30px
position: absolute
z-index: 3
padding: 10px
border-width: 15px
border-width: 16px 12px
// Using modernizr-mixin for compat detection
@include yep(borderimage)
border-style: solid
border-image: url(/images/level/popover_background.png) 18 fill round
border-image: url(/images/level/popover_border_background.png) 16 12 fill round
@include nope(borderimage)
background-color: rgb(247, 242, 218)

View file

@ -20,7 +20,10 @@
li(data-hero-id=hero.get('original'), title=hero.name, data-slide-to=index, data-target="#hero-carousel", class="hero-indicator hero-index-" + index + (hero.locked ? " locked" : "") + (hero.purchasable ? " purchasable" : "") + (hero.restricted ? " restricted" : ""))
.hero-avatar
if hero.locked && !hero.purchasable
img.lock-indicator(src="/images/pages/game-menu/lock.png", draggable="false")
if isIE
img.lock-indicator(src="/images/pages/game-menu/lock-processed.png", draggable="false")
else
img.lock-indicator(src="/images/pages/game-menu/lock.png", draggable="false")
.carousel-inner
for hero in heroes
div(class="item hero-item" + (hero.locked ? " locked" : "") + (hero.purchasable ? " purchasable" : "") + (hero.restricted ? " restricted" : ""), data-hero-id=hero.get('original'))

View file

@ -11,6 +11,8 @@
- var next = level.id == nextLevel || (!seenNext && levelStatusMap[level.id] != "complete" && !level.locked && !level.disabled);
- seenNext = seenNext || next;
div(style="left: #{level.x}%; bottom: #{level.y}%; background-color: #{level.color}", class="level" + (next ? " next" : "") + (level.disabled ? " disabled" : "") + (level.locked ? " locked" : "") + " " + levelStatusMap[level.id] || "", data-level-id=level.id, title=level.name + (level.disabled ? ' (Coming Soon to Adventurers)' : ''))
if level.unlocksHero && !level.unlockedHero
img.hero-portrait(src=level.unlocksHero.img)
a(href=level.type == 'hero' ? '#' : level.disabled ? "/play" : "/play/#{level.levelPath || 'level'}/#{level.id}", disabled=level.disabled, data-level-id=level.id, data-level-path=level.levelPath || 'level', data-level-name=level.name)
if level.requiresSubscription
img.star(src="/images/pages/play/star.png")

View file

@ -141,6 +141,9 @@ module.exports = class WorldMapView extends RootView
level.color = 'rgb(255, 80, 60)'
if level.requiresSubscription
level.color = 'rgb(80, 130, 200)'
if level.unlocksHero
level.color = 'rgb(0,0,0)'
level.unlockedHero = level.unlocksHero.originalID in (me.get('earned')?.heroes or [])
level.hidden = level.locked or level.disabled
## put lower levels in last, so in the world map they layer over one another properly.
@ -441,6 +444,10 @@ dungeon = [
y: 10.70
nextLevels:
continue: 'the-raised-sword'
unlocksHero: {
img: '/file/db/thang.type/53e12be0d042f23505c3023b/portrait.png'
originalID: '53e12be0d042f23505c3023b'
}
}
{
name: 'Favorable Odds'
@ -779,6 +786,10 @@ forest = [
x: 38
y: 72
requiresSubscription: true
unlocksHero: {
img: '/file/db/thang.type/52fc0ed77e01835453bd8f6c/portrait.png'
originalID: '52fc0ed77e01835453bd8f6c'
}
}
{
name: 'Swift Dagger'
@ -817,6 +828,10 @@ forest = [
x: 47
y: 71
requiresSubscription: true
unlocksHero: {
img: '/file/db/thang.type/52fbf74b7e01835453bd8d8e/portrait.png'
originalID: '529ec584c423d4e83b000014'
}
}
{
name: 'Touch of Death'
@ -887,6 +902,10 @@ forest = [
x: 74.5
y: 92
requiresSubscription: true
unlocksHero: {
img: '/file/db/thang.type/5466d449417c8b48a9811e83/portrait.png'
originalID: '5466d449417c8b48a9811e83'
}
}
{
name: 'Rich Forager'
@ -898,6 +917,10 @@ forest = [
continue: 'siege-of-stonehold'
x: 80
y: 88
unlocksHero: {
img: '/file/db/thang.type/52e9adf7427172ae56002172/portrait.png'
originalID: '52e9adf7427172ae56002172'
}
}
{
name: 'Siege of Stonehold'
@ -907,11 +930,9 @@ forest = [
description: 'Unlock the desert world, if you are strong enough to win this epic battle!'
nextLevels:
continue: 'the-dunes'
disabled: not me.isAdmin()
x: 85.5
y: 83.5
adventurer: true
requiresSubscription: true
}
{
name: 'Multiplayer Treasure Grove'
@ -943,7 +964,6 @@ desert = [
description: 'Behold, the desert, full of glory, danger, and sand. Lots of sand.'
nextLevels:
continue: 'the-mighty-sand-yak'
disabled: not me.isAdmin()
x: 8.47
y: 21.93
adventurer: true
@ -957,7 +977,6 @@ desert = [
description: 'Test your nerves by dodging huge sand yaks on the open dunes!'
nextLevels:
continue: 'oasis'
disabled: not me.isAdmin()
x: 16.56
y: 27.77
adventurer: true
@ -971,7 +990,6 @@ desert = [
description: 'Run a gauntlet of sand yaks to reach oasis and quench your thirst!'
#nextLevels:
# continue: ''
disabled: not me.isAdmin()
x: 23.35
y: 31.60
adventurer: true

View file

@ -69,11 +69,13 @@ module.exports = class PlayHeroesModal extends ModalView
context.confirmButtonI18N = @confirmButtonI18N
context.visibleHero = @visibleHero
context.gems = me.gems()
context.isIE = @isIE()
context
afterRender: ->
super()
return unless @supermodel.finished()
@$el.find('.hero-avatar').addClass 'ie' if @isIE()
heroes = @heroes.models
@$el.find('.hero-indicator').each ->
heroID = $(@).data('hero-id')