diff --git a/module.json b/module.json index b205473..5ed8ca3 100644 --- a/module.json +++ b/module.json @@ -43,7 +43,6 @@ } ], "styles": [ - "styles/wall-height.css" ], "url": "https://github.com/theripper93/wall-height", "manifest": "https://github.com/theripper93/wall-height/releases/latest/download/module.json", diff --git a/packs/macros/001951.log b/packs/macros/002115.log similarity index 100% rename from packs/macros/001951.log rename to packs/macros/002115.log diff --git a/packs/macros/CURRENT b/packs/macros/CURRENT index 0515f28..ed40996 100644 --- a/packs/macros/CURRENT +++ b/packs/macros/CURRENT @@ -1 +1 @@ -MANIFEST-001950 +MANIFEST-002114 diff --git a/packs/macros/LOG b/packs/macros/LOG index 8b31c52..b789fcf 100644 --- a/packs/macros/LOG +++ b/packs/macros/LOG @@ -1,3 +1,3 @@ -2024/09/08-11:14:06.845 8b10 Recovering log #1948 -2024/09/08-11:14:06.850 8b10 Delete type=0 #1948 -2024/09/08-11:14:06.850 8b10 Delete type=3 #1946 +2024/10/16-14:15:53.372 7a34 Recovering log #2113 +2024/10/16-14:15:53.376 7a34 Delete type=0 #2113 +2024/10/16-14:15:53.376 7a34 Delete type=3 #2112 diff --git a/packs/macros/LOG.old b/packs/macros/LOG.old index 1446fcc..0fb6857 100644 --- a/packs/macros/LOG.old +++ b/packs/macros/LOG.old @@ -1,7 +1,3 @@ -2024/09/08-11:13:48.230 9cf4 Recovering log #1944 -2024/09/08-11:13:48.234 9cf4 Delete type=0 #1944 -2024/09/08-11:13:48.234 9cf4 Delete type=3 #1942 -2024/09/08-11:13:56.394 7a7c Level-0 table #1949: started -2024/09/08-11:13:56.394 7a7c Level-0 table #1949: 0 bytes OK -2024/09/08-11:13:56.396 7a7c Delete type=0 #1947 -2024/09/08-11:13:56.396 7a7c Manual compaction at level-0 from '!macros!5zElsDCnePqaHmQ6' @ 72057594037927935 : 1 .. '!macros!uPDEi0D43DJ8ifBf' @ 0 : 0; will stop at (end) +2024/10/16-01:43:45.004 4cf0 Recovering log #2110 +2024/10/16-01:43:45.007 4cf0 Delete type=0 #2110 +2024/10/16-01:43:45.007 4cf0 Delete type=3 #2108 diff --git a/packs/macros/MANIFEST-001950 b/packs/macros/MANIFEST-002114 similarity index 80% rename from packs/macros/MANIFEST-001950 rename to packs/macros/MANIFEST-002114 index 3dd5b9d..3a9dba4 100644 Binary files a/packs/macros/MANIFEST-001950 and b/packs/macros/MANIFEST-002114 differ diff --git a/scripts/patches.js b/scripts/patches.js index e6dde9c..7c0f80d 100644 --- a/scripts/patches.js +++ b/scripts/patches.js @@ -17,7 +17,6 @@ class WallHeightUtils{ cacheSettings(){ this._autoLosHeight = game.settings.get(MODULE_ID, 'autoLOSHeight'); this._defaultTokenHeight = game.settings.get(MODULE_ID, 'defaultLosHeight'); - this._blockSightMovement = game.settings.get(MODULE_ID, "blockSightMovement"); this._enableWallText = game.settings.get(MODULE_ID, "enableWallText"); this._losHeightMulti = game.settings.get(MODULE_ID, "losHeightMulti"); this.schedulePerceptionUpdate(); @@ -244,7 +243,7 @@ class WallHeightUtils{ addBoundsToRays(rays, token) { if (token) { const bottom = token.document.elevation; - const top = WallHeight._blockSightMovement ? token.losHeight : token.document.elevation; + const top = token.losHeight; for (const ray of rays) { ray.A.b = bottom; ray.A.t = top; @@ -318,7 +317,7 @@ export function registerWrappers() { bottom = top = object.losHeight; } else { bottom = object.document.elevation; - top = WallHeight._blockSightMovement ? object.losHeight : bottom; + top = object.losHeight; } } else if (object instanceof AmbientLight || object instanceof AmbientSound) { if (getAdvancedLighting(object.document)) { diff --git a/scripts/tooltip.js b/scripts/tooltip.js deleted file mode 100644 index db527d6..0000000 --- a/scripts/tooltip.js +++ /dev/null @@ -1,28 +0,0 @@ -export class WallHeightToolTip extends BasePlaceableHUD { - - static get defaultOptions() { - const options = super.defaultOptions; - options.classes = options.classes.concat(["wall-height-tooltip"]); - options.template = "modules/wall-height/templates/tooltip.html"; - options.id = "wall-height-tooltip"; - return options; - } - - getData() { - const data = super.getData(); - return data; - } - - setPosition() { - if (!this.object) return; - const position = { - width: canvas.grid.size *1.2, - height: canvas.grid.size *.8, - left: this.object.center.x+20, - top: this.object.center.y+20, - "font-size": canvas.grid.size / 3.5 + "px", - "display" : "grid" - }; - this.element.css(position); - } -} diff --git a/scripts/wall-height.js b/scripts/wall-height.js index d347582..d75a9bc 100644 --- a/scripts/wall-height.js +++ b/scripts/wall-height.js @@ -1,6 +1,5 @@ import { registerWrappers } from "./patches.js"; import { getWallBounds,getSceneSettings,migrateData,getTokenLOSheight } from "./utils.js"; -import { WallHeightToolTip } from './tooltip.js'; import { MODULE_SCOPE, TOP_KEY, BOTTOM_KEY, ENABLE_ADVANCED_VISION_KEY, ENABLE_ADVANCED_MOVEMENT_KEY } from "./const.js"; const MODULE_ID = 'wall-height'; @@ -14,14 +13,6 @@ Object.defineProperty(Token.prototype, "losHeight", { Hooks.once("init",()=>{ registerWrappers(); registerSettings(); - if(game.settings.get(MODULE_ID,'enableTooltip')){ - Hooks.on("renderHeadsUpDisplay", (app, html, data) => { - canvas.hud.wallHeight?.close(); - html.find("#wall-height-tooltip").remove(); - html.append(''); - canvas.hud.wallHeight = new WallHeightToolTip(); - }); - } WallHeight.cacheSettings(); }); @@ -34,44 +25,7 @@ Hooks.once("ready", ()=>{ } }) -Hooks.on("hoverWall",(wall, hovered)=>{ - if (!canvas.hud?.wallHeight || canvas.walls._chain) return; - const {advancedVision} = getSceneSettings(canvas.scene); - if(advancedVision!=null && !advancedVision) - return; - if (hovered) { - canvas.hud.wallHeight.bind(wall); - } else { - canvas.hud.wallHeight.clear(); - } -}); - -Hooks.on("renderSceneControls", () => { - if (canvas.hud?.wallHeight) canvas.hud.wallHeight.clear(); - }); - -Hooks.on("deleteWall", () => { - if (canvas.hud?.wallHeight) canvas.hud.wallHeight.clear(); -}); - -Hooks.on("createWall", () => { - if (canvas.hud?.wallHeight) canvas.hud.wallHeight.clear(); -}); - -Hooks.on("updateWall", () => { - if (canvas.hud?.wallHeight) canvas.hud.wallHeight.clear(); -}); - function registerSettings() { - game.settings.register(MODULE_ID, 'enableTooltip', { - name: game.i18n.localize(`${MODULE_SCOPE}.settings.enableTooltip.name`), - hint: game.i18n.localize(`${MODULE_SCOPE}.settings.enableTooltip.hint`), - scope: 'world', - config: true, - type: Boolean, - default: false - }); - game.settings.register(MODULE_ID, 'enableWallText', { name: game.i18n.localize(`${MODULE_SCOPE}.settings.enableWallText.name`), hint: game.i18n.localize(`${MODULE_SCOPE}.settings.enableWallText.hint`), @@ -84,18 +38,6 @@ function registerSettings() { }, }); - game.settings.register(MODULE_ID, "blockSightMovement", { - name: game.i18n.localize(`${MODULE_SCOPE}.settings.blockSightMovement.name`), - hint: game.i18n.localize(`${MODULE_SCOPE}.settings.blockSightMovement.hint`), - scope: "world", - config: true, - type: Boolean, - default: true, - onChange: () => { - WallHeight.cacheSettings(); - }, - }); - game.settings.register(MODULE_ID, "autoLOSHeight", { name: game.i18n.localize(`${MODULE_SCOPE}.settings.autoLOSHeight.name`), hint: game.i18n.localize(`${MODULE_SCOPE}.settings.autoLOSHeight.hint`), diff --git a/styles/wall-height.css b/styles/wall-height.css deleted file mode 100644 index 13ba2ad..0000000 --- a/styles/wall-height.css +++ /dev/null @@ -1,16 +0,0 @@ -#wall-height-tooltip { - grid-template-columns: 40% 60%; - grid-auto-rows: auto; - justify-items: start; - align-content: start; - justify-content: start; - padding: 3px 0; - color: #f1f1f1; - border: 2px solid; - border-radius: 5px; - background-color:rgba(0, 0, 0, 0.6); -} -#wall-height-tooltip span { - padding: 0 3px; - text-align: left; -} diff --git a/templates/tooltip.html b/templates/tooltip.html deleted file mode 100644 index 69f21a7..0000000 --- a/templates/tooltip.html +++ /dev/null @@ -1,16 +0,0 @@ -
- T: - {{#if_null flags.wall-height.top}} - - {{else}} - {{{flags.wall-height.top}}} - {{/if_null}} - - B: - {{#if_null flags.wall-height.bottom}} - - {{else}} - {{{flags.wall-height.bottom}}} - {{/if_null}} - -
\ No newline at end of file