Implement food seasons

This commit is contained in:
Phillip Thelen
2024-02-21 17:05:21 +01:00
committed by Sabe Jones
parent 041edb3042
commit bca3e96e9c
3 changed files with 29 additions and 9 deletions

View File

@@ -34,6 +34,7 @@ import faq from './faq';
import timeTravelers from './time-travelers';
import { getScheduleMatchingGroup } from './constants/schedule';
import { getRepeatingEvents } from './constants/events';
import loginIncentives from './loginIncentives';
@@ -202,9 +203,6 @@ api.premiumMounts = stable.premiumMounts;
api.specialMounts = stable.specialMounts;
api.mountInfo = stable.mountInfo;
// For seasonal events, change this constant:
const FOOD_SEASON = moment().isBefore('2023-03-15T12:00-05:00') ? 'Pie' : 'Normal';
api.food = {
Meat: {
text: t('foodMeat'),
@@ -456,6 +454,12 @@ api.food = {
/* eslint-enable camelcase */
};
let FOOD_SEASON = 'Normal';
getRepeatingEvents(moment()).forEach(event => {
if (event.foodSeason) {
FOOD_SEASON = event.foodSeason;
}
});
each(api.food, (food, key) => {
let foodType = 'Normal';
if (key.startsWith('Cake_')) {