mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
fix(content): item type handling
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
"mustPurchaseToSet": "Must purchase <%= val %> to set it on <%= key %>.",
|
"mustPurchaseToSet": "Must purchase <%= val %> to set it on <%= key %>.",
|
||||||
"typeRequired": "Type is required",
|
"typeRequired": "Type is required",
|
||||||
"keyRequired": "Key is required",
|
"keyRequired": "Key is required",
|
||||||
"notAccteptedType": "Type must be in [eggs, hatchingPotions, food, quests, gear]",
|
"notAccteptedType": "Type must be in [eggs, hatchingPotions, premiumHatchingPotions, food, quests, gear]",
|
||||||
"contentKeyNotFound": "Key not found for Content <%= type %>",
|
"contentKeyNotFound": "Key not found for Content <%= type %>",
|
||||||
"plusOneGem": "+1 Gem",
|
"plusOneGem": "+1 Gem",
|
||||||
"typeNotSellable": "Type is not sellable. Must be one of the following <%= acceptedTypes %>",
|
"typeNotSellable": "Type is not sellable. Must be one of the following <%= acceptedTypes %>",
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export const ITEM_LIST = {
|
|||||||
headAccessory: { localeKey: 'headAccessory', isEquipment: true },
|
headAccessory: { localeKey: 'headAccessory', isEquipment: true },
|
||||||
eyewear: { localeKey: 'eyewear', isEquipment: true },
|
eyewear: { localeKey: 'eyewear', isEquipment: true },
|
||||||
hatchingPotions: { localeKey: 'hatchingPotion', isEquipment: false },
|
hatchingPotions: { localeKey: 'hatchingPotion', isEquipment: false },
|
||||||
|
premiumHatchingPotions: { localeKey: 'hatchingPotion', isEquipment: false },
|
||||||
eggs: { localeKey: 'eggSingular', isEquipment: false },
|
eggs: { localeKey: 'eggSingular', isEquipment: false },
|
||||||
quests: { localeKey: 'quest', isEquipment: false },
|
quests: { localeKey: 'quest', isEquipment: false },
|
||||||
food: { localeKey: 'foodText', isEquipment: false },
|
food: { localeKey: 'foodText', isEquipment: false },
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ shops.getMarketCategories = function getMarket (user, language) {
|
|||||||
categories.push(hatchingPotionsCategory);
|
categories.push(hatchingPotionsCategory);
|
||||||
|
|
||||||
let premiumHatchingPotionsCategory = {
|
let premiumHatchingPotionsCategory = {
|
||||||
identifier: 'magicHatchingPotions',
|
identifier: 'premiumHatchingPotions',
|
||||||
text: i18n.t('magicHatchingPotions', language),
|
text: i18n.t('magicHatchingPotions', language),
|
||||||
notes: i18n.t('premiumPotionNoDropExplanation', language),
|
notes: i18n.t('premiumPotionNoDropExplanation', language),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,10 +60,11 @@ module.exports = function purchase (user, req = {}, analytics) {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
let acceptedTypes = ['eggs', 'hatchingPotions', 'food', 'quests', 'gear'];
|
let acceptedTypes = ['eggs', 'hatchingPotions', 'premiumHatchingPotions', 'food', 'quests', 'gear'];
|
||||||
if (acceptedTypes.indexOf(type) === -1) {
|
if (acceptedTypes.indexOf(type) === -1) {
|
||||||
throw new NotFound(i18n.t('notAccteptedType', req.language));
|
throw new NotFound(i18n.t('notAccteptedType', req.language));
|
||||||
}
|
}
|
||||||
|
if (type === 'premiumHatchingPotions') type = 'hatchingPotions';
|
||||||
|
|
||||||
if (type === 'gear') {
|
if (type === 'gear') {
|
||||||
item = content.gear.flat[key];
|
item = content.gear.flat[key];
|
||||||
|
|||||||
Reference in New Issue
Block a user