feat(hourglass): Confirm before buy

This commit is contained in:
Sabe Jones
2015-09-16 17:40:25 -04:00
parent fb50f27fa7
commit eb0dd636c1
3 changed files with 10 additions and 3 deletions

View File

@@ -61,13 +61,14 @@
"timeTravelersTitle": "Mysterious Time Travelers",
"timeTravelersPopoverNoSub": "You'll need a Mystic Hourglass to summon the mysterious Time Travelers! <%= linkStart %>Subscribers<%= linkEnd %> earn one Mystic Hourglass for every three months of consecutive subscribing. Come back when you have a Mystic Hourglass, and the Time Travelers will fetch you a rare pet, mount, or Subscriber Item Set from the past... or maybe even the future.",
"timeTravelersPopover": "We see you have a Mystic Hourglass, so we will happily travel back in time for you! Please choose the pet, mount, or Mystery Item Set you would like. You can see a list of the past item sets <%= linkStart %>here<%= linkEnd %>! If those don't satisfy you, perhaps you'd be interested in one of our fashionably futuristic Steampunk Item Sets?",
"timeTravelersAlreadyOwned": "Congratulations! You already own all of the Mystery Items. Thanks for supporting the site!",
"timeTravelersAlreadyOwned": "Congratulations! You already own everything the Time Travelers currently offer. Thanks for supporting the site!",
"mysticHourglassPopover": "Mystic Hourglass allows you to purchase previous months' subscriber sets.",
"subUpdateCard": "Update Card",
"subUpdateTitle": "Update",
"subUpdateDescription": "Update the card to be charged.",
"notEnoughHourglasses": "You don't have enough Mystic Hourglasses.",
"hourglassBuyEquipSetConfirm": "Buy this full set of items for 1 Mystic Hourglass?",
"hourglassBuyItemConfirm": "Buy this item for 1 Mystic Hourglass?",
"petsAlreadyOwned": "Pet already owned.",
"mountsAlreadyOwned": "Mount already owned.",
"typeNotAllowedHourglass": "Item type not supported for purchase with Mystic Hourglass. Allowed types: ",

View File

@@ -272,6 +272,12 @@ habitrpg.controller("InventoryCtrl",
else return Console.log('Time Traveler item type must be in ["pets","mounts","mystery"]');
};
$scope.clickTimeTravelItem = function(type,key) {
if (user.purchased.plan.consecutive.trinkets < 1) return user.ops.hourglassPurchase({params:{type:type,key:key}});
if (!window.confirm(window.env.t('hourglassBuyItemConfirm'))) return;
user.ops.hourglassPurchase({params:{type:type,key:key}});
};
function _updateDropAnimalCount(items) {
$scope.petCount = Shared.count.beastMasterProgress(items.pets);
$scope.mountCount = Shared.count.mountMasterProgress(items.mounts);

View File

@@ -21,13 +21,13 @@
.col-md-12
li.customize-menu.inventory-gear
each prepend, type in {pets:'Pet-', mounts:'Mount_Head_'}
menu.pets-menu(label=env.t('#{type}'))
menu.pets-menu(label=env.t('#{type}'), ng-if='!hasAllTimeTravelerItemsOfType("#{type}")')
div(ng-repeat='(item, text) in Content.timeTravelStable["#{type}"]', style='margin-top:0')
button.pet-button(class='#{prepend}{{::item}}', style='margin-top:0',
ng-if='!user.items["#{type}"][item]',
popover='{{::text()}}', popover-trigger='mouseenter',
popover-placement='right', popover-append-to-body='true',
ng-click='user.ops.hourglassPurchase({params:{key:item,type:"#{type}"}})')
ng-click='clickTimeTravelItem("#{type}",item)')
li.customize-menu.inventory-gear
menu.pets-menu(label='{{::set.text}}', ng-repeat='set in Content.timeTravelerStore(user.items.gear.owned)')
div(ng-repeat='item in set.items')