From 00a212660ac39599d7b031048e29879d2c7f4d45 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 13 Aug 2015 16:58:31 -0500 Subject: [PATCH] feat(greeting-cards): Thank-You & Greets --- common/locales/en/generic.json | 6 ++-- common/script/content.coffee | 4 +++ common/script/index.coffee | 3 +- website/public/js/controllers/menuCtrl.js | 7 ++-- website/public/js/services/chatServices.js | 7 +++- website/views/options/inventory/drops.jade | 2 +- website/views/shared/modals/limited.jade | 2 +- website/views/shared/new-stuff.jade | 42 +++++++++++++--------- 8 files changed, 45 insertions(+), 28 deletions(-) diff --git a/common/locales/en/generic.json b/common/locales/en/generic.json index 717961204d..c0600db04d 100644 --- a/common/locales/en/generic.json +++ b/common/locales/en/generic.json @@ -122,13 +122,13 @@ "greeting3": "\"Hey you!\"", "cheeryChum": "Cheery Chum", "cheeryChumText": "Hey! Hi! Hello! Sent or received <%= cards %> greeting cards.", - "thankyouCard": "Thank You Card", + "thankyouCard": "Thank-You Card", "thankyouCardExplanation": "You both receive the Greatly Grateful achievement!", - "thankyouCardNotes": "Send a thank you card to a party member.", + "thankyouCardNotes": "Send a Thank-You card to a party member.", "thankyou0": "\"Thank you very much!\"", "thankyou1": "\"Thank you, thank you, thank you!\"", "thankyou2": "\"Sending you a thousand thanks.\"", "thankyou3": "\"I'm very grateful - thank you!\"", "greatlyGrateful": "Greatly Grateful", - "greatlyGratefulText": "Thanks for being thankful! Sent or received <%= cards %> thank you cards." + "greatlyGratefulText": "Thanks for being thankful! Sent or received <%= cards %> Thank-You cards." } diff --git a/common/script/content.coffee b/common/script/content.coffee index e554e72f60..d99046a770 100644 --- a/common/script/content.coffee +++ b/common/script/content.coffee @@ -928,6 +928,7 @@ api.spells = if !target.items.special.nyeReceived target.items.special.nyeReceived = [] target.items.special.nyeReceived.push user.profile.name + target.flags.cardReceived = true target.markModified? 'items.special.nyeReceived' user.stats.gp -= 10 @@ -951,6 +952,7 @@ api.spells = if !target.items.special.valentineReceived target.items.special.valentineReceived = [] target.items.special.valentineReceived.push user.profile.name + target.flags.cardReceived = true target.markModified? 'items.special.valentineReceived' user.stats.gp -= 10 @@ -974,6 +976,7 @@ api.spells = if !target.items.special.greetingReceived target.items.special.greetingReceived = [] target.items.special.greetingReceived.push user.profile.name + target.flags.cardReceived = true target.markModified? 'items.special.greetingReceived' user.stats.gp -= 10 @@ -997,6 +1000,7 @@ api.spells = if !target.items.special.thankyouReceived target.items.special.thankyouReceived = [] target.items.special.thankyouReceived.push user.profile.name + target.flags.cardReceived = true target.markModified? 'items.special.thankyouReceived' user.stats.gp -= 10 diff --git a/common/script/index.coffee b/common/script/index.coffee index 688fa7067e..509c0c809e 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -1168,7 +1168,8 @@ api.wrap = (user, main=true) -> user.stats.mp++ if stat is 'int' #increase their MP along with their max MP cb? null, _.pick(user,$w 'stats') - readCard: (cardType, cb) -> + readCard: (req, cb) -> + {cardType} = req.params user.items.special["#{cardType}Received"].shift() user.markModified? "items.special.#{cardType}Received" user.flags.cardReceived = false diff --git a/website/public/js/controllers/menuCtrl.js b/website/public/js/controllers/menuCtrl.js index babb9ba71b..f9f8f9e69c 100644 --- a/website/public/js/controllers/menuCtrl.js +++ b/website/public/js/controllers/menuCtrl.js @@ -31,10 +31,7 @@ angular.module('habitrpg') } $scope.clearMessages = Chat.seenMessage; - - $scope.clearCards = function() { - $scope.user.flags.cardReceived = false; - }; + $scope.clearCards = Chat.clearCards; $scope.iconClasses = function() { return selectNotificationValue( @@ -48,7 +45,7 @@ angular.module('habitrpg') }; $scope.hasNoNotifications = function() { - return selectNotificationValue(false, false, false, false, true); + return selectNotificationValue(false, false, false, false, false, true); } } ]); diff --git a/website/public/js/services/chatServices.js b/website/public/js/services/chatServices.js index 5980132c74..7fe2533506 100644 --- a/website/public/js/services/chatServices.js +++ b/website/public/js/services/chatServices.js @@ -15,14 +15,19 @@ function($resource, $http, ApiUrl, User) { var chatService = { seenMessage: seenMessage, + clearCards: clearCards, utils: utils }; return chatService; + function clearCards() { + User.user.ops.update && User.set({'flags.cardReceived':false}); + } + function seenMessage(gid) { // On enter, set chat message to "seen" $http.post(ApiUrl.get() + '/api/v2/groups/'+gid+'/chat/seen'); if (User.user.newMessages) delete User.user.newMessages[gid]; } -}]) +}]); diff --git a/website/views/options/inventory/drops.jade b/website/views/options/inventory/drops.jade index 77ea531011..26c2e0b5fc 100644 --- a/website/views/options/inventory/drops.jade +++ b/website/views/options/inventory/drops.jade @@ -200,7 +200,7 @@ p | 20  span.shop_gold - div(ng-repeat='type in Content.cardTypes') + div(ng-repeat='type in Content.cardTypes', ng-show='type.yearRound') button.customize-option(class='inventory_special_{{::type.key}}', popover='{{::Content.spells.special[type.key].notes()}}', popover-title='{{::Content.spells.special[type.key].text()}}', diff --git a/website/views/shared/modals/limited.jade b/website/views/shared/modals/limited.jade index d499e2894d..b993301ad3 100644 --- a/website/views/shared/modals/limited.jade +++ b/website/views/shared/modals/limited.jade @@ -9,4 +9,4 @@ script(id='modals/cards.html', type='text/ng-template') markdown(text='{{::cardMessage}}') .modal-footer small.pull-left {{::env.t(cardType + 'CardExplanation')}} - button.btn.btn-default(ng-click='user.ops.readCard(cardType); $close()')=env.t('ok') + button.btn.btn-default(ng-click='user.ops.readCard({params: {cardType: cardType}}); $close()')=env.t('ok') diff --git a/website/views/shared/new-stuff.jade b/website/views/shared/new-stuff.jade index 70809fb83a..ab6471d050 100644 --- a/website/views/shared/new-stuff.jade +++ b/website/views/shared/new-stuff.jade @@ -1,28 +1,38 @@ -h5 8/4/2015 - NEW ITEMS IN THE ENCHANTED ARMOIRE AND AUGUST BACKGROUNDS +h5 8/13/2015 - GOLD-PURCHASABLE CARDS hr tr td - .background_pyramids.pull-right - h5 August Backgrounds Revealed - p There are three new avatar backgrounds in the Background Shop! Now your avatar can admire the Pyramids, stalk across the Sunset Savannah, or dance under Twinkly Party Lights! - p.small.muted by (in order): minac1, Bambin, and rosiesully - tr - td - .promo_enchanted_armoire_201508.pull-right - h5 New Items in the Enchanted Armoire! - p There is new equipment in Enchanted Armoire, a 100 GP Reward in the Rewards Column which unlocks after you've attained Ultimate Gear! + .inventory_special_greeting.pull-right + .inventory_special_thankyou.pull-right + h5 Gold-Purchasable Cards + p There are two new types of Card available in the Market that you can send to the people in your Party: Greeting Cards and Thank-You Cards! Both cost 10 Gold, and will be available year-round. Sending or receiving these cards will give you some fun achievements! br - p Click on the Enchanted Armoire for a random chance at special Equipment, including the Golden Toga Item Set and the Horned Iron Item Set.! It may also give you random XP or food items. We'll be adding new equipment to it during the first week of each month, but even when you've exhausted the current supply, you can keep clicking for a chance at food and XP. - br - p Now go spend all that accumulated Gold! May the Random Number Generator smile upon you... - br - p.small.muted by Lemoness and SabreCat - p.small.muted Art by Kiwibot, Starsystemic, Podcod, and UncommonCriminal + p Enjoy! + p.small.muted by PainterProphet, Teto Is Great, Lemoness, and SabreCat hr a(href='/static/old-news', target='_blank') Read older news mixin oldNews + h5 8/4/2015 - NEW ITEMS IN THE ENCHANTED ARMOIRE AND AUGUST BACKGROUNDS + tr + td + .background_pyramids.pull-right + h5 August Backgrounds Revealed + p There are three new avatar backgrounds in the Background Shop! Now your avatar can admire the Pyramids, stalk across the Sunset Savannah, or dance under Twinkly Party Lights! + p.small.muted by (in order): minac1, Bambin, and rosiesully + tr + td + .promo_enchanted_armoire_201508.pull-right + h5 New Items in the Enchanted Armoire! + p There is new equipment in Enchanted Armoire, a 100 GP Reward in the Rewards Column which unlocks after you've attained Ultimate Gear! + br + p Click on the Enchanted Armoire for a random chance at special Equipment, including the Golden Toga Item Set and the Horned Iron Item Set.! It may also give you random XP or food items. We'll be adding new equipment to it during the first week of each month, but even when you've exhausted the current supply, you can keep clicking for a chance at food and XP. + br + p Now go spend all that accumulated Gold! May the Random Number Generator smile upon you... + br + p.small.muted by Lemoness and SabreCat + p.small.muted Art by Kiwibot, Starsystemic, Podcod, and UncommonCriminal h5 8/2/2015 - AUGUST MYSTERY BOX! tr td