diff --git a/app/locale/en.coffee b/app/locale/en.coffee index 8fa370525..9035ac3df 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -69,6 +69,11 @@ change_hero: "Change Hero" # Go back from choose inventory to choose hero choose_inventory: "Equip Items" buy_gems: "Buy Gems" + campaign_forest: "Forest Campaign" + campaign_dungeon: "Dungeon Campaign" + subscription_required: "Subscription Required" + free: "Free" + subscribed: "Subscribed" older_campaigns: "Older Campaigns" anonymous: "Anonymous Player" level_difficulty: "Difficulty: " @@ -90,8 +95,6 @@ campaign_player_created_description: "... in which you battle against the creativity of your fellow Artisan Wizards." campaign_classic_algorithms: "Classic Algorithms" campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science." - campaign_forest: "Forest Campaign" - campaign_dungeon: "Dungeon Campaign" login: sign_up: "Create Account" diff --git a/app/locale/es-419.coffee b/app/locale/es-419.coffee index 6ccb28d09..0f814e748 100644 --- a/app/locale/es-419.coffee +++ b/app/locale/es-419.coffee @@ -466,7 +466,7 @@ module.exports = nativeDescription: "español (América Latina)", englishDescrip new_password: "Nueva Contraseña" new_password_verify: "Verificar" email_subscriptions: "Suscripciones de Email" - email_subscriptions_none: "No tienes subcripciones." + email_subscriptions_none: "No tienes suscripciones." email_announcements: "Noticias" email_announcements_description: "Recibe correos electrónicos con las últimas noticias y desarrollos de CodeCombat." email_notifications: "Notificaciones" diff --git a/app/schemas/subscriptions/misc.coffee b/app/schemas/subscriptions/misc.coffee index f79a53701..3a43ab4ab 100644 --- a/app/schemas/subscriptions/misc.coffee +++ b/app/schemas/subscriptions/misc.coffee @@ -56,6 +56,8 @@ module.exports = 'buy-gems-modal:purchase-initiated': c.object {required: ['productID']}, productID: { type: 'string' } + 'subscribe-modal:subscribed': c.object {} + 'stripe:received-token': c.object { required: ['token'] }, token: { type: 'object', properties: { id: {type: 'string'} diff --git a/app/styles/play/world-map-view.sass b/app/styles/play/world-map-view.sass index 0a20128db..2e83f32bf 100644 --- a/app/styles/play/world-map-view.sass +++ b/app/styles/play/world-map-view.sass @@ -240,8 +240,8 @@ $gameControlMargin: 30px transform: rotate(-35deg) &#dungeon-link - left: 26.6% - top: 43% + left: 13.01% + top: 58% transform: rotate(180deg) .game-controls @@ -332,6 +332,18 @@ $gameControlMargin: 30px &.vol-down .glyphicon.glyphicon-volume-down display: inline-block + #campaign-status + position: absolute + left: 0 + top: 15px + 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 + + body:not(.ipad) #world-map-view .level-info-container pointer-events: none diff --git a/app/templates/play/world-map-view.jade b/app/templates/play/world-map-view.jade index a11003fff..9390928d7 100644 --- a/app/templates/play/world-map-view.jade +++ b/app/templates/play/world-map-view.jade @@ -62,7 +62,7 @@ span.spl.spr(data-i18n="general.player_level") span.spr= me.level() if me.get('anonymous') - span.spr(data-i18n="play.anonymous_player") Anonymous Player + span.spr(data-i18n="play.anonymous") Anonymous Player button.btn.btn-default.btn-flat.btn-sm(data-toggle='coco-modal', data-target='core/AuthModal', data-i18n="login.log_in") else span.spr= me.get('name') @@ -72,3 +72,16 @@ button.btn.btn-lg.btn-inverse#volume-button(title="Adjust volume") .glyphicon.glyphicon-volume-off .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") \ No newline at end of file diff --git a/app/views/play/WorldMapView.coffee b/app/views/play/WorldMapView.coffee index 496294129..5b63d4fb8 100644 --- a/app/views/play/WorldMapView.coffee +++ b/app/views/play/WorldMapView.coffee @@ -25,6 +25,9 @@ module.exports = class WorldMapView extends RootView id: 'world-map-view' template: template + subscriptions: + 'subscribe-modal:subscribed': 'onSubscribed' + events: 'click .map-background': 'onClickMap' 'click .level a': 'onClickLevel' @@ -118,6 +121,10 @@ module.exports = class WorldMapView extends RootView if @requiresSubscription _.delay (=> @openModalView? new SubscribeModal() unless window.currentModal), 2000 + onSubscribed: -> + @requiresSubscription = false + @render() + getRenderData: (context={}) -> context = super(context) context.campaign = _.find campaigns, { id: @terrain } @@ -140,6 +147,7 @@ module.exports = class WorldMapView extends RootView context.mapType = _.string.slugify @terrain context.nextLevel = @nextLevel context.forestIsAvailable = @startedForestLevel or '541b67f71ccc8eaae19f3c62' in (me.get('earned')?.levels or []) + context.requiresSubscription = @requiresSubscription context afterRender: -> diff --git a/app/views/play/modal/SubscribeModal.coffee b/app/views/play/modal/SubscribeModal.coffee index 15321d977..adb2ffd36 100644 --- a/app/views/play/modal/SubscribeModal.coffee +++ b/app/views/play/modal/SubscribeModal.coffee @@ -69,6 +69,7 @@ module.exports = class SubscribeModal extends ModalView onSubscriptionSuccess: -> application.tracker?.trackEvent 'Finished subscription purchase', {} + Backbone.Mediator.publish 'subscribe-modal:subscribed', {} @playSound 'victory' @hide()