mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
multiple fixes sep 24 (#9073)
* pin purchase-gems + orb of rebirth * show questInfo in items inventory and reward column * un-equip gear using the star / clicking on the drawer
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
)
|
)
|
||||||
.popover-content-text {{ $t(drawerPreference+'PopoverText') }}
|
.popover-content-text {{ $t(drawerPreference+'PopoverText') }}
|
||||||
.items.items-one-line(slot="drawer-slider")
|
.items.items-one-line(slot="drawer-slider")
|
||||||
item(
|
item.pointer(
|
||||||
v-for="(label, group) in gearTypesToStrings",
|
v-for="(label, group) in gearTypesToStrings",
|
||||||
:key="group",
|
:key="group",
|
||||||
:item="flatGear[activeItems[group]]",
|
:item="flatGear[activeItems[group]]",
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
:emptyItem="!flatGear[activeItems[group]] || flatGear[activeItems[group]].key.indexOf('_base_0') !== -1",
|
:emptyItem="!flatGear[activeItems[group]] || flatGear[activeItems[group]].key.indexOf('_base_0') !== -1",
|
||||||
:label="label",
|
:label="label",
|
||||||
:popoverPosition="'top'",
|
:popoverPosition="'top'",
|
||||||
|
@click="equipItem(flatGear[activeItems[group]])",
|
||||||
)
|
)
|
||||||
template(slot="popoverContent", scope="context")
|
template(slot="popoverContent", scope="context")
|
||||||
equipmentAttributesPopover(:item="context.item")
|
equipmentAttributesPopover(:item="context.item")
|
||||||
@@ -113,7 +114,7 @@
|
|||||||
starBadge(
|
starBadge(
|
||||||
:selected="activeItems[context.item.type] === context.item.key",
|
:selected="activeItems[context.item.type] === context.item.key",
|
||||||
:show="!costume || user.preferences.costume",
|
:show="!costume || user.preferences.costume",
|
||||||
@click="openEquipDialog(context.item)",
|
@click="equipItem(context.item)",
|
||||||
)
|
)
|
||||||
template(slot="popoverContent", scope="context")
|
template(slot="popoverContent", scope="context")
|
||||||
equipmentAttributesPopover(:item="context.item")
|
equipmentAttributesPopover(:item="context.item")
|
||||||
@@ -127,6 +128,12 @@
|
|||||||
)
|
)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.pointer {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'client/libs/store';
|
import { mapState } from 'client/libs/store';
|
||||||
import each from 'lodash/each';
|
import each from 'lodash/each';
|
||||||
|
|||||||
@@ -114,8 +114,13 @@
|
|||||||
@click="itemClicked(group.key, context.item)",
|
@click="itemClicked(group.key, context.item)",
|
||||||
)
|
)
|
||||||
template(slot="popoverContent", scope="context")
|
template(slot="popoverContent", scope="context")
|
||||||
h4.popover-content-title {{ context.item.text }}
|
div.questPopover(v-if="group.key === 'quests'")
|
||||||
.popover-content-text(v-html="context.item.notes")
|
h4.popover-content-title {{ context.item.text }}
|
||||||
|
questInfo(:quest="context.item")
|
||||||
|
|
||||||
|
div(v-else)
|
||||||
|
h4.popover-content-title {{ context.item.text }}
|
||||||
|
.popover-content-text(v-html="context.item.notes")
|
||||||
template(slot="itemBadge", scope="context")
|
template(slot="itemBadge", scope="context")
|
||||||
countBadge(
|
countBadge(
|
||||||
:show="true",
|
:show="true",
|
||||||
@@ -191,6 +196,8 @@ import startQuestModal from '../../groups/startQuestModal';
|
|||||||
|
|
||||||
import createAnimal from 'client/libs/createAnimal';
|
import createAnimal from 'client/libs/createAnimal';
|
||||||
|
|
||||||
|
import QuestInfo from '../../shops/quests/questInfo.vue';
|
||||||
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
const allowedSpecialItems = ['snowball', 'spookySparkles', 'shinySeed', 'seafoam'];
|
const allowedSpecialItems = ['snowball', 'spookySparkles', 'shinySeed', 'seafoam'];
|
||||||
@@ -228,6 +235,7 @@ export default {
|
|||||||
CountBadge,
|
CountBadge,
|
||||||
startQuestModal,
|
startQuestModal,
|
||||||
cardsModal,
|
cardsModal,
|
||||||
|
QuestInfo,
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
drag: DragDropDirective,
|
drag: DragDropDirective,
|
||||||
|
|||||||
@@ -150,9 +150,6 @@
|
|||||||
span(slot="popoverContent")
|
span(slot="popoverContent")
|
||||||
h4.popover-content-title {{ item.text }}
|
h4.popover-content-title {{ item.text }}
|
||||||
|
|
||||||
template(slot="itemImage", scope="scope")
|
|
||||||
span.svg-icon.inline.icon-48(v-if="scope.item.key == 'gem'", v-html="icons.gem")
|
|
||||||
|
|
||||||
template(slot="itemBadge", scope="ctx")
|
template(slot="itemBadge", scope="ctx")
|
||||||
countBadge(
|
countBadge(
|
||||||
v-if="item.showCount != false",
|
v-if="item.showCount != false",
|
||||||
@@ -491,29 +488,20 @@ export default {
|
|||||||
let specialItems = [];
|
let specialItems = [];
|
||||||
|
|
||||||
if (this.user.purchased.plan.customerId) {
|
if (this.user.purchased.plan.customerId) {
|
||||||
|
let gemItem = getItemInfo(this.user, 'gem');
|
||||||
|
|
||||||
specialItems.push({
|
specialItems.push({
|
||||||
|
...gemItem,
|
||||||
showCount: false,
|
showCount: false,
|
||||||
key: 'gem',
|
|
||||||
class: 'gem',
|
|
||||||
pinKey: 'gems',
|
|
||||||
purchaseType: 'gems',
|
|
||||||
text: this.$t('subGemName'),
|
|
||||||
notes: this.$t('subGemPop'),
|
|
||||||
currency: 'gold',
|
|
||||||
value: 20,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.user.flags.rebirthEnabled) {
|
if (this.user.flags.rebirthEnabled) {
|
||||||
|
let rebirthItem = getItemInfo(this.user, 'rebirth_orb');
|
||||||
|
|
||||||
specialItems.push({
|
specialItems.push({
|
||||||
showCount: false,
|
showCount: false,
|
||||||
key: 'rebirth_orb',
|
...rebirthItem,
|
||||||
class: 'rebirth_orb',
|
|
||||||
purchaseType: 'rebirth_orb',
|
|
||||||
text: this.$t('rebirthName'),
|
|
||||||
notes: this.$t('rebirthPop'),
|
|
||||||
currency: 'gems',
|
|
||||||
value: this.user.stats.lvl < 100 ? 6 : 0,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ div
|
|||||||
div.image
|
div.image
|
||||||
div(:class="item.class", v-once)
|
div(:class="item.class", v-once)
|
||||||
slot(name="itemImage", :item="item")
|
slot(name="itemImage", :item="item")
|
||||||
|
span.svg-icon.inline.icon-48(v-if="item.key == 'gem'", v-html="icons.gems")
|
||||||
|
|
||||||
|
|
||||||
div.price
|
div.price
|
||||||
span.svg-icon.inline.icon-16(v-html="icons[currencyClass]")
|
span.svg-icon.inline.icon-16(v-html="icons[currencyClass]")
|
||||||
@@ -33,6 +35,9 @@ div
|
|||||||
v-if="item.purchaseType==='gear'",
|
v-if="item.purchaseType==='gear'",
|
||||||
:item="item"
|
:item="item"
|
||||||
)
|
)
|
||||||
|
div.questPopover(v-else-if="item.purchaseType === 'quests'")
|
||||||
|
h4.popover-content-title {{ item.text }}
|
||||||
|
questInfo(:quest="item")
|
||||||
div(v-else)
|
div(v-else)
|
||||||
h4.popover-content-title(v-once) {{ item.text }}
|
h4.popover-content-title(v-once) {{ item.text }}
|
||||||
.popover-content-text(v-if="showNotes", v-once) {{ item.notes }}
|
.popover-content-text(v-if="showNotes", v-once) {{ item.notes }}
|
||||||
@@ -142,6 +147,11 @@ div
|
|||||||
top: 8px;
|
top: 8px;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-48 {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -156,6 +166,8 @@ div
|
|||||||
|
|
||||||
import EquipmentAttributesPopover from 'client/components/inventory/equipment/attributesPopover';
|
import EquipmentAttributesPopover from 'client/components/inventory/equipment/attributesPopover';
|
||||||
|
|
||||||
|
import QuestInfo from './quests/questInfo.vue';
|
||||||
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
import seasonalShopConfig from 'common/script/libs/shops-seasonal.config';
|
import seasonalShopConfig from 'common/script/libs/shops-seasonal.config';
|
||||||
@@ -164,6 +176,7 @@ div
|
|||||||
components: {
|
components: {
|
||||||
bPopover,
|
bPopover,
|
||||||
EquipmentAttributesPopover,
|
EquipmentAttributesPopover,
|
||||||
|
QuestInfo,
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return Object.freeze({
|
return Object.freeze({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
span.badge.badge-pill.badge-item.badge-star(
|
span.badge.badge-pill.badge-item.badge-star(
|
||||||
:class="{'item-selected-badge': selected === true}",
|
:class="{'item-selected-badge': selected === true}",
|
||||||
@click="click",
|
@click.stop="click",
|
||||||
v-if="show",
|
v-if="show",
|
||||||
) ★
|
) ★
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -269,6 +269,36 @@ module.exports = function getItemInfo (user, type, item, officialPinnedItems, la
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'gem': {
|
||||||
|
itemInfo = {
|
||||||
|
key: 'gem',
|
||||||
|
purchaseType: 'gems',
|
||||||
|
class: 'gem',
|
||||||
|
text: i18n.t('subGemName'),
|
||||||
|
notes: i18n.t('subGemPop'),
|
||||||
|
value: 20,
|
||||||
|
currency: 'gold',
|
||||||
|
path: 'special.gems',
|
||||||
|
pinType: 'gem',
|
||||||
|
locked: !user.purchased.plan.customerId,
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'rebirth_orb': {
|
||||||
|
itemInfo = {
|
||||||
|
key: 'rebirth_orb',
|
||||||
|
purchaseType: 'rebirth_orb',
|
||||||
|
class: 'rebirth_orb',
|
||||||
|
text: i18n.t('rebirthName'),
|
||||||
|
notes: i18n.t('rebirthPop'),
|
||||||
|
value: user.stats.lvl < 100 ? 6 : 0,
|
||||||
|
currency: 'gems',
|
||||||
|
path: 'special.rebirth_orb',
|
||||||
|
pinType: 'rebirth_orb',
|
||||||
|
locked: !user.flags.rebirthEnabled,
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemInfo) {
|
if (itemInfo) {
|
||||||
|
|||||||
Reference in New Issue
Block a user