diff --git a/app/views/editor/campaign/CampaignEditorView.coffee b/app/views/editor/campaign/CampaignEditorView.coffee index 4fa466830..31ee2c6d1 100644 --- a/app/views/editor/campaign/CampaignEditorView.coffee +++ b/app/views/editor/campaign/CampaignEditorView.coffee @@ -133,6 +133,7 @@ module.exports = class CampaignEditorView extends RootView @campaign.set('levels', campaignLevels) for level in _.values campaignLevels + continue if /test/.test @campaign.get('slug') # Don't overwrite level stuff for testing Campaigns model = @levels.findWhere {original: level.original} model.set key, level[key] for key in Campaign.denormalizedLevelProperties @toSave.add model if model.hasLocalChanges() @@ -201,18 +202,19 @@ module.exports = class CampaignEditorView extends RootView @insertSubView @campaignView onTreemaChanged: (e, nodes) => - for node in nodes - path = node.getPath() - if _.string.startsWith path, '/levels/' - parts = path.split('/') - original = parts[2] - level = @supermodel.getModelByOriginal Level, original - campaignLevel = @treema.get "/levels/#{original}" + unless /test/.test @campaign.get('slug') # Don't overwrite level stuff for testing Campaigns + for node in nodes + path = node.getPath() + if _.string.startsWith path, '/levels/' + parts = path.split('/') + original = parts[2] + level = @supermodel.getModelByOriginal Level, original + campaignLevel = @treema.get "/levels/#{original}" - @updateRewardsForLevel level, campaignLevel.rewards + @updateRewardsForLevel level, campaignLevel.rewards - level.set key, campaignLevel[key] for key in Campaign.denormalizedLevelProperties - @toSave.add level if level.hasLocalChanges() + level.set key, campaignLevel[key] for key in Campaign.denormalizedLevelProperties + @toSave.add level if level.hasLocalChanges() @toSave.add @campaign @campaign.set key, value for key, value of @treema.data @@ -329,6 +331,7 @@ class LevelNode extends TreemaObjectNode populateData: -> return if @data.name? data = _.pick LevelsNode.levels[@keyForParent].attributes, Campaign.denormalizedLevelProperties + console.log 'got the data', data _.extend @data, data class CampaignsNode extends TreemaObjectNode diff --git a/app/views/play/CampaignView.coffee b/app/views/play/CampaignView.coffee index 23e821347..a778614da 100644 --- a/app/views/play/CampaignView.coffee +++ b/app/views/play/CampaignView.coffee @@ -184,7 +184,6 @@ module.exports = class CampaignView extends RootView context.levelDifficultyMap = @levelDifficultyMap context.levelPlayCountMap = @levelPlayCountMap context.isIPadApp = application.isIPadApp - context.mapType = _.string.slugify @terrain context.requiresSubscription = @requiresSubscription context.editorMode = @editorMode context.adjacentCampaigns = _.filter _.values(_.cloneDeep(@campaign?.get('adjacentCampaigns') or {})), (ac) => @@ -378,7 +377,7 @@ module.exports = class CampaignView extends RootView @particleMan.removeEmitters() @particleMan.attach @$el.find('.map') for level in @campaign.renderedLevels ? {} - particleKey = ['level', @terrain] + particleKey = ['level', @terrain.replace('-branching-test', '')] particleKey.push level.type if level.type and not (level.type in ['hero', 'course']) particleKey.push 'replayable' if level.replayable particleKey.push 'premium' if level.requiresSubscription diff --git a/scripts/mongodb/queries/coursesV1Beta.js b/scripts/mongodb/queries/coursesV1Beta.js new file mode 100644 index 000000000..0f86d7111 --- /dev/null +++ b/scripts/mongodb/queries/coursesV1Beta.js @@ -0,0 +1,65 @@ +// Grab course instance data for Courses v1 Beta + +// Usage: +// mongo
: