feat(modals): Grew Mount

A modal now appears when you raise a pet into a mount, which allows the user to immediately equip the new mount.
This commit is contained in:
Sabe Jones
2015-10-15 17:33:20 -04:00
parent c6dd2a0d10
commit 338aced208
4 changed files with 33 additions and 2 deletions

View File

@@ -144,8 +144,9 @@ habitrpg.controller("InventoryCtrl",
// Feeding Pet
if ($scope.selectedFood) {
var food = $scope.selectedFood
if (food.key == 'Saddle') {
var food = $scope.selectedFood;
var startingMounts = $scope.mountCount;
if (food.key === 'Saddle') {
if (!$window.confirm(window.env.t('useSaddle', {pet: petDisplayName}))) return;
} else if (!$window.confirm(window.env.t('feedPet', {name: petDisplayName, article: food.article, text: food.text()}))) {
return;
@@ -154,6 +155,10 @@ habitrpg.controller("InventoryCtrl",
$scope.selectedFood = null;
_updateDropAnimalCount(user.items);
if ($scope.mountCount > startingMounts) {
$rootScope.raisedPet = {displayName: petDisplayName, spriteName: pet, egg: egg, potion: potion}
$rootScope.openModal('raisePet', {controller:'InventoryCtrl',size:'sm'});
}
// Checks if mountmaster has been reached for the first time
if(!user.achievements.mountMaster