From 06367d106b6e2475687bb427a837d7c9defa480d Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Sun, 7 Dec 2014 18:56:57 -0800 Subject: [PATCH 1/4] IE8 unsupported message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Had to go low-tech. IE8 doesn’t make it far enough for a nicely styled homepage with unsupported message. --- app/assets/main.html | 18 +++++++++++++++--- app/templates/home-view.jade | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/assets/main.html b/app/assets/main.html index 6408aad6a..810cf0cf9 100644 --- a/app/assets/main.html +++ b/app/assets/main.html @@ -34,7 +34,7 @@ diff --git a/app/templates/home-view.jade b/app/templates/home-view.jade index ef460c283..7c11d487c 100644 --- a/app/templates/home-view.jade +++ b/app/templates/home-view.jade @@ -13,6 +13,7 @@ block outer_content #slogan(data-i18n="home.slogan") + //- TODO: This does not work on IE8 .alert.alert-danger.lt-ie9 strong(data-i18n="home.no_ie") CodeCombat does not run in Internet Explorer 8 or older. Sorry! From 346ace6ac395da302a1a22e344a7203023ed3e93 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sun, 7 Dec 2014 19:18:52 -0800 Subject: [PATCH 2/4] Fixed goals not showing up when reloading level. --- app/views/play/level/PlayLevelView.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/play/level/PlayLevelView.coffee b/app/views/play/level/PlayLevelView.coffee index eb88e5765..e852c38f8 100644 --- a/app/views/play/level/PlayLevelView.coffee +++ b/app/views/play/level/PlayLevelView.coffee @@ -147,7 +147,7 @@ module.exports = class PlayLevelView extends RootView afterRender: -> super() window.onPlayLevelViewLoaded? @ # still a hack - @insertSubView @loadingView = new LevelLoadingView autoUnveil: @options.autoUnveil, level: @level # May not have @level loaded yet + @insertSubView @loadingView = new LevelLoadingView autoUnveil: @options.autoUnveil, level: @levelLoader?.level ? @level # May not have @level loaded yet @$el.find('#level-done-button').hide() $('body').addClass('is-playing') $('body').bind('touchmove', false) if @isIPadApp() From 4a659903fe722a30841a12abec7bcda709fdcd9d Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sun, 7 Dec 2014 19:38:24 -0800 Subject: [PATCH 3/4] Started A/B test for whether the AnnouncesAction and take-damage audio help. --- app/lib/surface/Lank.coffee | 14 ++++++++++---- app/models/User.coffee | 12 ++++++++++++ app/views/play/level/modal/HeroVictoryModal.coffee | 4 ++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/lib/surface/Lank.coffee b/app/lib/surface/Lank.coffee index 82706f229..af43a2235 100644 --- a/app/lib/surface/Lank.coffee +++ b/app/lib/surface/Lank.coffee @@ -691,10 +691,13 @@ module.exports = Lank = class Lank extends CocoClass Backbone.Mediator.publish 'surface:gold-changed', {team: @thang.team, gold: gold, goldEarned: Math.floor(@thang.goldEarned ? 0)} shouldMuteMessage: (m) -> + if me.getAnnouncesActionAudioGroup() in ['no-audio', 'just-take-damage'] + return true if m in ['moveRight', 'moveUp', 'moveDown', 'moveLeft'] + return true if /^attack /.test m + return true if /^Repeating loop/.test m + return true if /^findNearestEnemy/.test m + return false if m in ['moveRight', 'moveUp', 'moveDown', 'moveLeft'] - #return true if /^attack /.test m - #return true if /^Repeating loop/.test m - #return true if /^findNearestEnemy/.test m @previouslySaidMessages ?= {} t0 = @previouslySaidMessages[m] ? 0 t1 = new Date() @@ -704,7 +707,10 @@ module.exports = Lank = class Lank extends CocoClass playSounds: (withDelay=true, volume=1.0) -> for event in @thang.currentEvents ? [] - @playSound event, withDelay, volume + if event is 'take-damage' and me.getAnnouncesActionAudioGroup() in ['no-audio', 'without-take-damage'] + null # Skip playing it + else + @playSound event, withDelay, volume if event is 'pay-bounty-gold' and @thang.bountyGold > 25 and @thang.team isnt me.team AudioPlayer.playInterfaceSound 'coin_1', 0.25 if @thang.actionActivated and (action = @thang.getActionName()) isnt 'say' diff --git a/app/models/User.coffee b/app/models/User.coffee index e3bf5e798..51bae80a7 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -103,6 +103,18 @@ module.exports = class User extends CocoModel myHeroClasses.push heroClass for heroClass, heroSlugs of ThangType.heroClasses when _.intersection(myHeroSlugs, heroSlugs).length myHeroClasses + getAnnouncesActionAudioGroup: -> + return @announcesActionAudioGroup if @announcesActionAudioGroup + group = me.get('testGroupNumber') % 4 + @announcesActionAudioGroup = switch group + when 0 then 'all-audio' + when 1 then 'no-audio' + when 2 then 'just-take-damage' + when 3 then 'without-take-damage' + @announcesActionAudioGroup = 'all-audio' if me.isAdmin() + application.tracker.identify announcesActionAudioGroup: @announcesActionAudioGroup unless me.isAdmin() + @announcesActionAudioGroup + getGemPromptGroup: -> return @gemPromptGroup if @gemPromptGroup group = me.get('testGroupNumber') % 8 diff --git a/app/views/play/level/modal/HeroVictoryModal.coffee b/app/views/play/level/modal/HeroVictoryModal.coffee index d316a96ea..921d08c12 100644 --- a/app/views/play/level/modal/HeroVictoryModal.coffee +++ b/app/views/play/level/modal/HeroVictoryModal.coffee @@ -270,6 +270,10 @@ module.exports = class HeroVictoryModal extends ModalView levelLabel = xpEl.find('.level') utils.replaceText levelLabel, currentLevel + if leveledUp and (not @displayedLevel or currentLevel > @displayedLevel) + @playSound 'level-up' + @displayedLevel = currentLevel + endSequentialAnimations: -> clearInterval @sequentialAnimationInterval @animationComplete = true From 7854d6bf5a502b9a47d488422b719e3c2770f567 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sun, 7 Dec 2014 20:17:22 -0800 Subject: [PATCH 4/4] Fixed #1868. Fixed #1846. Made sure that home view slogan always fits in all languages. --- app/styles/home.sass | 7 ++++++- app/styles/play/modal/item-details-view.sass | 13 +++++++++++++ config.coffee | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/styles/home.sass b/app/styles/home.sass index 0092035f6..58db70e72 100644 --- a/app/styles/home.sass +++ b/app/styles/home.sass @@ -66,7 +66,7 @@ @media screen and ( max-height: 800px ) top: 451px - + .alert top: 213px border: 5px solid darkred @@ -82,3 +82,8 @@ a color: lighten(#0b63bc, 10%) + +body[lang='ru'], body[lang^='de'], body[lang^='pt'], body[lang='pl'], body[lang='tr'], body[lang^='nl'], body[lang^='cs'], body[lang^='sv'], body[lang^='el'], body[lang^='hu'], body[lang^='bg'] + #home-view #slogan + font-size: 22px + line-height: 23px diff --git a/app/styles/play/modal/item-details-view.sass b/app/styles/play/modal/item-details-view.sass index 9b7b17918..8807b65a5 100644 --- a/app/styles/play/modal/item-details-view.sass +++ b/app/styles/play/modal/item-details-view.sass @@ -107,3 +107,16 @@ .unequippable position: absolute + +body:not([lang^='en']) + #item-details-view + #item-details-body + .stat-row + text-align: center + + .stat-label, .stat + position: initial + display: inline-block + + .stat-label + margin-right: 8px diff --git a/config.coffee b/config.coffee index bbc0c05a2..a6bdd7f22 100644 --- a/config.coffee +++ b/config.coffee @@ -55,6 +55,7 @@ exports.config = regJoin('^app/core') regJoin('^app/views/core') 'app/locale/locale.coffee' + 'app/locale/en.coffee' 'app/lib/sprites/SpriteBuilder.coffee' # loaded by ThangType ]