mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Move food defaults function into helpers
This commit is contained in:
@@ -54,3 +54,22 @@ export function setSpellDefaults (className, spells) {
|
||||
defaults(spell, spellDefaults);
|
||||
});
|
||||
};
|
||||
|
||||
//----------------------------------------
|
||||
// Food Helpers
|
||||
//----------------------------------------
|
||||
|
||||
export function setFoodDefaults(food, options={}) {
|
||||
each(food, (item, name) => {
|
||||
let formattedName = formatForTranslator(name);
|
||||
|
||||
defaults(item, {
|
||||
canBuy: options.canBuy || false,
|
||||
canDrop: options.canDrop || false,
|
||||
text: translator(`food${formattedName}`),
|
||||
value: 1,
|
||||
key: name,
|
||||
notes: translator('foodNotes'),
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user