Skip to content

Commit

Permalink
feat: make all weather effects available in the scene config
Browse files Browse the repository at this point in the history
Additionally, `CONFIG.fxmaster.weather.nature` is deprecated in favor of
`CONFIG.fxmaster.weather.leaves`.
  • Loading branch information
ghost91- committed Dec 17, 2021
1 parent 716a07b commit 6b1aa56
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ You can get a complete list by typing `CONFIG.fxmaster.filters` in your web cons
| `fog` || ||||
| `raintop` ||||||
| `birds` || ||||
| `nature` || ||||
| `leaves` || ||||
| `rain` ||||||
| `snow` ||||||

Expand Down
12 changes: 12 additions & 0 deletions src/module/fxmaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SpecialsLayer } from "./specialEffects/SpecialsLayer.js";
import { registerHelpers } from "./helpers.js";
import { registerGetSceneControlButtonsHook } from "./controls.js";
import { isV9OrLater } from "./utils.js";
import { logger } from "./logger.js";

import "../css/common.css";

Expand Down Expand Up @@ -50,6 +51,17 @@ Hooks.once("init", function () {
specials: FXMASTER.specials,
weather: FXMASTER.weatherEffects,
});

Object.defineProperty(CONFIG.fxmaster.weather, "nature", {
get: () => {
logger.warn(
`'CONFIG.fxmaster.weather.nature' is deprecated and will be removed in a future version. Please use 'CONFIG.fxmaster.weather.leaves' instead.`,
);
return CONFIG.fxmaster.weather.leaves;
},
});

foundry.utils.mergeObject(CONFIG.weatherEffects, FXMASTER.weatherEffects);
});

Hooks.once("ready", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/module/weatherEffects/weatherDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const weatherDB = {
fog: FogWeatherEffect,
raintop: RaintopWeatherEffect,
birds: BirdsWeatherEffect,
nature: AutumnLeavesWeatherEffect,
leaves: AutumnLeavesWeatherEffect,
rain: RainWeatherEffect,
snow: SnowWeatherEffect,
};

0 comments on commit 6b1aa56

Please sign in to comment.