mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-12 00:31:21 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
68494a694d
5 changed files with 21 additions and 10 deletions
|
@ -155,7 +155,7 @@ module.exports.thangNames = thangNames =
|
||||||
'Frog Pet': ['Hypnotoad']
|
'Frog Pet': ['Hypnotoad']
|
||||||
'Griffin Pet': ['']
|
'Griffin Pet': ['']
|
||||||
'Pugicorn Pet': ['']
|
'Pugicorn Pet': ['']
|
||||||
'Polar Bear Pet': ['']
|
'Polar Bear Pet': ['Klondike']
|
||||||
'Wolf Pet': ['']
|
'Wolf Pet': ['']
|
||||||
'Horse': [
|
'Horse': [
|
||||||
# Animal
|
# Animal
|
||||||
|
|
|
@ -524,7 +524,7 @@ $gameControlMargin: 30px
|
||||||
$campaignWidth: 317px
|
$campaignWidth: 317px
|
||||||
$campaignHeight: 634px
|
$campaignHeight: 634px
|
||||||
$campaignHoverScale: 1.2
|
$campaignHoverScale: 1.2
|
||||||
width: 6 * $campaignWidth
|
width: 8 * $campaignWidth
|
||||||
height: $campaignHeight * $campaignHoverScale
|
height: $campaignHeight * $campaignHoverScale
|
||||||
flex-wrap: nowrap
|
flex-wrap: nowrap
|
||||||
display: flex
|
display: flex
|
||||||
|
@ -663,6 +663,10 @@ $gameControlMargin: 30px
|
||||||
background-position: -151px 0px
|
background-position: -151px 0px
|
||||||
&.campaign-game-dev-1
|
&.campaign-game-dev-1
|
||||||
background-position: -454px 0px
|
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
|
.small-nav-logo, .picoctf-powered-by
|
||||||
|
|
|
@ -100,9 +100,10 @@ if view.showAds()
|
||||||
else
|
else
|
||||||
.portal
|
.portal
|
||||||
.portals
|
.portals
|
||||||
for campaignSlug in ['dungeon', 'beta-campaigns', 'forest', 'desert', 'mountain', 'glacier', 'volcano']
|
//- TODO: you must change CampaignView portalsWidth when adding/removing campaigns here
|
||||||
if campaignSlug === 'beta-campaigns'
|
for campaignSlug in ['dungeon', 'beta-campaigns-1', 'forest', 'beta-campaigns-2', 'desert', 'mountain', 'glacier', 'volcano']
|
||||||
- var betaSlugs = _.shuffle(['campaign-game-dev-1', 'campaign-web-dev-1']);
|
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
|
.beta-container
|
||||||
each campaignSlug in betaSlugs
|
each campaignSlug in betaSlugs
|
||||||
- var campaign = campaigns[campaignSlug];
|
- var campaign = campaigns[campaignSlug];
|
||||||
|
@ -129,8 +130,6 @@ if view.showAds()
|
||||||
span= i18n(campaign.attributes, 'description')
|
span= i18n(campaign.attributes, 'description')
|
||||||
else
|
else
|
||||||
- var campaign = campaigns[campaignSlug];
|
- var campaign = campaigns[campaignSlug];
|
||||||
if !campaign
|
|
||||||
- continue;
|
|
||||||
- var godmode = me.get('permissions', true).indexOf('godmode') != -1;
|
- var godmode = me.get('permissions', true).indexOf('godmode') != -1;
|
||||||
div(class="campaign #{campaignSlug}" + (campaign ? "" : " silhouette") + (campaign && campaign.locked && !godmode ? " locked" : ""), data-campaign-slug=campaignSlug)
|
div(class="campaign #{campaignSlug}" + (campaign ? "" : " silhouette") + (campaign && campaign.locked && !godmode ? " locked" : ""), data-campaign-slug=campaignSlug)
|
||||||
.campaign-label
|
.campaign-label
|
||||||
|
|
|
@ -196,7 +196,9 @@ module.exports = class CampaignView extends RootView
|
||||||
context.requiresSubscription = @requiresSubscription
|
context.requiresSubscription = @requiresSubscription
|
||||||
context.editorMode = @editorMode
|
context.editorMode = @editorMode
|
||||||
context.adjacentCampaigns = _.filter _.values(_.cloneDeep(@campaign?.get('adjacentCampaigns') or {})), (ac) =>
|
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'
|
ac.name = utils.i18n ac, 'name'
|
||||||
styles = []
|
styles = []
|
||||||
styles.push "color: #{ac.color}" if ac.color
|
styles.push "color: #{ac.color}" if ac.color
|
||||||
|
@ -226,7 +228,10 @@ module.exports = class CampaignView extends RootView
|
||||||
campaign.locked = true
|
campaign.locked = true
|
||||||
for campaign in @campaigns.models
|
for campaign in @campaigns.models
|
||||||
for acID, ac of campaign.get('adjacentCampaigns') ? {}
|
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
|
context
|
||||||
|
|
||||||
|
@ -437,7 +442,7 @@ module.exports = class CampaignView extends RootView
|
||||||
return if 0.2 < fraction < 0.8
|
return if 0.2 < fraction < 0.8
|
||||||
direction = if fraction < 0.5 then 1 else -1
|
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
|
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 = $portals.offset().left + direction * magnitude
|
||||||
scrollTo = Math.max bodyWidth - portalsWidth, scrollTo
|
scrollTo = Math.max bodyWidth - portalsWidth, scrollTo
|
||||||
scrollTo = Math.min 0, scrollTo
|
scrollTo = Math.min 0, scrollTo
|
||||||
|
|
|
@ -421,6 +421,9 @@ module.exports = class HeroVictoryModal extends ModalView
|
||||||
'tabula-rasa': '',
|
'tabula-rasa': '',
|
||||||
'wanted-poster': '',
|
'wanted-poster': '',
|
||||||
'siege-of-stonehold': '',
|
'siege-of-stonehold': '',
|
||||||
|
'go-fetch': '',
|
||||||
|
'palimpsest': '',
|
||||||
|
'quizlet': '',
|
||||||
'clash-of-clones': 'mountain',
|
'clash-of-clones': 'mountain',
|
||||||
'summits-gate': 'glacier'
|
'summits-gate': 'glacier'
|
||||||
}[@level.get('slug')] ? @level.get 'campaign'
|
}[@level.get('slug')] ? @level.get 'campaign'
|
||||||
|
|
Loading…
Reference in a new issue