diff --git a/lang/en.json b/lang/en.json index 48a0e2a..bb146f8 100644 --- a/lang/en.json +++ b/lang/en.json @@ -28,6 +28,8 @@ "settings.autoLOSHeight.name": "Automatic Token Height", "settings.autoLOSHeight.hint": "Calculate token height automatically via token size and scale.\nToken height will be calculated for any token without a custom height value or with a custom height set to 0. Default token height will be ignored.", "settings.defaultLosHeight.name": "Default Token Height", - "settings.defaultLosHeight.hint": "Height of a token (where the eyes of that creature are) in units. Default 6." + "settings.defaultLosHeight.hint": "Height of a token (where the eyes of that creature are) in units. Default 6.", + "settings.losHeightMulti.name": "Token Height Multiplier", + "settings.losHeightMulti.hint": "Multiplier for token height. Multiplies the automatic token height by this value." } } diff --git a/packs/macros/001019.log b/packs/macros/001173.log similarity index 100% rename from packs/macros/001019.log rename to packs/macros/001173.log diff --git a/packs/macros/CURRENT b/packs/macros/CURRENT index 3524530..7a54619 100644 --- a/packs/macros/CURRENT +++ b/packs/macros/CURRENT @@ -1 +1 @@ -MANIFEST-001018 +MANIFEST-001172 diff --git a/packs/macros/LOG b/packs/macros/LOG index 03c79f3..21c3d30 100644 --- a/packs/macros/LOG +++ b/packs/macros/LOG @@ -1,3 +1,3 @@ -2023/08/30-01:10:22.076 2db8 Recovering log #1016 -2023/08/30-01:10:22.080 2db8 Delete type=0 #1016 -2023/08/30-01:10:22.080 2db8 Delete type=3 #1014 +2023/11/14-23:09:56.341 dc90 Recovering log #1171 +2023/11/14-23:09:56.345 dc90 Delete type=0 #1171 +2023/11/14-23:09:56.345 dc90 Delete type=3 #1170 diff --git a/packs/macros/LOG.old b/packs/macros/LOG.old index c9172c7..d8d0ab6 100644 --- a/packs/macros/LOG.old +++ b/packs/macros/LOG.old @@ -1,7 +1,3 @@ -2023/08/29-16:06:06.546 3f84 Recovering log #1013 -2023/08/29-16:06:06.550 3f84 Delete type=0 #1013 -2023/08/29-16:06:06.550 3f84 Delete type=3 #1012 -2023/08/29-16:08:34.312 71ac Level-0 table #1017: started -2023/08/29-16:08:34.313 71ac Level-0 table #1017: 0 bytes OK -2023/08/29-16:08:34.316 71ac Delete type=0 #1015 -2023/08/29-16:08:34.322 71ac Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) +2023/11/14-19:31:31.688 a5b8 Recovering log #1169 +2023/11/14-19:31:31.692 a5b8 Delete type=0 #1169 +2023/11/14-19:31:31.692 a5b8 Delete type=3 #1168 diff --git a/packs/macros/MANIFEST-001018 b/packs/macros/MANIFEST-001018 deleted file mode 100644 index b095413..0000000 Binary files a/packs/macros/MANIFEST-001018 and /dev/null differ diff --git a/packs/macros/MANIFEST-001172 b/packs/macros/MANIFEST-001172 new file mode 100644 index 0000000..c00c41c Binary files /dev/null and b/packs/macros/MANIFEST-001172 differ diff --git a/scripts/patches.js b/scripts/patches.js index 193f8e1..2fe7df4 100644 --- a/scripts/patches.js +++ b/scripts/patches.js @@ -10,6 +10,7 @@ class WallHeightUtils{ this._isLevelsAutoCover = game.modules.get("levelsautocover")?.active ?? false; this._autoLosHeight = false; this._defaultTokenHeight = 6; + this._losHeightMulti = 0.89; } cacheSettings(){ @@ -17,6 +18,7 @@ class WallHeightUtils{ 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(); } diff --git a/scripts/utils.js b/scripts/utils.js index 3a7f898..e6280f3 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -6,7 +6,7 @@ export function getTokenLOSheight(token) { if (WallHeight._autoLosHeight) { losDiff = token.document.flags[MODULE_SCOPE]?.tokenHeight || - canvas.scene.dimensions.distance * + WallHeight._losHeightMulti * canvas.scene.dimensions.distance * Math.max(token.document.width, token.document.height) * ((Math.abs(token.document.texture.scaleX) + Math.abs(token.document.texture.scaleY)) / 2); } else { diff --git a/scripts/wall-height.js b/scripts/wall-height.js index c6f6994..ba2b51f 100644 --- a/scripts/wall-height.js +++ b/scripts/wall-height.js @@ -121,6 +121,23 @@ function registerSettings() { }, }); + game.settings.register(MODULE_ID, "losHeightMulti", { + name: game.i18n.localize(`${MODULE_SCOPE}.settings.losHeightMulti.name`), + hint: game.i18n.localize(`${MODULE_SCOPE}.settings.losHeightMulti.hint`), + scope: "world", + config: true, + type: Number, + default: 0.89, + range: { + min: 0.1, + max: 2, + step: 0.01, + }, + onChange: () => { + WallHeight.cacheSettings(); + }, + }); + game.settings.register(MODULE_ID, 'globalAdvancedLighting', { name: game.i18n.localize(`${MODULE_SCOPE}.settings.globalAdvancedLighting.name`), hint: game.i18n.localize(`${MODULE_SCOPE}.settings.globalAdvancedLighting.hint`),