mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Only show attainable and owned special pets/mounts (#12206)
* Only show attainable and owned special pets/mounts Fixes #9498 * #9498: Handle comments Don't change API, put canFind in petInfo and mountInfo * #9498: Move canFind to itemInfo, to allow sync * #9498: Create a show method, to allow update without reload.
This commit is contained in:
@@ -154,6 +154,7 @@
|
||||
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||
<div
|
||||
v-for="item in group"
|
||||
v-show="show('pet', item)"
|
||||
:key="item.key"
|
||||
v-drag.drop.food="item.key"
|
||||
class="pet-group"
|
||||
@@ -216,6 +217,7 @@
|
||||
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||
<div
|
||||
v-for="item in group"
|
||||
v-show="show('mount', item)"
|
||||
:key="item.key"
|
||||
class="pet-group"
|
||||
>
|
||||
@@ -225,6 +227,7 @@
|
||||
:popover-position="'top'"
|
||||
:show-popover="true"
|
||||
@click="selectMount(item)"
|
||||
|
||||
>
|
||||
<span slot="popoverContent">
|
||||
<h4 class="popover-content-title">{{ item.name }}</h4>
|
||||
@@ -688,6 +691,11 @@ export default {
|
||||
setShowMore (key) {
|
||||
this.$_openedItemRows_toggleByType(key, !this.$_openedItemRows_isToggled(key));
|
||||
},
|
||||
show (type, item) {
|
||||
return item.canFind === undefined
|
||||
|| isOwned(type, item, this.userItems)
|
||||
|| item.canFind;
|
||||
},
|
||||
getAnimalList (animalGroup, type) {
|
||||
const { key } = animalGroup;
|
||||
|
||||
@@ -706,11 +714,14 @@ export default {
|
||||
const eggKey = specialKey.split('-')[0];
|
||||
const potionKey = specialKey.split('-')[1];
|
||||
|
||||
const { canFind, text } = this.content[`${type}Info`][specialKey];
|
||||
|
||||
animals.push({
|
||||
key: specialKey,
|
||||
eggKey,
|
||||
potionKey,
|
||||
name: this.content[`${type}Info`][specialKey].text(),
|
||||
name: text(),
|
||||
canFind,
|
||||
isOwned () {
|
||||
return isOwned(type, this, userItems);
|
||||
},
|
||||
|
||||
@@ -81,6 +81,73 @@ const [premiumPets, premiumMounts] = constructSet('premium', dropEggs, premiumPo
|
||||
const [questPets, questMounts] = constructSet('quest', questEggs, dropPotions);
|
||||
const wackyPets = constructPetOnlySet('wacky', dropEggs, wackyPotions);
|
||||
|
||||
const canFindSpecial = {
|
||||
pets: {
|
||||
// Veteran Pet Ladder - verifyUserName
|
||||
'Wolf-Veteran': true,
|
||||
'Tiger-Veteran': false,
|
||||
'Lion-Veteran': false,
|
||||
'Bear-Veteran': false,
|
||||
'Fox-Veteran': false,
|
||||
|
||||
// Thanksgiving pet ladder
|
||||
'Turkey-Base': false,
|
||||
'Turkey-Gilded': false,
|
||||
// Habitoween pet ladder
|
||||
'JackOLantern-Base': false,
|
||||
'JackOLantern-Glow': false,
|
||||
'JackOLantern-Ghost': false,
|
||||
// Naming Day
|
||||
'Gryphon-RoyalPurple': false,
|
||||
// Summer Splash Orca
|
||||
'Orca-Base': false,
|
||||
|
||||
// Quest pets
|
||||
'BearCub-Polar': true, // evilsanta
|
||||
// World Quest Pets - Found in Time Travel Stable
|
||||
'MantisShrimp-Base': true, // dilatory
|
||||
'Mammoth-Base': true, // stressbeast
|
||||
'Phoenix-Base': true, // burnout
|
||||
'MagicalBee-Base': true, // bewilder
|
||||
'Hippogriff-Hopeful': true, // dysheartener
|
||||
|
||||
// Contributor/Backer pets
|
||||
'Dragon-Hydra': true, // Contributor level 6
|
||||
'Jackalope-RoyalPurple': true, // subscription
|
||||
'Wolf-Cerberus': false, // Pet once granted to backers
|
||||
'Gryphon-Gryphatrice': false, // Pet once granted to kickstarter
|
||||
},
|
||||
mounts: {
|
||||
// Thanksgiving pet ladder
|
||||
'Turkey-Base': false,
|
||||
'Turkey-Gilded': false,
|
||||
|
||||
// Habitoween pet ladder
|
||||
'JackOLantern-Base': false,
|
||||
'JackOLantern-Glow': false,
|
||||
'JackOLantern-Ghost': false,
|
||||
// Naming Day
|
||||
'Gryphon-RoyalPurple': false,
|
||||
// Summer Splash Orca
|
||||
'Orca-Base': false,
|
||||
|
||||
// Quest mounts
|
||||
'BearCub-Polar': true, // evilsanta
|
||||
'Aether-Invisible': true, // lostMasterclasser4
|
||||
// World Quest Pets - Found in Time Travel
|
||||
'MantisShrimp-Base': true, // dilatory
|
||||
'Mammoth-Base': true, // stressbeast
|
||||
'Phoenix-Base': true, // burnout
|
||||
'MagicalBee-Base': true,
|
||||
'Hippogriff-Hopeful': true,
|
||||
|
||||
// Contributor/Backer pets
|
||||
'LionCub-Ethereal': true, // Backer tier 90
|
||||
'Jackalope-RoyalPurple': true, // subscription
|
||||
'Gryphon-Gryphatrice': false, // Pet once granted to kickstarter
|
||||
},
|
||||
};
|
||||
|
||||
const specialPets = {
|
||||
'Wolf-Veteran': 'veteranWolf',
|
||||
'Wolf-Cerberus': 'cerberusPup',
|
||||
@@ -131,6 +198,7 @@ each(specialPets, (translationString, key) => {
|
||||
key,
|
||||
type: 'special',
|
||||
text: t(translationString),
|
||||
canFind: canFindSpecial.pets[key],
|
||||
};
|
||||
});
|
||||
|
||||
@@ -139,6 +207,7 @@ each(specialMounts, (translationString, key) => {
|
||||
key,
|
||||
type: 'special',
|
||||
text: t(translationString),
|
||||
canFind: canFindSpecial.mounts[key],
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user