diff --git a/app/lib/world/names.coffee b/app/lib/world/names.coffee index 8045f4e2b..7827e87af 100644 --- a/app/lib/world/names.coffee +++ b/app/lib/world/names.coffee @@ -155,7 +155,7 @@ module.exports.thangNames = thangNames = 'Frog Pet': ['Hypnotoad'] 'Griffin Pet': [''] 'Pugicorn Pet': [''] - 'Polar Bear Pet': [''] + 'Polar Bear Pet': ['Klondike'] 'Wolf Pet': [''] 'Horse': [ # Animal diff --git a/app/styles/play/campaign-view.sass b/app/styles/play/campaign-view.sass index 255964839..5ac08ef78 100644 --- a/app/styles/play/campaign-view.sass +++ b/app/styles/play/campaign-view.sass @@ -524,7 +524,7 @@ $gameControlMargin: 30px $campaignWidth: 317px $campaignHeight: 634px $campaignHoverScale: 1.2 - width: 6 * $campaignWidth + width: 8 * $campaignWidth height: $campaignHeight * $campaignHoverScale flex-wrap: nowrap display: flex @@ -663,6 +663,10 @@ $gameControlMargin: 30px background-position: -151px 0px &.campaign-game-dev-1 background-position: -454px 0px + &.campaign-web-dev-2 + background-position: -291px 0px + &.campaign-game-dev-2 + background-position: -628px 0px .small-nav-logo, .picoctf-powered-by diff --git a/app/templates/play/campaign-view.jade b/app/templates/play/campaign-view.jade index 409ff8e62..22ee2e483 100644 --- a/app/templates/play/campaign-view.jade +++ b/app/templates/play/campaign-view.jade @@ -100,9 +100,10 @@ if view.showAds() else .portal .portals - for campaignSlug in ['dungeon', 'beta-campaigns', 'forest', 'desert', 'mountain', 'glacier', 'volcano'] - if campaignSlug === 'beta-campaigns' - - var betaSlugs = _.shuffle(['campaign-game-dev-1', 'campaign-web-dev-1']); + //- TODO: you must change CampaignView portalsWidth when adding/removing campaigns here + for campaignSlug in ['dungeon', 'beta-campaigns-1', 'forest', 'beta-campaigns-2', 'desert', 'mountain', 'glacier', 'volcano'] + if campaignSlug === 'beta-campaigns-1' || campaignSlug === 'beta-campaigns-2' + - var betaSlugs = campaignSlug === 'beta-campaigns-1' ? _.shuffle(['campaign-game-dev-1', 'campaign-web-dev-1']) : _.shuffle(['campaign-game-dev-2', 'campaign-web-dev-2']); .beta-container each campaignSlug in betaSlugs - var campaign = campaigns[campaignSlug]; @@ -129,8 +130,6 @@ if view.showAds() span= i18n(campaign.attributes, 'description') else - var campaign = campaigns[campaignSlug]; - if !campaign - - continue; - var godmode = me.get('permissions', true).indexOf('godmode') != -1; div(class="campaign #{campaignSlug}" + (campaign ? "" : " silhouette") + (campaign && campaign.locked && !godmode ? " locked" : ""), data-campaign-slug=campaignSlug) .campaign-label diff --git a/app/views/play/CampaignView.coffee b/app/views/play/CampaignView.coffee index 031005a0d..bd5b8ab4c 100644 --- a/app/views/play/CampaignView.coffee +++ b/app/views/play/CampaignView.coffee @@ -196,7 +196,9 @@ module.exports = class CampaignView extends RootView context.requiresSubscription = @requiresSubscription context.editorMode = @editorMode context.adjacentCampaigns = _.filter _.values(_.cloneDeep(@campaign?.get('adjacentCampaigns') or {})), (ac) => - return false if ac.showIfUnlocked and (ac.showIfUnlocked not in me.levels()) and not @editorMode + if ac.showIfUnlocked and not @editorMode + return false if _.isString(ac.showIfUnlocked) and ac.showIfUnlocked not in me.levels() + return false if _.isArray(ac.showIfUnlocked) and _.intersection(ac.showIfUnlocked, me.levels()).length < 0 ac.name = utils.i18n ac, 'name' styles = [] styles.push "color: #{ac.color}" if ac.color @@ -226,7 +228,10 @@ module.exports = class CampaignView extends RootView campaign.locked = true for campaign in @campaigns.models for acID, ac of campaign.get('adjacentCampaigns') ? {} - _.find(@campaigns.models, id: acID)?.locked = false if ac.showIfUnlocked in me.levels() + if _.isString(ac.showIfUnlocked) + _.find(@campaigns.models, id: acID)?.locked = false if ac.showIfUnlocked in me.levels() + else if _.isArray(ac.showIfUnlocked) + _.find(@campaigns.models, id: acID)?.locked = false if _.intersection(ac.showIfUnlocked, me.levels()).length context @@ -437,7 +442,7 @@ module.exports = class CampaignView extends RootView return if 0.2 < fraction < 0.8 direction = if fraction < 0.5 then 1 else -1 magnitude = 0.2 * bodyWidth * (if direction is -1 then fraction - 0.8 else 0.2 - fraction) / 0.2 - portalsWidth = 1902 # TODO: if we add campaigns or change margins, this will get out of date... + portalsWidth = 2536 # TODO: if we add campaigns or change margins, this will get out of date... scrollTo = $portals.offset().left + direction * magnitude scrollTo = Math.max bodyWidth - portalsWidth, scrollTo scrollTo = Math.min 0, scrollTo diff --git a/app/views/play/level/modal/HeroVictoryModal.coffee b/app/views/play/level/modal/HeroVictoryModal.coffee index af5517513..a96dff041 100644 --- a/app/views/play/level/modal/HeroVictoryModal.coffee +++ b/app/views/play/level/modal/HeroVictoryModal.coffee @@ -421,6 +421,9 @@ module.exports = class HeroVictoryModal extends ModalView 'tabula-rasa': '', 'wanted-poster': '', 'siege-of-stonehold': '', + 'go-fetch': '', + 'palimpsest': '', + 'quizlet': '', 'clash-of-clones': 'mountain', 'summits-gate': 'glacier' }[@level.get('slug')] ? @level.get 'campaign'