mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix(event): sell Santa scrolls
This commit is contained in:
@@ -698,7 +698,7 @@ api.quests = {
|
||||
},
|
||||
evilsanta: {
|
||||
canBuy: (function() {
|
||||
return false;
|
||||
return true;
|
||||
}),
|
||||
text: t('questEvilSantaText'),
|
||||
notes: t('questEvilSantaNotes'),
|
||||
@@ -724,7 +724,7 @@ api.quests = {
|
||||
},
|
||||
evilsanta2: {
|
||||
canBuy: (function() {
|
||||
return false;
|
||||
return true;
|
||||
}),
|
||||
text: t('questEvilSanta2Text'),
|
||||
notes: t('questEvilSanta2Notes'),
|
||||
|
||||
@@ -235,6 +235,11 @@ shops.getSeasonalShopCategories = function getSeasonalShopCategories (user, lang
|
||||
const AVAILABLE_SPELLS = [
|
||||
];
|
||||
|
||||
const AVAILABLE_QUESTS = [
|
||||
'evilsanta',
|
||||
'evilsanta2',
|
||||
];
|
||||
|
||||
let categories = [];
|
||||
|
||||
let flatGearArray = _.toArray(content.gear.flat);
|
||||
@@ -265,6 +270,36 @@ shops.getSeasonalShopCategories = function getSeasonalShopCategories (user, lang
|
||||
categories.push(category);
|
||||
}
|
||||
|
||||
let quests = pickBy(content.quests, (quest, key) => {
|
||||
return _.indexOf(AVAILABLE_QUESTS, key) !== -1;
|
||||
});
|
||||
|
||||
if (_.keys(quests).length > 0) {
|
||||
let category = {
|
||||
identifier: 'quests',
|
||||
text: i18n.t('quests', language),
|
||||
};
|
||||
|
||||
category.items = _.map(quests, (quest, key) => {
|
||||
return {
|
||||
key,
|
||||
text: quest.text(language),
|
||||
notes: quest.notes(language),
|
||||
value: quest.value,
|
||||
type: 'quests',
|
||||
currency: 'gems',
|
||||
locked: false,
|
||||
drop: quest.drop,
|
||||
boss: quest.boss,
|
||||
collect: quest.collect,
|
||||
class: `inventory_quest_scroll_${key}`,
|
||||
purchaseType: 'quests',
|
||||
};
|
||||
});
|
||||
|
||||
categories.push(category);
|
||||
}
|
||||
|
||||
for (let key in AVAILABLE_SETS) {
|
||||
if (AVAILABLE_SETS.hasOwnProperty(key)) {
|
||||
let category = {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
li.customize-menu.inventory-gear
|
||||
menu.pets-menu(label='{{category.text}}', ng-repeat='category in seasonalShopCategories')
|
||||
div(ng-repeat='item in category.items', ng-if='!user.items.gear.owned[item.key]')
|
||||
button.customize-option(class='shop_{{item.key}}',
|
||||
button.customize-option(class='{{item.class}} shop_{{item.key}}',
|
||||
popover='{{item.notes}}', popover-title='{{item.text}}',
|
||||
popover-trigger='mouseenter', popover-placement='right',
|
||||
popover-append-to-body='true',
|
||||
|
||||
Reference in New Issue
Block a user