mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Move background function to helpers
This commit is contained in:
@@ -119,3 +119,27 @@ function _getGearAttributes(gear) {
|
||||
|
||||
return attr;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Background Helpers
|
||||
//----------------------------------------
|
||||
|
||||
export function generateBackgrounds(sets) {
|
||||
let backgrounds = {};
|
||||
|
||||
each(sets, (names, set) => {
|
||||
let setName = `backgrounds${set}`;
|
||||
backgrounds[setName] = {};
|
||||
|
||||
each(names, (name) => {
|
||||
let formattedName = formatForTranslator(name);
|
||||
|
||||
backgrounds[setName][name] = {
|
||||
text: translator(`background${formattedName}Text`),
|
||||
notes: translator(`background${formattedName}Notes`),
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
return backgrounds;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user