mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +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 -->
|
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||||
<div
|
<div
|
||||||
v-for="item in group"
|
v-for="item in group"
|
||||||
|
v-show="show('pet', item)"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
v-drag.drop.food="item.key"
|
v-drag.drop.food="item.key"
|
||||||
class="pet-group"
|
class="pet-group"
|
||||||
@@ -216,6 +217,7 @@
|
|||||||
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||||
<div
|
<div
|
||||||
v-for="item in group"
|
v-for="item in group"
|
||||||
|
v-show="show('mount', item)"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
class="pet-group"
|
class="pet-group"
|
||||||
>
|
>
|
||||||
@@ -225,6 +227,7 @@
|
|||||||
:popover-position="'top'"
|
:popover-position="'top'"
|
||||||
:show-popover="true"
|
:show-popover="true"
|
||||||
@click="selectMount(item)"
|
@click="selectMount(item)"
|
||||||
|
|
||||||
>
|
>
|
||||||
<span slot="popoverContent">
|
<span slot="popoverContent">
|
||||||
<h4 class="popover-content-title">{{ item.name }}</h4>
|
<h4 class="popover-content-title">{{ item.name }}</h4>
|
||||||
@@ -688,6 +691,11 @@ export default {
|
|||||||
setShowMore (key) {
|
setShowMore (key) {
|
||||||
this.$_openedItemRows_toggleByType(key, !this.$_openedItemRows_isToggled(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) {
|
getAnimalList (animalGroup, type) {
|
||||||
const { key } = animalGroup;
|
const { key } = animalGroup;
|
||||||
|
|
||||||
@@ -706,11 +714,14 @@ export default {
|
|||||||
const eggKey = specialKey.split('-')[0];
|
const eggKey = specialKey.split('-')[0];
|
||||||
const potionKey = specialKey.split('-')[1];
|
const potionKey = specialKey.split('-')[1];
|
||||||
|
|
||||||
|
const { canFind, text } = this.content[`${type}Info`][specialKey];
|
||||||
|
|
||||||
animals.push({
|
animals.push({
|
||||||
key: specialKey,
|
key: specialKey,
|
||||||
eggKey,
|
eggKey,
|
||||||
potionKey,
|
potionKey,
|
||||||
name: this.content[`${type}Info`][specialKey].text(),
|
name: text(),
|
||||||
|
canFind,
|
||||||
isOwned () {
|
isOwned () {
|
||||||
return isOwned(type, this, userItems);
|
return isOwned(type, this, userItems);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -81,6 +81,73 @@ const [premiumPets, premiumMounts] = constructSet('premium', dropEggs, premiumPo
|
|||||||
const [questPets, questMounts] = constructSet('quest', questEggs, dropPotions);
|
const [questPets, questMounts] = constructSet('quest', questEggs, dropPotions);
|
||||||
const wackyPets = constructPetOnlySet('wacky', dropEggs, wackyPotions);
|
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 = {
|
const specialPets = {
|
||||||
'Wolf-Veteran': 'veteranWolf',
|
'Wolf-Veteran': 'veteranWolf',
|
||||||
'Wolf-Cerberus': 'cerberusPup',
|
'Wolf-Cerberus': 'cerberusPup',
|
||||||
@@ -131,6 +198,7 @@ each(specialPets, (translationString, key) => {
|
|||||||
key,
|
key,
|
||||||
type: 'special',
|
type: 'special',
|
||||||
text: t(translationString),
|
text: t(translationString),
|
||||||
|
canFind: canFindSpecial.pets[key],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -139,6 +207,7 @@ each(specialMounts, (translationString, key) => {
|
|||||||
key,
|
key,
|
||||||
type: 'special',
|
type: 'special',
|
||||||
text: t(translationString),
|
text: t(translationString),
|
||||||
|
canFind: canFindSpecial.mounts[key],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user