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

@@ -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);