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:
Frank Maximus
2020-05-31 22:08:18 +02:00
committed by GitHub
parent 1c00d7de5b
commit 6ff8254137
2 changed files with 81 additions and 1 deletions
@@ -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);
},