mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
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:
@@ -64,6 +64,10 @@
|
||||
"earnedCompanion": "With all your productivity, you've earned a new companion. Feed it to make it grow!",
|
||||
"feedPet": "Feed <%= article %><%= text %> to your <%= name %>?",
|
||||
"useSaddle": "Saddle <%= pet %>?",
|
||||
"raisedPet": "You grew a <%= pet %>!",
|
||||
"earnedSteed": "By completing your tasks, you've earned a faithful steed!",
|
||||
"rideNow": "Ride Now",
|
||||
"rideLater": "Ride Later",
|
||||
"petName": "<%= potion %> <%= egg %>",
|
||||
"mountName": "<%= potion %> <%= mount %>",
|
||||
"petKeyName": "Key to the Kennels",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -16,6 +16,7 @@ include ./welcome.jade
|
||||
include ./low-health.jade
|
||||
include ./level-up.jade
|
||||
include ./hatch-pet.jade
|
||||
include ./raise-pet.jade
|
||||
|
||||
//- Settings
|
||||
script(type='text/ng-template', id='modals/change-day-start.html')
|
||||
|
||||
21
website/views/shared/modals/raise-pet.jade
Normal file
21
website/views/shared/modals/raise-pet.jade
Normal file
@@ -0,0 +1,21 @@
|
||||
include ../avatar/generated_avatar
|
||||
|
||||
script(type='text/ng-template', id='modals/raisePet.html')
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom: 0')=env.t('raisedPet',{pet:'{{::raisedPet.displayName}}'})
|
||||
.container-fluid
|
||||
.row(style='margin-bottom:1em', ng-controller='UserCtrl')
|
||||
.col-xs-1
|
||||
.col-xs-10
|
||||
.herobox(style='margin:0; padding-top: 0')
|
||||
.character-sprites(style='width:0; margin-top:.5em')
|
||||
span(class='Mount_Body_{{::raisedPet.spriteName}}')
|
||||
span
|
||||
+generatedAvatar
|
||||
span(class='Mount_Head_{{::raisedPet.spriteName}}')
|
||||
p=env.t('earnedSteed')
|
||||
.modal-footer(style='margin-top:0')
|
||||
button.btn.btn-primary(ng-click='chooseMount(raisedPet.egg, raisedPet.potion); $close()')=env.t('rideNow')
|
||||
button.btn.btn-default(ng-click='$close()')=env.t('rideLater')
|
||||
|
||||
Reference in New Issue
Block a user