diff --git a/website/client/components/inventory/equipment/attributesPopover.vue b/website/client/components/inventory/equipment/attributesPopover.vue index a65347bd65..0426c8ea9c 100644 --- a/website/client/components/inventory/equipment/attributesPopover.vue +++ b/website/client/components/inventory/equipment/attributesPopover.vue @@ -2,7 +2,7 @@ div h4.popover-content-title {{ itemText }} .popover-content-text {{ itemNotes }} - .popover-content-attr(v-for="attr in ATTRIBUTES", :key="attr", v-once) + .popover-content-attr(v-for="attr in ATTRIBUTES", :key="attr") span.popover-content-attr-key {{ `${$t(attr)}: ` }} span.popover-content-attr-val {{ `+${item[attr]}` }} diff --git a/website/client/components/inventory/equipment/index.vue b/website/client/components/inventory/equipment/index.vue index 914e55fcc6..c3528bae88 100644 --- a/website/client/components/inventory/equipment/index.vue +++ b/website/client/components/inventory/equipment/index.vue @@ -68,12 +68,13 @@ .items.items-one-line(slot="drawer-slider") item.pointer( v-for="(label, group) in gearTypesToStrings", - :key="group", + :key="flatGear[activeItems[group]] ? flatGear[activeItems[group]].key : group", :item="flatGear[activeItems[group]]", :itemContentClass="flatGear[activeItems[group]] ? 'shop_' + flatGear[activeItems[group]].key : null", :emptyItem="!flatGear[activeItems[group]] || flatGear[activeItems[group]].key.indexOf('_base_0') !== -1", :label="label", :popoverPosition="'top'", + :showPopover="flatGear[activeItems[group]] && Boolean(flatGear[activeItems[group]].text)", @click="equipItem(flatGear[activeItems[group]])", ) template(slot="popoverContent", scope="context") diff --git a/website/client/components/inventory/items/index.vue b/website/client/components/inventory/items/index.vue index 084c693a09..cb747fcb20 100644 --- a/website/client/components/inventory/items/index.vue +++ b/website/client/components/inventory/items/index.vue @@ -201,6 +201,7 @@ import QuestInfo from '../../shops/quests/questInfo.vue'; import moment from 'moment'; const allowedSpecialItems = ['snowball', 'spookySparkles', 'shinySeed', 'seafoam']; + import notifications from 'client/mixins/notifications'; import DragDropDirective from 'client/directives/dragdrop.directive'; import MouseMoveDirective from 'client/directives/mouseposition.directive'; @@ -444,8 +445,9 @@ export default { mouseMoved ($event) { if (this.potionClickMode) { - this.$refs.clickPotionInfo.style.left = `${$event.x + 20}px`; - this.$refs.clickPotionInfo.style.top = `${$event.y + 20}px`; + // dragging potioninfo is 180px wide (90 would be centered) + this.$refs.clickPotionInfo.style.left = `${$event.x - 70}px`; + this.$refs.clickPotionInfo.style.top = `${$event.y}px`; } else { lastMouseMoveEvent = $event; } diff --git a/website/client/components/inventory/stable/index.vue b/website/client/components/inventory/stable/index.vue index c09e2842e7..093bacccbf 100644 --- a/website/client/components/inventory/stable/index.vue +++ b/website/client/components/inventory/stable/index.vue @@ -451,7 +451,7 @@ .popover { position: inherit; - width: 100px; + width: 180px; } .popover-content { @@ -971,8 +971,8 @@ mouseMoved ($event) { if (this.foodClickMode) { - this.$refs.clickFoodInfo.style.left = `${$event.x + 20}px`; - this.$refs.clickFoodInfo.style.top = `${$event.y + 20}px`; + this.$refs.clickFoodInfo.style.left = `${$event.x - 70}px`; + this.$refs.clickFoodInfo.style.top = `${$event.y}px`; } else { lastMouseMoveEvent = $event; } diff --git a/website/common/script/ops/changeClass.js b/website/common/script/ops/changeClass.js index 9b01645926..c1ce86c7b4 100644 --- a/website/common/script/ops/changeClass.js +++ b/website/common/script/ops/changeClass.js @@ -7,7 +7,7 @@ import { NotAuthorized, BadRequest, } from '../libs/errors'; -import { removePinnedGearByClass, addPinnedGearByClass } from './pinnedGearUtils'; +import { removePinnedGearByClass, removePinnedItemsByOwnedGear, addPinnedGearByClass } from './pinnedGearUtils'; function resetClass (user, req = {}) { removePinnedGearByClass(user); @@ -49,6 +49,8 @@ module.exports = function changeClass (user, req = {}, analytics) { user.items.gear.owned[`weapon_${klass}_0`] = true; if (klass === 'rogue') user.items.gear.owned[`shield_${klass}_0`] = true; + removePinnedItemsByOwnedGear(user); + if (analytics) { analytics.track('change class', { uuid: user._id, diff --git a/website/common/script/ops/pinnedGearUtils.js b/website/common/script/ops/pinnedGearUtils.js index 599c943036..e685b8d93b 100644 --- a/website/common/script/ops/pinnedGearUtils.js +++ b/website/common/script/ops/pinnedGearUtils.js @@ -104,6 +104,18 @@ function removePinnedGearAddPossibleNewOnes (user, itemPath, newItemKey) { } } +/** + * removes all pinned gear that the user already owns (like class starter gear which has been pinned before) + * @param user + */ +function removePinnedItemsByOwnedGear (user) { + each(user.items.gear.owned, (bool, key) => { + if (bool) { + removeItemByPath(user, `gear.flat.${key}`); + } + }); +} + /** * @returns {boolean} TRUE added the item / FALSE removed it */ @@ -150,6 +162,7 @@ module.exports = { addPinnedGear, removePinnedGearByClass, removePinnedGearAddPossibleNewOnes, + removePinnedItemsByOwnedGear, togglePinnedItem, removeItemByPath, isPinned,