Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Nov 14, 2023
1 parent c66085e commit a61061b
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 13 deletions.
4 changes: 3 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
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-001018
MANIFEST-001172
6 changes: 3 additions & 3 deletions packs/macros/LOG
Original file line number Diff line number Diff line change
@@ -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
10 changes: 3 additions & 7 deletions packs/macros/LOG.old
Original file line number Diff line number Diff line change
@@ -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
Binary file removed packs/macros/MANIFEST-001018
Binary file not shown.
Binary file added packs/macros/MANIFEST-001172
Binary file not shown.
2 changes: 2 additions & 0 deletions scripts/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ class WallHeightUtils{
this._isLevelsAutoCover = game.modules.get("levelsautocover")?.active ?? false;
this._autoLosHeight = false;
this._defaultTokenHeight = 6;
this._losHeightMulti = 0.89;
}

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
2 changes: 1 addition & 1 deletion scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 17 additions & 0 deletions scripts/wall-height.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down

0 comments on commit a61061b

Please sign in to comment.