mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
* reposition FlyingPigs and Hydra * hide count-badge if 0 * fix sortBy hatchable (ignore already hatched pets) * always show animal name * featuredItems, use shopItem objects * fix egg / potion names in market * buyModals: check for price, mark it if not enough available / change buy-button opacity / show purchaseGems button * save itemRows open/collapsed state during session, refactor itemRows for some more performance * pin featured items * show bordered items in market buyModal * fix popover margins / paddings * position pinned items popovers to the left
26 lines
593 B
JavaScript
26 lines
593 B
JavaScript
import { mapState, mapGetters } from 'client/libs/store';
|
|
|
|
export default {
|
|
computed: {
|
|
...mapGetters({
|
|
userGems: 'user:gems',
|
|
}),
|
|
...mapState({
|
|
userHourglasses: 'user.data.purchased.plan.consecutive.trinkets',
|
|
userGold: 'user.data.stats.gp',
|
|
}),
|
|
},
|
|
methods: {
|
|
enoughCurrency (currency, amount) {
|
|
switch (currency) {
|
|
case 'gold':
|
|
return this.userGold >= amount;
|
|
case 'gems':
|
|
return this.userGems >= amount;
|
|
case 'hourglasses':
|
|
return this.userHourglasses >= amount;
|
|
}
|
|
},
|
|
},
|
|
};
|