Skip to content

Commit

Permalink
fix: address deprecation warning about CONFIG.fxmaster.specials
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost91- committed Jul 24, 2022
1 parent ac79566 commit 4f480f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fxmaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ function registerLayers() {

function parseSpecialEffects() {
const effectData = game.settings.get("fxmaster", "specialEffects");
const specials = foundry.utils.deepClone(CONFIG.fxmaster.specials);
const specialEffects = foundry.utils.deepClone(CONFIG.fxmaster.specialEffects);
effectData.reduce((acc, cur) => {
if (!cur.folder) cur.folder = "Custom";
const normalizedFolder = cur.folder.toLowerCase().replace(/ /g, "");
if (!acc[normalizedFolder]) acc[normalizedFolder] = { label: cur.folder, effects: [] };
acc[normalizedFolder].effects.push(cur);
return acc;
}, specials);
Object.keys(specials).forEach((k) => {
specials[k].effects.sort((a, b) => ("" + a.label).localeCompare(b.label));
}, specialEffects);
Object.keys(specialEffects).forEach((k) => {
specialEffects[k].effects.sort((a, b) => ("" + a.label).localeCompare(b.label));
});
CONFIG.fxmaster.userSpecials = specials;
CONFIG.fxmaster.userSpecials = specialEffects;
}

Hooks.once("init", function () {
Expand Down

0 comments on commit 4f480f2

Please sign in to comment.