mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix(timetrav): pinning, mobile order
This commit is contained in:
@@ -166,7 +166,7 @@
|
|||||||
v-if="!filterBackgrounds"
|
v-if="!filterBackgrounds"
|
||||||
class="row text-center title-row"
|
class="row text-center title-row"
|
||||||
>
|
>
|
||||||
<strong>{{ backgroundShopSets[1].text }}</strong>
|
<strong>{{ backgroundShopSets[0].text }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="!filterBackgrounds"
|
v-if="!filterBackgrounds"
|
||||||
@@ -174,14 +174,14 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="showPlainBackgroundBlurb(
|
v-if="showPlainBackgroundBlurb(
|
||||||
backgroundShopSets[1].identifier, backgroundShopSets[1].items
|
backgroundShopSets[0].identifier, backgroundShopSets[0].items
|
||||||
)"
|
)"
|
||||||
class="col-12"
|
class="col-12"
|
||||||
>
|
>
|
||||||
{{ $t('incentiveBackgroundsUnlockedWithCheckins') }}
|
{{ $t('incentiveBackgroundsUnlockedWithCheckins') }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="bg in backgroundShopSets[1].items"
|
v-for="bg in backgroundShopSets[0].items"
|
||||||
:key="bg.key"
|
:key="bg.key"
|
||||||
class="col-2"
|
class="col-2"
|
||||||
:popover-title="bg.text"
|
:popover-title="bg.text"
|
||||||
@@ -201,14 +201,14 @@
|
|||||||
v-if="!filterBackgrounds"
|
v-if="!filterBackgrounds"
|
||||||
class="row text-center title-row"
|
class="row text-center title-row"
|
||||||
>
|
>
|
||||||
<strong>{{ backgroundShopSets[0].text }}</strong>
|
<strong>{{ backgroundShopSets[1].text }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="!filterBackgrounds"
|
v-if="!filterBackgrounds"
|
||||||
class="row title-row"
|
class="row title-row"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="bg in backgroundShopSets[0].items"
|
v-for="bg in backgroundShopSets[1].items"
|
||||||
:key="bg.key"
|
:key="bg.key"
|
||||||
class="col-4 text-center customize-option background-button"
|
class="col-4 text-center customize-option background-button"
|
||||||
:popover-title="bg.text"
|
:popover-title="bg.text"
|
||||||
|
|||||||
@@ -180,7 +180,7 @@
|
|||||||
"notEnoughHourglasses": "You don't have enough Mystic Hourglasses.",
|
"notEnoughHourglasses": "You don't have enough Mystic Hourglasses.",
|
||||||
"hourglassBuyEquipSetConfirm": "Buy this full set of items for 1 Mystic Hourglass?",
|
"hourglassBuyEquipSetConfirm": "Buy this full set of items for 1 Mystic Hourglass?",
|
||||||
"hourglassBuyItemConfirm": "Buy this item for 1 Mystic Hourglass?",
|
"hourglassBuyItemConfirm": "Buy this item for 1 Mystic Hourglass?",
|
||||||
"backgroundsAlreadyOwned": "Background already owned.",
|
"backgroundAlreadyOwned": "Background already owned.",
|
||||||
"petsAlreadyOwned": "Pet already owned.",
|
"petsAlreadyOwned": "Pet already owned.",
|
||||||
"mountsAlreadyOwned": "Mount already owned.",
|
"mountsAlreadyOwned": "Mount already owned.",
|
||||||
"typeNotAllowedHourglass": "Item type not supported for purchase with Mystic Hourglass. Allowed types: <%= allowedTypes %>",
|
"typeNotAllowedHourglass": "Item type not supported for purchase with Mystic Hourglass. Allowed types: <%= allowedTypes %>",
|
||||||
|
|||||||
@@ -955,6 +955,26 @@ const backgrounds = {
|
|||||||
notes: t('backgroundSnowglobeNotes'),
|
notes: t('backgroundSnowglobeNotes'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
timeTravelBackgrounds: {
|
||||||
|
airship: {
|
||||||
|
text: t('backgroundAirshipText'),
|
||||||
|
notes: t('backgroundAirshipNotes'),
|
||||||
|
price: 1,
|
||||||
|
currency: 'hourglasses',
|
||||||
|
},
|
||||||
|
clocktower: {
|
||||||
|
text: t('backgroundClocktowerText'),
|
||||||
|
notes: t('backgroundClocktowerNotes'),
|
||||||
|
price: 1,
|
||||||
|
currency: 'hourglasses',
|
||||||
|
},
|
||||||
|
steamworks: {
|
||||||
|
text: t('backgroundSteamworksText'),
|
||||||
|
notes: t('backgroundSteamworksNotes'),
|
||||||
|
price: 1,
|
||||||
|
currency: 'hourglasses',
|
||||||
|
},
|
||||||
|
},
|
||||||
incentiveBackgrounds: {
|
incentiveBackgrounds: {
|
||||||
violet: {
|
violet: {
|
||||||
text: t('backgroundVioletText'),
|
text: t('backgroundVioletText'),
|
||||||
@@ -987,26 +1007,6 @@ const backgrounds = {
|
|||||||
currency: 'loginIncentive',
|
currency: 'loginIncentive',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
timeTravelBackgrounds: {
|
|
||||||
airship: {
|
|
||||||
text: t('backgroundAirshipText'),
|
|
||||||
notes: t('backgroundAirshipNotes'),
|
|
||||||
price: 1,
|
|
||||||
currency: 'hourglasses',
|
|
||||||
},
|
|
||||||
clocktower: {
|
|
||||||
text: t('backgroundClocktowerText'),
|
|
||||||
notes: t('backgroundClocktowerNotes'),
|
|
||||||
price: 1,
|
|
||||||
currency: 'hourglasses',
|
|
||||||
},
|
|
||||||
steamworks: {
|
|
||||||
text: t('backgroundSteamworksText'),
|
|
||||||
notes: t('backgroundSteamworksNotes'),
|
|
||||||
price: 1,
|
|
||||||
currency: 'hourglasses',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
/* eslint-enable quote-props */
|
/* eslint-enable quote-props */
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import {
|
|||||||
NotAuthorized,
|
NotAuthorized,
|
||||||
} from '../../libs/errors';
|
} from '../../libs/errors';
|
||||||
import errorMessage from '../../libs/errorMessage';
|
import errorMessage from '../../libs/errorMessage';
|
||||||
|
import getItemInfo from '../../libs/getItemInfo';
|
||||||
|
import { removeItemByPath } from '../pinnedGearUtils';
|
||||||
|
|
||||||
export default function purchaseHourglass (user, req = {}, analytics, quantity = 1) {
|
export default function purchaseHourglass (user, req = {}, analytics, quantity = 1) {
|
||||||
const key = get(req, 'params.key');
|
const key = get(req, 'params.key');
|
||||||
@@ -29,6 +31,9 @@ export default function purchaseHourglass (user, req = {}, analytics, quantity =
|
|||||||
|
|
||||||
user.purchased.background[key] = true;
|
user.purchased.background[key] = true;
|
||||||
user.purchased.plan.consecutive.trinkets -= 1;
|
user.purchased.plan.consecutive.trinkets -= 1;
|
||||||
|
const itemInfo = getItemInfo(user, 'background', content.backgroundsFlat[key]);
|
||||||
|
removeItemByPath(user, itemInfo.path);
|
||||||
|
|
||||||
if (user.markModified) user.markModified('purchased.background');
|
if (user.markModified) user.markModified('purchased.background');
|
||||||
} else if (type === 'quests') {
|
} else if (type === 'quests') {
|
||||||
if (!content.quests[key] || content.quests[key].category !== 'timeTravelers') throw new NotAuthorized(i18n.t('notAllowedHourglass', req.language));
|
if (!content.quests[key] || content.quests[key].category !== 'timeTravelers') throw new NotAuthorized(i18n.t('notAllowedHourglass', req.language));
|
||||||
|
|||||||
Reference in New Issue
Block a user