mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
commit
f69abe4ca0
5 changed files with 65 additions and 5 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
.NPC-Daniel {background-position: -222px 0; width: 135px; height: 123px}
|
.NPC-Daniel {background-position: -222px 0; width: 135px; height: 123px}
|
||||||
.NPC-Justin {background-position: -357px 0; width: 84px; height: 119px}
|
.NPC-Justin {background-position: -357px 0; width: 84px; height: 119px}
|
||||||
.NPC-Justin-Head {background-position: -396px 0; width: 36px; height: 96px}
|
.NPC-Justin-Head {background-position: -396px 0; width: 36px; height: 96px}
|
||||||
.NPC-Matt {background-position: -441px 0; width: 198px; height: 144px}
|
.NPC-Matt {background-position: -441px 0; width: 100%; padding-left: 208px; padding-bottom: 20px;}
|
||||||
|
|
||||||
// Bailey
|
// Bailey
|
||||||
.NPC-Bailey
|
.NPC-Bailey
|
||||||
|
|
|
||||||
31
assets/js/controllers/petsCtrl.js
Normal file
31
assets/js/controllers/petsCtrl.js
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
habitrpg.controller("PetsCtrl", ['$scope', 'User',
|
||||||
|
function($scope, User) {
|
||||||
|
|
||||||
|
$scope.userPets = User.user.items.pets;
|
||||||
|
$scope.userCurrentPet = User.user.items.currentPet;
|
||||||
|
$scope.pets = window.habitrpgShared.items.items.pets;
|
||||||
|
$scope.hatchingPotions = window.habitrpgShared.items.items.hatchingPotions;
|
||||||
|
|
||||||
|
$scope.hasPet = function(name, potion){
|
||||||
|
if (!$scope.userPets) return false;
|
||||||
|
return _.contains($scope.userPets, name + '-' + potion) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.isCurrentPet = function(name, potion){
|
||||||
|
if (!$scope.userCurrentPet || !$scope.userPets) return false;
|
||||||
|
return $scope.userCurrentPet.str === (name + '-' + potion);
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.choosePet = function(name, potion){
|
||||||
|
if($scope.userCurrentPet && $scope.userCurrentPet.str === (name + '-' + potion)){
|
||||||
|
$scope.userCurrentPet = null;
|
||||||
|
}else{
|
||||||
|
var pet = _.find($scope.pets, {name: name});
|
||||||
|
pet.modifier = potion;
|
||||||
|
pet.str = name + '-' + potion;
|
||||||
|
$scope.userCurrentPet = pet;
|
||||||
|
}
|
||||||
|
User.set('items.currentPet', $scope.userCurrentPet);
|
||||||
|
}
|
||||||
|
|
||||||
|
}]);
|
||||||
|
|
@ -68,6 +68,7 @@ html
|
||||||
!= js('controllers/filtersCtrl')
|
!= js('controllers/filtersCtrl')
|
||||||
!= js('controllers/userAvatarCtrl')
|
!= js('controllers/userAvatarCtrl')
|
||||||
!= js('controllers/groupsCtrl')
|
!= js('controllers/groupsCtrl')
|
||||||
|
!= js('controllers/petsCtrl')
|
||||||
!= js('controllers/footerCtrl')
|
!= js('controllers/footerCtrl')
|
||||||
|
|
||||||
//webfonts
|
//webfonts
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,7 @@
|
||||||
//app:game-pane:market
|
//app:game-pane:market
|
||||||
|
|
||||||
.tab-pane#stable-tab
|
.tab-pane#stable-tab
|
||||||
h4.well
|
include ./pets
|
||||||
| Coming soon.
|
|
||||||
a(href='https://github.com/lefnire/habitrpg/wiki/Contributing#website', target='blank') Help us port this feature!
|
|
||||||
//app:pets:stable
|
|
||||||
|
|
||||||
.tab-pane#tavern-tab
|
.tab-pane#tavern-tab
|
||||||
include ./groups/tavern
|
include ./groups/tavern
|
||||||
|
|
|
||||||
31
views/options/pets.jade
Normal file
31
views/options/pets.jade
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
.stable(ng-controller='PetsCtrl')
|
||||||
|
.NPC-Matt
|
||||||
|
.popover.static-popover.fade.right.in(style='max-width: 550px; margin-left: 10px;')
|
||||||
|
.arrow
|
||||||
|
h3.popover-title Matt Boch
|
||||||
|
.popover-content
|
||||||
|
p
|
||||||
|
| Welcome to the Stable! I'm
|
||||||
|
a(target='_blank', href='http://www.kickstarter.com/profile/mattboch') Matt
|
||||||
|
| , the beast master. Choose a pet here to adventure at your side - they aren't much help yet, but I forsee a time when they're able to
|
||||||
|
a(href='https://trello.com/card/mounts/50e5d3684fe3a7266b0036d6/221') grow into powerful steeds
|
||||||
|
| ! Until that day,
|
||||||
|
a(target='_blank', href='https://f.cloud.github.com/assets/2374703/164631/3ed5fa6c-78cd-11e2-8743-f65ac477b55e.png') have a look-see
|
||||||
|
| at all the pets you can collect.
|
||||||
|
h4 {{userPets.length}} / 90 Pets Found
|
||||||
|
|
||||||
|
table.pets(ng-repeat='pet in pets')
|
||||||
|
tbody
|
||||||
|
tr
|
||||||
|
td(ng-repeat='potion in hatchingPotions')
|
||||||
|
button(class="pet-button Pet-{{pet.name}}-{{potion.name}}", ng-show='hasPet(pet.name, potion.name)', ng-class="{active: isCurrentPet(pet.name, potion.name)}", ng-click='choosePet(pet.name, potion.name)', tooltip='{{potion.name}} {{pet.name}}')
|
||||||
|
button(class="pet-button pet-not-owned", ng-hide='hasPet(pet.name, potion.name)')
|
||||||
|
img(src='/bower_components/habitrpg-shared/img/PixelPaw.png', tooltip='{{potion.name}} {{pet.name}}')
|
||||||
|
|
||||||
|
h4 Rare Pets
|
||||||
|
table
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
button(class="pet-button Pet-Wolf-Veteran", ng-show='hasPet("Wolf", "Veteran")', ng-class='{active: isCurrentPet("Wolf", "Veteran")}', ng-click='choosePet("Wolf", "Veteran")', tooltip='Veteran Wolf')
|
||||||
|
button(class="pet-button pet-not-owned", ng-hide='hasPet("Wolf", "Veteran")')
|
||||||
|
img(src='/bower_components/habitrpg-shared/img/PixelPaw.png')
|
||||||
Loading…
Reference in a new issue