mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Added campaign completion progress indicator.
This commit is contained in:
parent
239b72dd01
commit
aab6d17047
4 changed files with 30 additions and 16 deletions
|
@ -68,9 +68,10 @@
|
|||
change_hero: "Change Hero" # Go back from choose inventory to choose hero
|
||||
choose_inventory: "Equip Items"
|
||||
buy_gems: "Buy Gems"
|
||||
campaign_desert: "Desert Campaign"
|
||||
campaign_forest: "Forest Campaign"
|
||||
campaign_dungeon: "Dungeon Campaign"
|
||||
dungeon_campaign: "Kithgard Dungeon"
|
||||
forest_campaign: "Backwoods Forest"
|
||||
desert_campaign: "Sarven Desert"
|
||||
mountain_campaign: "Cloudrip Mountain"
|
||||
subscription_required: "Subscription Required"
|
||||
free: "Free"
|
||||
subscribed: "Subscribed"
|
||||
|
|
|
@ -404,13 +404,26 @@ $gameControlMargin: 30px
|
|||
#campaign-status
|
||||
position: absolute
|
||||
left: 0
|
||||
top: 15px
|
||||
top: 5px
|
||||
width: 100%
|
||||
margin: 0
|
||||
text-align: center
|
||||
color: rgb(254,188,68)
|
||||
font-size: 30px
|
||||
text-shadow: black 2px 2px 0, black -2px -2px 0, black 2px -2px 0, black -2px 2px 0, black 2px 0px 0, black 0px -2px 0, black -2px 0px 0, black 0px 2px 0
|
||||
z-index: 30
|
||||
pointer-events: none
|
||||
|
||||
.campaign-status-background
|
||||
background-color: rgba(255, 255, 255, 0.5)
|
||||
border-radius: 10px
|
||||
padding: 10px
|
||||
display: inline-block
|
||||
|
||||
img.banner
|
||||
height: 50px
|
||||
vertical-align: bottom
|
||||
margin: -20px 0 -6px 5px
|
||||
|
||||
|
||||
body:not(.ipad) #campaign-view
|
||||
|
|
|
@ -80,15 +80,11 @@ button.btn.btn-lg.btn-inverse#volume-button(data-i18n="[title]play.adjust_volume
|
|||
.glyphicon.glyphicon-volume-down
|
||||
.glyphicon.glyphicon-volume-up
|
||||
|
||||
//h1#campaign-status
|
||||
// if mapType == 'dungeon'
|
||||
// span.spr(data-i18n="play.campaign_dungeon")
|
||||
// else if mapType == 'forest'
|
||||
// span.spr(data-i18n="play.campaign_forest")
|
||||
// | -
|
||||
// if requiresSubscription
|
||||
// span.spl(data-i18n="play.subscription_required")
|
||||
// else if mapType == 'dungeon'
|
||||
// span.spl(data-i18n="play.free")
|
||||
// else
|
||||
// span.spl(data-i18n="play.subscribed")
|
||||
h1#campaign-status
|
||||
.campaign-status-background
|
||||
span.spr(data-i18n="play." + mapType + "_campaign")
|
||||
| -
|
||||
span.spl.spr= levelsCompleted
|
||||
| /
|
||||
span.spl= levelsTotal
|
||||
img.banner(src="/images/pages/play/level-banner-complete.png")
|
||||
|
|
|
@ -133,6 +133,7 @@ module.exports = class CampaignView extends RootView
|
|||
context = super(context)
|
||||
context.campaign = @campaign
|
||||
context.levels = _.values($.extend true, {}, @campaign.get('levels'))
|
||||
context.levelsCompleted = context.levelsTotal = 0
|
||||
for level in context.levels
|
||||
level.position ?= { x: 10, y: 10 }
|
||||
level.locked = not me.ownsLevel level.original
|
||||
|
@ -146,6 +147,9 @@ module.exports = class CampaignView extends RootView
|
|||
if level.unlocksHero
|
||||
level.unlockedHero = level.unlocksHero.originalID in (me.get('earned')?.heroes or [])
|
||||
level.hidden = level.locked
|
||||
unless level.disabled
|
||||
++context.levelsTotal
|
||||
++context.levelsCompleted if @levelStatusMap[level.slug] is 'complete'
|
||||
|
||||
@determineNextLevel context.levels if @sessions.loaded
|
||||
# put lower levels in last, so in the world map they layer over one another properly.
|
||||
|
|
Loading…
Reference in a new issue