From bf54bde207c8f76fbd59feb345221e863b0eff86 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Mon, 9 Feb 2015 20:17:49 -0600 Subject: [PATCH 1/7] feat(event): Valentine's Day --- views/options/profile.jade | 22 +++++++++++++++------- views/shared/new-stuff.jade | 28 ++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/views/options/profile.jade b/views/options/profile.jade index c2250f06b8..1ab07efe1b 100644 --- a/views/options/profile.jade +++ b/views/options/profile.jade @@ -55,10 +55,10 @@ mixin customizeProfile(mobile) // Color li.customize-menu menu(label=env.t('color')) - each v,k in {'c8c8c8':'white','903a00':'brown','cfb853':'blond','ec720f':'red','2e2e2e':'black'} - button(type='button', class='customize-option hair', style='background-color:##{k};', ng-click='set({"preferences.hair.color": "#{v}"})') + each color in ['white','brown','blond','red','black'] + button(type='button', class='#{path=="skin" ? "skin_"+color : "customize-option hair hair_bangs_1_"+color}', ng-click='set({"preferences.hair.color": "#{color}"})') each color in ['candycane','frost','winternight','holly'] - button(type='button', ng-if='user.purchased.hair.color.#{color}', class='customize-option hair hair_bangs_1_#{color}', style='width: 40px; height: 40px;', ng-click='unlock("hair.color.#{color}")') + button(type='button', ng-if='user.purchased.hair.color.#{color}', class='customize-option hair hair_bangs_1_#{color}', ng-click='unlock("hair.color.#{color}")') each color in ['pblue','pgreen','porange','ppink','ppurple','pyellow'] button(type='button', ng-if='user.purchased.hair.color.#{color}', class='customize-option hair hair_bangs_1_#{color}', ng-click='unlock("hair.color.#{color}")') +buyPref('hair.color', ['rainbow','yellow','green','purple','blue','TRUred'], 'rainbowColors') @@ -82,12 +82,20 @@ mixin customizeProfile(mobile) // Purchasable hairstyles menu(label=env.t('hairSet1')) - - var colors = [2,4,5,6,7,8] - span(ng-hide='#{showPath("user.purchased.hair.base", colors, "&&")}') + - var styles = [2,4,5,6,7,8] + span(ng-hide='#{showPath("user.purchased.hair.base", styles, "&&")}') +gemCost(2) - button.btn.btn-xs(ng-click='#{unlockPath("hair.base",colors)}')!= env.t('unlockSet',{cost:5}) + ' ' - each num in colors + button.btn.btn-xs(ng-click='#{unlockPath("hair.base",styles)}')!= env.t('unlockSet',{cost:5}) + ' ' + each num in styles button(class='hair_base_#{num}_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.base["#{num}"]}', ng-click='unlock("hair.base.#{num}")') + menu(label=env.t('hairSet2')) + - var styles = [9,10,11,12,13,14] + span(ng-hide='#{showPath("user.purchased.hair.base", styles, "&&")}') + +gemCost(2) + button.btn.btn-xs(ng-click='#{unlockPath("hair.base", styles)}')!= env.t('unlockSet', {cost: 5}) + ' ' + each num in styles + button(class='hair_base_#{num}_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.base["#{num}"]}', ng-click='unlock("hair.base.#{num}")') + // Flower li.customize-menu diff --git a/views/shared/new-stuff.jade b/views/shared/new-stuff.jade index a88b871f6e..05200138bc 100644 --- a/views/shared/new-stuff.jade +++ b/views/shared/new-stuff.jade @@ -1,21 +1,33 @@ -h5 2/8/2015 - EMAIL NOTIFICATIONS AND LOGIN TYPE SWITCHING! +h5 2/12/2015 - VALENTINE'S DAY AND NEW HAIRSTYLES! hr tr td - h5 Email Notifications - p We've implemented email notifications for a variety of events, including receiving a Private Message, being invited to a Party, Guild, or Quest, and receiving a gift of Gems or a Subscription! We've got some more coming up, too, including the much-requested check-in reminders. - p Don't want to receive a certain type of notification? No problem! Just go to Notification Settings to tell us exactly which ones you do and do not want to receive. Our messenger dragons will be happy to comply! - p.small.muted by paglias and Lemoness + h5 Happy Valentine's Day! + p Help motivate all of the lovely people in your life by sending them a caring valentine. Valentines can be purchased for 10 gold from the Item Store. For spreading love and joy throughout the community, both the giver AND the receiver get a coveted "adoring friends" badge. Hooray! + p.small.muted by Lemoness and SabreCat tr td - h5 Login Type Switching - p Want to change your email address, or switch from Facebook login to email login (or vice versa)? Good news! Now you can switch it yourself, under Settings! - p.small.muted by Lefnire + h5 New Hairstyles! + .promo_updos.pull-right + p There are a new set of updo hairstyles available in the Avatar Customization page! Have fun customizing your characters. + p.small.muted by Crystalphoenix, Mariahm, Painter de Cluster, Leephon, Beffymaroo, Sungabraverday, Lemoness, and Bailey hr a(href='/static/old-news', target='_blank') Read older news mixin oldNews + h5 2/8/2015 + tr + td + h5 Email Notifications + p We've implemented email notifications for a variety of events, including receiving a Private Message, being invited to a Party, Guild, or Quest, and receiving a gift of Gems or a Subscription! We've got some more coming up, too, including the much-requested check-in reminders. + p Don't want to receive a certain type of notification? No problem! Just go to Notification Settings to tell us exactly which ones you do and do not want to receive. Our messenger dragons will be happy to comply! + p.small.muted by paglias and Lemoness + tr + td + h5 Login Type Switching + p Want to change your email address, or switch from Facebook login to email login (or vice versa)? Good news! Now you can switch it yourself, under Settings! + p.small.muted by Lefnire h5 2/3/2015 tr td From 6a6a4a0e57b7f814221bee7f050daeb6ece18e43 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 10 Feb 2015 20:30:20 -0600 Subject: [PATCH 2/7] feat(event): Valentine's cards --- src/controllers/user.js | 2 +- views/options/inventory/inventory.jade | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/user.js b/src/controllers/user.js index ae2987fb8c..2a599384ba 100644 --- a/src/controllers/user.js +++ b/src/controllers/user.js @@ -389,7 +389,7 @@ api.cast = function(req, res, next) { series.push(function(cb2){found.save(cb2)}); } - if (group) { + if (group && !spell.silent) { series.push(function(cb2){ var message = '`'+user.profile.name+' casts '+spell.text() + (targetType=='user' ? ' on '+found.profile.name : ' for the party')+'.`'; group.sendChat(message); diff --git a/views/options/inventory/inventory.jade b/views/options/inventory/inventory.jade index c8d066ba93..a90ebe977e 100644 --- a/views/options/inventory/inventory.jade +++ b/views/options/inventory/inventory.jade @@ -244,3 +244,8 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html') p | 20  span.shop_gold + div + button.customize-option(popover='{{::Content.spells.special.valentine.notes()}}', popover-title='{{::Content.spells.special.valentine.text()}}', popover-trigger='mouseenter', popover-placement='right', popover-append-to-body='true', ng-click='castStart(Content.spells.special.valentine)', class='inventory_special_valentine') + p + | {{Content.spells.special.valentine.value}} + span(class='shop_gold') \ No newline at end of file From 9fddb08aebfca32deb9287a43fcc49fe32b5538b Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 10 Feb 2015 20:47:40 -0600 Subject: [PATCH 3/7] fix(event): Localize poems --- views/shared/modals/limited.jade | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/views/shared/modals/limited.jade b/views/shared/modals/limited.jade index bdf7049fa9..802ca609cf 100644 --- a/views/shared/modals/limited.jade +++ b/views/shared/modals/limited.jade @@ -8,22 +8,13 @@ script(id='modals/valentine.html', type='text/ng-template') .bg-info(style='padding:10px') p To: {{user.profile.name}}, From: {{user.items.special.valentineReceived[0]}} hr - div(ng-switch='Math.floor(Math.random()*3)') - ul.list-unstyled(ng-switch-when='0') - li "Roses are red - li My Dailies are blue - li I'm happy that I'm - li In a Party with you!" - ul.list-unstyled(ng-switch-when='1') - li "Roses are red - li Violets are nice - li Let's get together - li And fight against Vice!" - ul.list-unstyled(ng-switch-default) - li "Roses are red - li This poem style is old - li I hope that you like this - li Cuz it cost ten gold." + ul.list-unstyled(ng-switch='::Math.floor(Math.random()*3)') + li(ng-switch-when='0') + =env.t('valentine0') + li(ng-switch-when='1') + =env.t('valentine1') + li(ng-switch-default) + =env.t('valentine2') p small For enduring such a saccharine poem, you both receive the "Adoring Friends" badge! .modal-footer From 9a44ab76ec3e093f093abee06475da998c8a23f0 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 10 Feb 2015 20:56:46 -0600 Subject: [PATCH 4/7] fix(event): Line breakage II --- views/shared/modals/limited.jade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/shared/modals/limited.jade b/views/shared/modals/limited.jade index 802ca609cf..5a1f082f7c 100644 --- a/views/shared/modals/limited.jade +++ b/views/shared/modals/limited.jade @@ -10,11 +10,11 @@ script(id='modals/valentine.html', type='text/ng-template') hr ul.list-unstyled(ng-switch='::Math.floor(Math.random()*3)') li(ng-switch-when='0') - =env.t('valentine0') + !=env.t('valentine0', {lineBreak:"
"}) li(ng-switch-when='1') - =env.t('valentine1') + !=env.t('valentine1', {lineBreak:"
"}) li(ng-switch-default) - =env.t('valentine2') + !=env.t('valentine2', {lineBreak:"
"}) p small For enduring such a saccharine poem, you both receive the "Adoring Friends" badge! .modal-footer From a5052b1f515d7f7046e32d12d37140843d2a59e9 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 12 Feb 2015 07:39:10 -0600 Subject: [PATCH 5/7] feat(event): Card notifs --- views/shared/header/menu.jade | 5 +++++ views/shared/modals/limited.jade | 6 ++++-- views/shared/new-stuff.jade | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/views/shared/header/menu.jade b/views/shared/header/menu.jade index a08920b3af..642d0db8f3 100644 --- a/views/shared/header/menu.jade +++ b/views/shared/header/menu.jade @@ -202,6 +202,11 @@ nav.toolbar(ng-controller='AuthCtrl', ng-class='{active: isToolbarHidden}') span {{v.name}} a(ng-click='Groups.seenMessage(k)', popover=env.t('clear'),popover-placement='right',popover-trigger='mouseenter',popover-append-to-body='true') span.glyphicon.glyphicon-remove-circle + li(ng-if='user.items.special.valentineReceived || user.items.special.nyeReceived') + a(ng-click='$state.go("options.inventory.drops"); expandMenu(null)') + span.glyphicon.glyphicon-envelope + span=env.t('holidayCard') + ul.toolbar-controls //-li //-a(ng-click='') Clear all diff --git a/views/shared/modals/limited.jade b/views/shared/modals/limited.jade index 5a1f082f7c..e9889e88e3 100644 --- a/views/shared/modals/limited.jade +++ b/views/shared/modals/limited.jade @@ -8,13 +8,15 @@ script(id='modals/valentine.html', type='text/ng-template') .bg-info(style='padding:10px') p To: {{user.profile.name}}, From: {{user.items.special.valentineReceived[0]}} hr - ul.list-unstyled(ng-switch='::Math.floor(Math.random()*3)') + ul.list-unstyled(ng-switch='::Math.floor(Math.random()*4)') li(ng-switch-when='0') !=env.t('valentine0', {lineBreak:"
"}) li(ng-switch-when='1') !=env.t('valentine1', {lineBreak:"
"}) - li(ng-switch-default) + li(ng-switch-when='2') !=env.t('valentine2', {lineBreak:"
"}) + li(ng-switch-default) + !=env.t('valentine3', {lineBreak:"
"}) p small For enduring such a saccharine poem, you both receive the "Adoring Friends" badge! .modal-footer diff --git a/views/shared/new-stuff.jade b/views/shared/new-stuff.jade index 05200138bc..4d39eb56e4 100644 --- a/views/shared/new-stuff.jade +++ b/views/shared/new-stuff.jade @@ -26,7 +26,7 @@ mixin oldNews tr td h5 Login Type Switching - p Want to change your email address, or switch from Facebook login to email login (or vice versa)? Good news! Now you can switch it yourself, under Settings! + p Want to change your email address, or switch from Facebook login to email login? Good news! Now you can switch it yourself, under Settings! p.small.muted by Lefnire h5 2/3/2015 tr From 37ae50a77af4ca176d42a44efb3ae9b8c2109645 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 12 Feb 2015 07:45:47 -0600 Subject: [PATCH 6/7] fix(event): Correct card notifs --- views/shared/header/menu.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/shared/header/menu.jade b/views/shared/header/menu.jade index 642d0db8f3..adb5e7231f 100644 --- a/views/shared/header/menu.jade +++ b/views/shared/header/menu.jade @@ -202,7 +202,7 @@ nav.toolbar(ng-controller='AuthCtrl', ng-class='{active: isToolbarHidden}') span {{v.name}} a(ng-click='Groups.seenMessage(k)', popover=env.t('clear'),popover-placement='right',popover-trigger='mouseenter',popover-append-to-body='true') span.glyphicon.glyphicon-remove-circle - li(ng-if='user.items.special.valentineReceived || user.items.special.nyeReceived') + li(ng-if='user.items.special.valentineReceived[0] || user.items.special.nyeReceived[0]') a(ng-click='$state.go("options.inventory.drops"); expandMenu(null)') span.glyphicon.glyphicon-envelope span=env.t('holidayCard') From de21ec8cf51c253a4eda21bf6fc70c64635d68f1 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 12 Feb 2015 07:52:52 -0600 Subject: [PATCH 7/7] fix(event): Card notif display --- public/js/controllers/authCtrl.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/js/controllers/authCtrl.js b/public/js/controllers/authCtrl.js index 6bdd4c0b83..2cf594965d 100644 --- a/public/js/controllers/authCtrl.js +++ b/public/js/controllers/authCtrl.js @@ -84,12 +84,14 @@ angular.module('habitrpg') $scope._expandedMenu = ($scope._expandedMenu == menu) ? null : menu; }; - function selectNotificationValue(mysteryValue, invitationValue, unallocatedValue, messageValue, noneValue) { + function selectNotificationValue(mysteryValue, invitationValue, holidayCardValue, unallocatedValue, messageValue, noneValue) { var user = $scope.user; if (user.purchased && user.purchased.plan && user.purchased.plan.mysteryItems && user.purchased.plan.mysteryItems.length) { return mysteryValue; } else if ((user.invitations.party && user.invitations.party.id) || (user.invitations.guilds && user.invitations.guilds.length > 0)) { return invitationValue; + } else if ((user.items.special.valentineReceived[0] || user.items.special.nyeReceived[0])) { + return holidayCardValue; } else if (user.flags.classSelected && !(user.preferences && user.preferences.disableClasses) && user.stats.points) { return unallocatedValue; } else if (!(_.isEmpty(user.newMessages))) { @@ -103,13 +105,14 @@ angular.module('habitrpg') return selectNotificationValue( "glyphicon-gift", "glyphicon-user", + "glyphicon-envelope", "glyphicon-plus-sign", "glyphicon-comment", "glyphicon-comment inactive"); }; $scope.hasNoNotifications = function() { - return selectNotificationValue(false, false, false, false, true); + return selectNotificationValue(false, false, false, false, false, true); } // ------ Social ----------