Merge branch 'develop' into sabrecat/usernames-master
This commit is contained in:
@@ -207,7 +207,7 @@ import startQuestModal from '../../groups/startQuestModal';
|
||||
import QuestInfo from '../../shops/quests/questInfo.vue';
|
||||
|
||||
import { mapState } from 'client/libs/store';
|
||||
import createAnimal from 'client/libs/createAnimal';
|
||||
import { createAnimal } from 'client/libs/createAnimal';
|
||||
|
||||
import notifications from 'client/mixins/notifications';
|
||||
import DragDropDirective from 'client/directives/dragdrop.directive';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template lang="pug">
|
||||
b-modal#hatching-modal(@change="resetHatchablePet($event)")
|
||||
b-modal#hatching-modal()
|
||||
div.content(v-if="hatchablePet")
|
||||
div.potionEggGroup
|
||||
div.potionEggBackground
|
||||
@@ -73,12 +73,5 @@ export default {
|
||||
}),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
resetHatchablePet ($event) {
|
||||
if (!$event) {
|
||||
this.hatchablePet = null;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -86,27 +86,13 @@
|
||||
)
|
||||
petItem(
|
||||
:item="item",
|
||||
:itemContentClass="getPetItemClass(item)",
|
||||
:popoverPosition="'top'",
|
||||
:progress="item.progress",
|
||||
:emptyItem="!item.isOwned()",
|
||||
:showPopover="currentDraggingFood == null",
|
||||
:highlightBorder="highlightPet == item.key",
|
||||
@click="petClicked(item)"
|
||||
)
|
||||
span(slot="popoverContent")
|
||||
div.hatchablePopover(v-if="item.isHatchable()")
|
||||
h4.popover-content-title {{ item.name }}
|
||||
div.popover-content-text(v-html="$t('haveHatchablePet', { potion: item.potionName, egg: item.eggName })")
|
||||
div.potionEggGroup
|
||||
div.potionEggBackground
|
||||
div(:class="'Pet_HatchingPotion_'+item.potionKey")
|
||||
div.potionEggBackground
|
||||
div(:class="'Pet_Egg_'+item.eggKey")
|
||||
div(v-else)
|
||||
h4.popover-content-title {{ item.name }}
|
||||
template(slot="itemBadge", slot-scope="context")
|
||||
starBadge(:selected="item.key === currentPet", :show="item.isOwned()", @click="selectPet(item)")
|
||||
starBadge(:selected="item.key === currentPet", :show="isOwned('pet', item)", @click="selectPet(item)")
|
||||
|
||||
.btn.btn-flat.btn-show-more(@click="setShowMore(petGroup.key)", v-if='petGroup.key !== "specialPets"')
|
||||
| {{ $_openedItemRows_isToggled(petGroup.key) ? $t('showLess') : $t('showMore') }}
|
||||
@@ -126,10 +112,10 @@
|
||||
.pet-group(v-for='item in group')
|
||||
mountItem(
|
||||
:item="item",
|
||||
:itemContentClass="item.isOwned() ? ('Mount_Icon_' + item.key) : 'PixelPaw GreyedOut'",
|
||||
:itemContentClass="isOwned('mount', item) ? ('Mount_Icon_' + item.key) : 'PixelPaw GreyedOut'",
|
||||
:key="item.key",
|
||||
:popoverPosition="'top'",
|
||||
:emptyItem="!item.isOwned()",
|
||||
:emptyItem="!isOwned('mount', item)",
|
||||
:showPopover="true",
|
||||
@click="selectMount(item)"
|
||||
)
|
||||
@@ -138,7 +124,7 @@
|
||||
template(slot="itemBadge", slot-scope="context")
|
||||
starBadge(
|
||||
:selected="item.key === currentMount",
|
||||
:show="item.isOwned()",
|
||||
:show="isOwned('mount', item)",
|
||||
@click="selectMount(item)",
|
||||
)
|
||||
|
||||
@@ -335,7 +321,6 @@
|
||||
import _each from 'lodash/each';
|
||||
import _sortBy from 'lodash/sortBy';
|
||||
import _filter from 'lodash/filter';
|
||||
import _flatMap from 'lodash/flatMap';
|
||||
import _throttle from 'lodash/throttle';
|
||||
import groupBy from 'lodash/groupBy';
|
||||
|
||||
@@ -359,7 +344,7 @@
|
||||
import DragDropDirective from 'client/directives/dragdrop.directive';
|
||||
import MouseMoveDirective from 'client/directives/mouseposition.directive';
|
||||
|
||||
import createAnimal from 'client/libs/createAnimal';
|
||||
import { createAnimal } from 'client/libs/createAnimal';
|
||||
|
||||
import svgInformation from 'assets/svg/information.svg';
|
||||
|
||||
@@ -368,6 +353,7 @@
|
||||
import petMixin from 'client/mixins/petMixin';
|
||||
|
||||
import { CONSTANTS, setLocalSetting, getLocalSetting } from 'client/libs/userlocalManager';
|
||||
import {isOwned} from '../../../libs/createAnimal';
|
||||
|
||||
// TODO Normalize special pets and mounts
|
||||
// import Store from 'client/store';
|
||||
@@ -583,10 +569,10 @@
|
||||
potionKey,
|
||||
name: this.content[`${type}Info`][specialKey].text(),
|
||||
isOwned () {
|
||||
return userItems[`${type}s`][this.key] > 0;
|
||||
return isOwned(type, this, userItems);
|
||||
},
|
||||
mountOwned () {
|
||||
return userItems.mounts[this.key] > 0;
|
||||
return isOwned('mount', this, userItems);
|
||||
},
|
||||
isAllowedToFeed () {
|
||||
return type === 'pet' && this.isOwned() && !this.mountOwned();
|
||||
@@ -615,7 +601,6 @@
|
||||
listAnimals (animalGroup, type, hideMissing, sort, searchText) {
|
||||
let animals = this.getAnimalList(animalGroup, type);
|
||||
let isPetList = type === 'pet';
|
||||
let withProgress = isPetList && animalGroup.key !== 'specialPets';
|
||||
|
||||
// 1. Filter
|
||||
if (hideMissing) {
|
||||
@@ -652,18 +637,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
let animalRows = withProgress ? _flatMap(animals, (a) => {
|
||||
let progress = this.userItems[`${type}s`][a.key];
|
||||
|
||||
return {
|
||||
...a,
|
||||
progress,
|
||||
};
|
||||
}) : animals;
|
||||
|
||||
this.viewOptions[animalGroup.key].animalCount = animals.length;
|
||||
|
||||
return animalRows;
|
||||
return animals;
|
||||
},
|
||||
countOwnedAnimals (animalGroup, type) {
|
||||
let animals = this.getAnimalList(animalGroup, type);
|
||||
@@ -710,21 +686,6 @@
|
||||
|
||||
return groupBy(mounts, groupKey);
|
||||
},
|
||||
getPetItemClass (pet) {
|
||||
if (pet.isOwned()) {
|
||||
return `Pet Pet-${pet.key} ${pet.eggKey}`;
|
||||
}
|
||||
|
||||
if (pet.isHatchable()) {
|
||||
return 'PixelPaw';
|
||||
}
|
||||
|
||||
if (pet.mountOwned()) {
|
||||
return `GreyedOut Pet Pet-${pet.key} ${pet.eggKey}`;
|
||||
}
|
||||
|
||||
return 'GreyedOut PixelPaw';
|
||||
},
|
||||
hasDrawerTabItems (index) {
|
||||
return this.drawerTabs && this.drawerTabs[index].items.length !== 0;
|
||||
},
|
||||
@@ -767,6 +728,9 @@
|
||||
onDragLeave () {
|
||||
this.highlightPet = '';
|
||||
},
|
||||
isOwned (type, pet) {
|
||||
return isOwned(type, pet, this.userItems);
|
||||
},
|
||||
petClicked (pet) {
|
||||
if (this.currentDraggingFood !== null) {
|
||||
if (pet.isAllowedToFeed()) {
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
div
|
||||
.item-wrapper(@click="click()", :id="itemId")
|
||||
.item.pet-slot(
|
||||
:class="{'item-empty': emptyItem, 'highlight': highlightBorder}",
|
||||
:class="{'item-empty': !isOwned(), 'highlight': highlightBorder}",
|
||||
)
|
||||
slot(name="itemBadge", :item="item")
|
||||
span.item-content(:class="itemContentClass")
|
||||
span.pet-progress-background(v-if="item.isAllowedToFeed() && progress > 0")
|
||||
span.item-content.hatchAgain(v-if="mountOwned && isHatchable")
|
||||
span.egg(:class="eggClass")
|
||||
span.potion(:class="potionClass")
|
||||
span.item-content(v-else, :class="getPetItemClass()")
|
||||
span.pet-progress-background(v-if="isAllowedToFeed() && progress > 0")
|
||||
div.pet-progress-bar(v-bind:style="{width: 100 * progress/50 + '%' }")
|
||||
span.item-label(v-if="label") {{ label }}
|
||||
|
||||
@@ -15,7 +18,17 @@ div
|
||||
:triggers="showPopover ? 'hover' : ''",
|
||||
:placement="popoverPosition",
|
||||
)
|
||||
slot(name="popoverContent", :item="item")
|
||||
div.hatchablePopover(v-if="item.isHatchable()")
|
||||
h4.popover-content-title {{ item.name }}
|
||||
div.popover-content-text(v-html="$t('haveHatchablePet', { potion: item.potionName, egg: item.eggName })")
|
||||
div.potionEggGroup
|
||||
div.potionEggBackground
|
||||
div(:class="potionClass")
|
||||
div.potionEggBackground
|
||||
div(:class="eggClass")
|
||||
div(v-else)
|
||||
h4.popover-content-title {{ item.name }}
|
||||
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -32,30 +45,44 @@ div
|
||||
height: 4px;
|
||||
background-color: #24cc8f;
|
||||
}
|
||||
|
||||
.hatchAgain {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
width: 94px;
|
||||
height: 94px;
|
||||
|
||||
.egg {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 14px;
|
||||
z-index: 1;
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
.potion {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
top: 14px;
|
||||
transform: scale(1.2);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import uuid from 'uuid';
|
||||
import { mapState } from 'client/libs/store';
|
||||
import {isAllowedToFeed, isHatchable, isOwned} from '../../../libs/createAnimal';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
},
|
||||
itemContentClass: {
|
||||
type: String,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
},
|
||||
progress: {
|
||||
type: Number,
|
||||
default: -1,
|
||||
},
|
||||
emptyItem: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
highlightBorder: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@@ -78,6 +105,48 @@ div
|
||||
click () {
|
||||
this.$emit('click', {});
|
||||
},
|
||||
isOwned () {
|
||||
return isOwned('pet', this.item, this.userItems);
|
||||
},
|
||||
isAllowedToFeed () {
|
||||
return isAllowedToFeed(this.item, this.userItems);
|
||||
},
|
||||
getPetItemClass () {
|
||||
if (this.isOwned() || this.mountOwned && this.isHatchable) {
|
||||
return `Pet Pet-${this.item.key} ${this.item.eggKey}`;
|
||||
}
|
||||
|
||||
if (this.isHatchable) {
|
||||
return 'PixelPaw';
|
||||
}
|
||||
|
||||
if (this.mountOwned) {
|
||||
return `GreyedOut Pet Pet-${this.item.key} ${this.item.eggKey}`;
|
||||
}
|
||||
|
||||
// Can't hatch
|
||||
return 'GreyedOut PixelPaw';
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
userItems: 'user.data.items',
|
||||
}),
|
||||
potionClass () {
|
||||
return `Pet_HatchingPotion_${this.item.potionKey}`;
|
||||
},
|
||||
eggClass () {
|
||||
return `Pet_Egg_${this.item.eggKey}`;
|
||||
},
|
||||
isHatchable () {
|
||||
return isHatchable(this.item, this.userItems);
|
||||
},
|
||||
mountOwned () {
|
||||
return isOwned('mount', this.item, this.userItems);
|
||||
},
|
||||
progress () {
|
||||
return this.userItems.pets[this.item.key];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -62,6 +62,7 @@ export default {
|
||||
]),
|
||||
// list of email-only notifications
|
||||
onlyEmailsIds: Object.freeze([
|
||||
'kickedGroup',
|
||||
'importantAnnouncements',
|
||||
'weeklyRecaps',
|
||||
'onboarding',
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
.form
|
||||
h2(v-once) {{ $t('filter') }}
|
||||
.form-group
|
||||
.form-check(
|
||||
checkbox(
|
||||
v-for="category in filterCategories",
|
||||
:key="category.key",
|
||||
:id="`category-${category.key}`",
|
||||
:checked.sync="viewOptions[category.key].selected",
|
||||
:text="category.value"
|
||||
)
|
||||
.custom-control.custom-checkbox
|
||||
input.custom-control-input(type="checkbox", v-model="viewOptions[category.key].selected", :id="`category-${category.identifier}`")
|
||||
label.custom-control-label(v-once, :for="`category-${category.identifier}`") {{ category.value }}
|
||||
|
||||
div.form-group.clearfix
|
||||
h3.float-left(v-once) {{ $t('hidePinned') }}
|
||||
@@ -290,6 +290,7 @@
|
||||
import Item from 'client/components/inventory/item';
|
||||
import CountBadge from 'client/components/ui/countBadge';
|
||||
import ItemRows from 'client/components/ui/itemRows';
|
||||
import Checkbox from 'client/components/ui/checkbox';
|
||||
import toggleSwitch from 'client/components/ui/toggleSwitch';
|
||||
import Avatar from 'client/components/avatar';
|
||||
import buyMixin from 'client/mixins/buy';
|
||||
@@ -326,6 +327,7 @@
|
||||
CountBadge,
|
||||
ItemRows,
|
||||
toggleSwitch,
|
||||
Checkbox,
|
||||
|
||||
Avatar,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user