Not including levels that are unlocked in later campaigns in level counts for earlier campaigns until they are started.
This commit is contained in:
parent
eef33f2ed5
commit
bf86b2f9cd
2 changed files with 10 additions and 3 deletions
app
|
@ -568,6 +568,9 @@ $gameControlMargin: 30px
|
||||||
color: white
|
color: white
|
||||||
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
|
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
|
||||||
|
|
||||||
|
.campaign-locked
|
||||||
|
margin: 32px 0
|
||||||
|
|
||||||
.campaign-description
|
.campaign-description
|
||||||
margin: 0px 40px
|
margin: 0px 40px
|
||||||
background: transparent url(/images/level/popover_border_background.png) no-repeat
|
background: transparent url(/images/level/popover_border_background.png) no-repeat
|
||||||
|
|
|
@ -198,7 +198,7 @@ module.exports = class CampaignView extends RootView
|
||||||
|
|
||||||
if @campaigns
|
if @campaigns
|
||||||
context.campaigns = {}
|
context.campaigns = {}
|
||||||
for campaign in @campaigns.models
|
for campaign in @campaigns.models when campaign.get('slug') isnt 'auditions'
|
||||||
context.campaigns[campaign.get('slug')] = campaign
|
context.campaigns[campaign.get('slug')] = campaign
|
||||||
if @sessions.loaded
|
if @sessions.loaded
|
||||||
levels = _.values($.extend true, {}, campaign.get('levels') ? {})
|
levels = _.values($.extend true, {}, campaign.get('levels') ? {})
|
||||||
|
@ -276,10 +276,14 @@ module.exports = class CampaignView extends RootView
|
||||||
|
|
||||||
countLevels: (levels) ->
|
countLevels: (levels) ->
|
||||||
count = total: 0, completed: 0
|
count = total: 0, completed: 0
|
||||||
for level in levels
|
for level, levelIndex in levels
|
||||||
@annotateLevel level unless level.locked? # Annotate if we haven't already.
|
@annotateLevel level unless level.locked? # Annotate if we haven't already.
|
||||||
unless level.disabled
|
unless level.disabled
|
||||||
++count.total
|
unlockedInSameCampaign = levelIndex < 5 # First few are always counted (probably unlocked in previous campaign)
|
||||||
|
for otherLevel in levels when not unlockedInSameCampaign and otherLevel isnt level
|
||||||
|
for reward in (otherLevel.rewards ? []) when reward.level
|
||||||
|
unlockedInSameCampaign ||= reward.level is level.original
|
||||||
|
++count.total if unlockedInSameCampaign or not level.locked
|
||||||
++count.completed if @levelStatusMap[level.slug] is 'complete'
|
++count.completed if @levelStatusMap[level.slug] is 'complete'
|
||||||
count
|
count
|
||||||
|
|
||||||
|
|
Reference in a new issue