diff --git a/app/assets/images/level/popover_background.png b/app/assets/images/level/popover_background.png index 214edeaae..f87ea6d4b 100644 Binary files a/app/assets/images/level/popover_background.png and b/app/assets/images/level/popover_background.png differ diff --git a/app/assets/images/level/popover_border_background.png b/app/assets/images/level/popover_border_background.png new file mode 100644 index 000000000..e74234591 Binary files /dev/null and b/app/assets/images/level/popover_border_background.png differ diff --git a/app/assets/images/pages/game-menu/lock-processed.png b/app/assets/images/pages/game-menu/lock-processed.png new file mode 100644 index 000000000..bb038b4b0 Binary files /dev/null and b/app/assets/images/pages/game-menu/lock-processed.png differ diff --git a/app/lib/sprites/SpriteParser.coffee b/app/lib/sprites/SpriteParser.coffee index 361dc8411..5bdc183aa 100644 --- a/app/lib/sprites/SpriteParser.coffee +++ b/app/lib/sprites/SpriteParser.coffee @@ -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 diff --git a/app/styles/common/common.sass b/app/styles/common/common.sass index 5a17efca4..b20819601 100644 --- a/app/styles/common/common.sass +++ b/app/styles/common/common.sass @@ -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 diff --git a/app/styles/play/level/tome/spell_debug.sass b/app/styles/play/level/tome/spell_debug.sass index 945b01d8f..b2d3ca17a 100644 --- a/app/styles/play/level/tome/spell_debug.sass +++ b/app/styles/play/level/tome/spell_debug.sass @@ -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 diff --git a/app/styles/play/level/tome/spell_list.sass b/app/styles/play/level/tome/spell_list.sass index 7a234a402..b66cd5f82 100644 --- a/app/styles/play/level/tome/spell_list.sass +++ b/app/styles/play/level/tome/spell_list.sass @@ -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 diff --git a/app/styles/play/level/tome/spell_list_entry_thangs.sass b/app/styles/play/level/tome/spell_list_entry_thangs.sass index b8faebba0..abe03b44a 100644 --- a/app/styles/play/level/tome/spell_list_entry_thangs.sass +++ b/app/styles/play/level/tome/spell_list_entry_thangs.sass @@ -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 diff --git a/app/styles/play/level/tome/spell_palette_entry.sass b/app/styles/play/level/tome/spell_palette_entry.sass index bb0177039..e7dfa7806 100644 --- a/app/styles/play/level/tome/spell_palette_entry.sass +++ b/app/styles/play/level/tome/spell_palette_entry.sass @@ -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 diff --git a/app/styles/play/level/tome/spell_toolbar.sass b/app/styles/play/level/tome/spell_toolbar.sass index a17f84769..1445b3055 100644 --- a/app/styles/play/level/tome/spell_toolbar.sass +++ b/app/styles/play/level/tome/spell_toolbar.sass @@ -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 diff --git a/app/styles/play/level/tome/tome.sass b/app/styles/play/level/tome/tome.sass index ff6f691d0..924b72e31 100644 --- a/app/styles/play/level/tome/tome.sass +++ b/app/styles/play/level/tome/tome.sass @@ -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) diff --git a/app/styles/play/modal/play-heroes-modal.sass b/app/styles/play/modal/play-heroes-modal.sass index 4aa7d6c0c..2d6b90894 100644 --- a/app/styles/play/modal/play-heroes-modal.sass +++ b/app/styles/play/modal/play-heroes-modal.sass @@ -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% diff --git a/app/styles/play/world-map-view.sass b/app/styles/play/world-map-view.sass index 4cb0b62af..4b4022784 100644 --- a/app/styles/play/world-map-view.sass +++ b/app/styles/play/world-map-view.sass @@ -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) diff --git a/app/templates/play/modal/play-heroes-modal.jade b/app/templates/play/modal/play-heroes-modal.jade index 827df7b1e..9f0fc4afb 100644 --- a/app/templates/play/modal/play-heroes-modal.jade +++ b/app/templates/play/modal/play-heroes-modal.jade @@ -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')) diff --git a/app/templates/play/world-map-view.jade b/app/templates/play/world-map-view.jade index 7b65c7b52..57599a8af 100644 --- a/app/templates/play/world-map-view.jade +++ b/app/templates/play/world-map-view.jade @@ -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") diff --git a/app/views/play/WorldMapView.coffee b/app/views/play/WorldMapView.coffee index 8e4b451c0..f474a249b 100644 --- a/app/views/play/WorldMapView.coffee +++ b/app/views/play/WorldMapView.coffee @@ -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 diff --git a/app/views/play/modal/PlayHeroesModal.coffee b/app/views/play/modal/PlayHeroesModal.coffee index 94b99f61a..837ecbb64 100644 --- a/app/views/play/modal/PlayHeroesModal.coffee +++ b/app/views/play/modal/PlayHeroesModal.coffee @@ -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')