mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user