mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-01 23:40:25 +00:00
mounts: fix isUser class bringing user too far down. Fix initial drop bug. Remove items.currentPet if turned into mount
This commit is contained in:
parent
284114c056
commit
cd79649100
3 changed files with 11 additions and 4 deletions
|
|
@ -127,6 +127,8 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
|
||||||
if (!confirm('Saddle ' + pet + '?')) return;
|
if (!confirm('Saddle ' + pet + '?')) return;
|
||||||
userPets[pet] = 0;
|
userPets[pet] = 0;
|
||||||
setObj['items.mounts.' + pet] = true;
|
setObj['items.mounts.' + pet] = true;
|
||||||
|
if (pet == user.items.currentPet)
|
||||||
|
setObj['items.currentPet'] = '';
|
||||||
Notification.text('You have tamed '+egg+", let's go for a ride!");
|
Notification.text('You have tamed '+egg+", let's go for a ride!");
|
||||||
} else {
|
} else {
|
||||||
if (userPets[pet] >= 150)
|
if (userPets[pet] >= 150)
|
||||||
|
|
@ -149,7 +151,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
|
||||||
} else {
|
} else {
|
||||||
var userCurrentPet = User.user.items.currentPet;
|
var userCurrentPet = User.user.items.currentPet;
|
||||||
if(userCurrentPet && userCurrentPet == pet){
|
if(userCurrentPet && userCurrentPet == pet){
|
||||||
User.user.items.currentPet = null;
|
User.user.items.currentPet = '';
|
||||||
}else{
|
}else{
|
||||||
User.user.items.currentPet = pet;
|
User.user.items.currentPet = pet;
|
||||||
}
|
}
|
||||||
|
|
@ -159,7 +161,7 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
|
||||||
|
|
||||||
$scope.chooseMount = function(egg, potion) {
|
$scope.chooseMount = function(egg, potion) {
|
||||||
var mount = egg + '-' + potion;
|
var mount = egg + '-' + potion;
|
||||||
User.set('items.currentMount', (user.items.currentMount == mount) ? null : mount);
|
User.set('items.currentMount', (user.items.currentMount == mount) ? '' : mount);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ angular.module('guideServices', []).
|
||||||
$rootScope.$watch('user.flags.dropsEnabled', function(after, before) {
|
$rootScope.$watch('user.flags.dropsEnabled', function(after, before) {
|
||||||
if (alreadyShown(before, after)) return;
|
if (alreadyShown(before, after)) return;
|
||||||
var eggs = User.user.items.eggs || {};
|
var eggs = User.user.items.eggs || {};
|
||||||
eggs['Wolf-Base'] = 5; // This is also set on the server
|
eggs['Wolf'] = 1; // This is also set on the server
|
||||||
$rootScope.modals.dropsEnabled = true;
|
$rootScope.modals.dropsEnabled = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
figure.herobox(ng-click='clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: profile.id==user.id, hasPet: profile.items.currentPet}', data-level='{{profile.stats.lvl}}', data-uid='{{profile.id}}', rel='popover', data-placement='bottom', data-trigger='hover', data-html='true', data-content="<div ng-hide='profile.id == user.id'> <div class='progress progress-danger' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.hp, 50)}}%;'></div> </div> <div class='progress progress-warning' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.exp, tnl(profile.stats.lvl))}}%;'></div> </div> <div>Level: {{profile.stats.lvl}}</div> <div>GP: {{profile.stats.gp | number:0}}</div> <div>{{count(profile.items.pets)}} / 90 Pets Found</div> </div>")
|
//- FIXME the commented-out figure.herobox used to have a functioning popover, but angular-ui-bootstrap doesn't support
|
||||||
|
html in popovers. Figure out what to do here. Also, {isUser:..} class seems to bring the user too far down with mounts.
|
||||||
|
Removing it will remove the user's name, but will allow more room for mounts & helms. IMO this is the lesser of two evils, revisit
|
||||||
|
//-figure.herobox(ng-click='clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: profile.id==user.id, hasPet: profile.items.currentPet}', data-level='{{profile.stats.lvl}}', data-uid='{{profile.id}}', rel='popover', data-placement='bottom', data-trigger='hover', data-html='true', data-content="<div ng-hide='profile.id == user.id'> <div class='progress progress-danger' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.hp, 50)}}%;'></div> </div> <div class='progress progress-warning' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.exp, tnl(profile.stats.lvl))}}%;'></div> </div> <div>Level: {{profile.stats.lvl}}</div> <div>GP: {{profile.stats.gp | number:0}}</div> <div>{{count(profile.items.pets)}} / 90 Pets Found</div> </div>")
|
||||||
|
|
||||||
|
figure.herobox(ng-click='clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: user._id==profile._id && !(user.items.currentMount && user.items.currentPet), hasPet: profile.items.currentPet && profile.items.currentMount}')
|
||||||
.character-sprites
|
.character-sprites
|
||||||
// Mount Body
|
// Mount Body
|
||||||
span(class='Mount_Body_{{profile.items.currentMount}}')
|
span(class='Mount_Body_{{profile.items.currentMount}}')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue