Skip to content

Commit

Permalink
fix token config, update deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Sep 1, 2022
1 parent 981ba25 commit 1f2ad57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ export function registerWrappers() {
if (canvas.effects.visionSources.has(sourceId)) {
token.vision.los.origin.b = token.vision.los.origin.t = losHeight;
}
if (canvas.lighting.sources.has(sourceId)) {
if (canvas.effects.lightSources.has(sourceId)) {
token.light.los.origin.b = token.light.los.origin.t = losHeight;
}
} else if (canvas.effects.visionSources.has(sourceId) && (token.vision.los.origin.b !== losHeight || token.vision.los.origin.t !== losHeight)
|| canvas.lighting.sources.has(sourceId) && (token.light.los.origin.b !== losHeight || token.light.los.origin.t !== losHeight)) {
|| canvas.effects.lightSources.has(sourceId) && (token.light.los.origin.b !== losHeight || token.light.los.origin.t !== losHeight)) {
token.updateSource({ defer: true });
canvas.perception.update({
forceUpdateFog: true,
Expand Down
4 changes: 2 additions & 2 deletions scripts/wall-height.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Hooks.on("renderAmbientSoundConfig", (app, html, data) => {
const checked = app.object.getFlag(MODULE_SCOPE, "advancedLighting") ? "checked" : "";
const rangeTop = game.i18n.localize(`${MODULE_SCOPE}.levelsRangeTop`);
const rangeBottom = game.i18n.localize(`${MODULE_SCOPE}.levelsRangeBottom`);
const distance = (app.object.parent?.grid.units ?? game.system.grid.units) || game.i18n.localize(`${MODULE_SCOPE}.distance`);
const distance = (canvas.scene.grid.units ?? game.system?.grid?.units) || game.i18n.localize(`${MODULE_SCOPE}.distance`);
const globalAdvancedLighting = game.settings.get(MODULE_ID, 'globalAdvancedLighting');
const warnEnabledGlobally = `<p class="hint" style="color: red;">${game.i18n.localize(`${MODULE_SCOPE}.ALGlobal`)}</p>`;
const hint = globalAdvancedLighting ? warnEnabledGlobally : ""
Expand Down Expand Up @@ -262,7 +262,7 @@ Hooks.on("renderTokenConfig", (app, html, data) => {
const losHeight = app.object?.object?.losHeight ?? 0;
const height = losHeight - app.token.elevation;
const hint = game.i18n.localize(`${MODULE_SCOPE}.tokenHeightHint`).replace("{{height}}", height).replace("{{losHeight}}", losHeight);
const distance = (app.object.parent?.grid.units ?? game.system.grid.units) || game.i18n.localize(`${MODULE_SCOPE}.distance`);
const distance = (canvas.scene.grid.units ?? game.system?.grid?.units) || game.i18n.localize(`${MODULE_SCOPE}.distance`);
let newHtml = `
<div class="form-group slim">
<label>${label} <span class="units">(${distance})</span></label>
Expand Down

0 comments on commit 1f2ad57

Please sign in to comment.