Skip to content

Commit

Permalink
v11
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed May 27, 2023
1 parent a324370 commit 845ccd7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 12 deletions.
9 changes: 3 additions & 6 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@
]
},
"compatibility": {
"minimum": "10",
"verified": "10"
},

"name": "wall-height",
"minimumCoreVersion": "10"
"minimum": "11",
"verified": "11"
}
}
Empty file added packs/macros/000010.log
Empty file.
1 change: 1 addition & 0 deletions packs/macros/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-000008
Empty file added packs/macros/LOCK
Empty file.
7 changes: 7 additions & 0 deletions packs/macros/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2023/05/27-15:25:10.350 5820 Recovering log #6
2023/05/27-15:25:10.358 5820 Delete type=0 #6
2023/05/27-15:25:10.359 5820 Delete type=3 #4
2023/05/27-15:55:55.171 4848 Level-0 table #11: started
2023/05/27-15:55:55.171 4848 Level-0 table #11: 0 bytes OK
2023/05/27-15:55:55.172 4848 Delete type=0 #9
2023/05/27-15:55:55.172 4848 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end)
7 changes: 7 additions & 0 deletions packs/macros/LOG.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2023/05/27-13:32:31.167 67d4 Recovering log #3
2023/05/27-13:32:31.172 67d4 Delete type=0 #3
2023/05/27-13:32:31.172 67d4 Delete type=3 #2
2023/05/27-13:32:53.741 4e30 Level-0 table #7: started
2023/05/27-13:32:53.741 4e30 Level-0 table #7: 0 bytes OK
2023/05/27-13:32:53.743 4e30 Delete type=0 #5
2023/05/27-13:32:53.743 4e30 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end)
Binary file added packs/macros/MANIFEST-000008
Binary file not shown.
20 changes: 15 additions & 5 deletions scripts/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class WallHeightUtils{
schedulePerceptionUpdate(){
if (!canvas.ready) return;
canvas.perception.update({
forceUpdateFog: true,

initializeLighting: true,
initializeSounds: true,
initializeVision: true,
Expand Down Expand Up @@ -255,7 +255,6 @@ export function registerWrappers() {
|| 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,
initializeLighting: true,
initializeSounds: true,
initializeVision: true,
Expand Down Expand Up @@ -327,7 +326,12 @@ export function registerWrappers() {
return wrapped(origin, config, ...args);
}

function drawWallRange(wrapped, ...args){
function pointSourceInitialize(wrapped, ...args) {
if(this.object) args[0].elevation = this.object.losHeight ?? this.object.document.elevation;
return wrapped(...args);
}

function drawWallRange(wrapped, ...args) {
const { advancedVision } = getSceneSettings(canvas.scene);
const bounds = getWallBounds(this);
if(!WallHeight._enableWallText || !advancedVision || (bounds.top == Infinity && bounds.bottom == -Infinity)) {
Expand All @@ -338,7 +342,6 @@ export function registerWrappers() {
wrapped(...args);
const style = CONFIG.canvasTextStyle.clone();
style.fontSize /= 1.5;
style.fill = this._getWallColor();
if(bounds.top == Infinity) bounds.top = "Inf";
if(bounds.bottom == -Infinity) bounds.bottom = "-Inf";
const range = `${bounds.top} / ${bounds.bottom}`;
Expand Down Expand Up @@ -380,8 +383,13 @@ export function registerWrappers() {
if(updates.flags && updates.flags[MODULE_ID]) {
WallHeight.schedulePerceptionUpdate();
}
if(canvas.walls.active) wall.object.refresh();
})

Hooks.on("activateWallsLayer", () => {
canvas.walls.placeables.forEach(w => w.refresh());
});

libWrapper.register(MODULE_ID, "DoorControl.prototype.isVisible", isDoorVisible, "MIXED");

libWrapper.register(MODULE_ID, "CONFIG.Token.objectClass.prototype._onUpdate", tokenOnUpdate, "WRAPPER");
Expand All @@ -390,6 +398,8 @@ export function registerWrappers() {

libWrapper.register(MODULE_ID, "ClockwiseSweepPolygon.prototype.initialize", setSourceElevation, "WRAPPER");

libWrapper.register(MODULE_ID, "RenderedPointSource.prototype._initialize", pointSourceInitialize, "WRAPPER");

libWrapper.register(MODULE_ID, "Wall.prototype.refresh", drawWallRange, "WRAPPER");

libWrapper.register(
Expand All @@ -413,4 +423,4 @@ export function registerWrappers() {
libWrapper.OVERRIDE,
{ perf_mode: libWrapper.PERF_FAST }
);
}
}
2 changes: 1 addition & 1 deletion scripts/wall-height.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Hooks.on("renderWallConfig", (app, html, data) => {
const topLabel = game.i18n.localize(`${MODULE_SCOPE}.WallHeightTopLabel`);
const bottomLabel = game.i18n.localize(`${MODULE_SCOPE}.WallHeightBottomLabel`);
const moduleLabel = game.i18n.localize(`${MODULE_SCOPE}.ModuleLabel`);
html.find(`select[name="ds"]`).closest(".form-group").after(`
html.find(`.door-options`).after(`
<fieldset>
<legend>${moduleLabel}</legend>
<div class="form-group">
Expand Down

0 comments on commit 845ccd7

Please sign in to comment.