misc fixes - sep 17 (#9045)

* not locking pre-owned gear - pin removed gear on revive

* fix createAnimal (check for function) - hide pet-popover while dragging food

* fix dragging popover text color

* fix drop toasts

* selectMembersModal: load members on item change
This commit is contained in:
negue
2017-09-19 22:45:28 +02:00
committed by GitHub
parent b1652ddd97
commit 2cb9228a7c
9 changed files with 68 additions and 29 deletions
@@ -171,6 +171,10 @@
position: inherit;
width: 180px;
}
.popover-content {
color: white;
}
}
</style>
@@ -99,7 +99,7 @@
:popoverPosition="'top'",
:progress="context.item.progress",
:emptyItem="!context.item.isOwned()",
:showPopover="true",
:showPopover="currentDraggingFood == null",
:highlightBorder="highlightPet == context.item.key",
@click="petClicked(context.item)"
)
@@ -453,6 +453,10 @@
position: inherit;
width: 100px;
}
.popover-content {
color: white;
}
}
.hatchablePopover {
@@ -909,11 +913,13 @@
},
petClicked (pet) {
if (this.currentDraggingFood !== null && pet.isAllowedToFeed()) {
// food process
this.feedAction(pet.key, this.currentDraggingFood.key);
this.currentDraggingFood = null;
this.foodClickMode = false;
if (this.currentDraggingFood !== null) {
if (pet.isAllowedToFeed()) {
// food process
this.feedAction(pet.key, this.currentDraggingFood.key);
this.currentDraggingFood = null;
this.foodClickMode = false;
}
} else {
if (pet.isOwned()) {
this.selectPet(pet);
@@ -11,9 +11,8 @@ div
span.item-label(v-if="label") {{ label }}
b-popover(
v-if="showPopover",
:target="itemId",
triggers="hover",
:triggers="showPopover ? 'hover' : ''",
:placement="popoverPosition",
)
slot(name="popoverContent", :item="item")
@@ -161,7 +161,7 @@ export default {
},
},
watch: {
groupId () {
item () {
this.getMembers();
},
},
+11 -7
View File
@@ -459,7 +459,8 @@ export default {
}
if (drop) {
let text;
let dropText;
let dropNotes;
let type;
this.$root.$emit('playSound', 'Item_Drop');
@@ -483,14 +484,17 @@ export default {
}
if (drop.type === 'HatchingPotion') {
text = Content.hatchingPotions[drop.key].text();
this.drop(this.$t('messageDropPotion', {dropText: text}), drop);
dropText = Content.hatchingPotions[drop.key].text();
dropNotes = Content.hatchingPotions[drop.key].notes();
this.drop(this.$t('messageDropPotion', {dropText, dropNotes}), drop);
} else if (drop.type === 'Egg') {
text = Content.eggs[drop.key].text();
this.drop(this.$t('messageDropEgg', {dropText: text}), drop);
dropText = Content.eggs[drop.key].text();
dropNotes = Content.eggs[drop.key].notes();
this.drop(this.$t('messageDropEgg', {dropText, dropNotes}), drop);
} else if (drop.type === 'Food') {
text = Content.food[drop.key].text();
this.drop(this.$t('messageDropFood', {dropArticle: drop.article, dropText: text}), drop);
dropText = Content.food[drop.key].text();
dropNotes = Content.food[drop.key].notes();
this.drop(this.$t('messageDropFood', {dropArticle: drop.article, dropText, dropNotes}), drop);
} else if (drop.type === 'Quest') {
// TODO $rootScope.selectedQuest = Content.quests[drop.key];
// $rootScope.openModal('questDrop', {controller:'PartyCtrl', size:'sm'});
+12 -2
View File
@@ -1,3 +1,13 @@
function getText (textOrFunction) {
if (textOrFunction instanceof Function) {
return textOrFunction();
} else {
return textOrFunction;
}
}
export default function createAnimal (egg, potion, type, content, userItems) {
let animalKey = `${egg.key}-${potion.key}`;
@@ -5,9 +15,9 @@ export default function createAnimal (egg, potion, type, content, userItems) {
key: animalKey,
class: type === 'pet' ? `Pet Pet-${animalKey}` : `Mount_Icon_${animalKey}`,
eggKey: egg.key,
eggName: egg.text,
eggName: getText(egg.text),
potionKey: potion.key,
potionName: potion.text,
potionName: getText(potion.text),
name: content[`${type}Info`][animalKey].text(),
isOwned () {
return userItems[`${type}s`][animalKey] > 0;