Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Oct 16, 2024
1 parent a615ffd commit 34f0e0e
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 133 deletions.
1 change: 0 additions & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/macros/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-001950
MANIFEST-002114
6 changes: 3 additions & 3 deletions packs/macros/LOG
Original file line number Diff line number Diff line change
@@ -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
10 changes: 3 additions & 7 deletions packs/macros/LOG.old
Original file line number Diff line number Diff line change
@@ -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
Binary file not shown.
5 changes: 2 additions & 3 deletions scripts/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
28 changes: 0 additions & 28 deletions scripts/tooltip.js

This file was deleted.

58 changes: 0 additions & 58 deletions scripts/wall-height.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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('<template id="wall-height-tooltip"></template>');
canvas.hud.wallHeight = new WallHeightToolTip();
});
}
WallHeight.cacheSettings();
});

Expand All @@ -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`),
Expand All @@ -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`),
Expand Down
16 changes: 0 additions & 16 deletions styles/wall-height.css

This file was deleted.

16 changes: 0 additions & 16 deletions templates/tooltip.html

This file was deleted.

0 comments on commit 34f0e0e

Please sign in to comment.