From 845ccd7b5adcbd03817389d8d651522e65bff76b Mon Sep 17 00:00:00 2001 From: theripper93 Date: Sat, 27 May 2023 15:55:58 +0200 Subject: [PATCH] v11 --- module.json | 9 +++------ packs/macros/000010.log | 0 packs/macros/CURRENT | 1 + packs/macros/LOCK | 0 packs/macros/LOG | 7 +++++++ packs/macros/LOG.old | 7 +++++++ packs/macros/MANIFEST-000008 | Bin 0 -> 65 bytes scripts/patches.js | 20 +++++++++++++++----- scripts/wall-height.js | 2 +- 9 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 packs/macros/000010.log create mode 100644 packs/macros/CURRENT create mode 100644 packs/macros/LOCK create mode 100644 packs/macros/LOG create mode 100644 packs/macros/LOG.old create mode 100644 packs/macros/MANIFEST-000008 diff --git a/module.json b/module.json index 4e5c049..e313a6a 100644 --- a/module.json +++ b/module.json @@ -58,10 +58,7 @@ ] }, "compatibility": { - "minimum": "10", - "verified": "10" - }, - - "name": "wall-height", - "minimumCoreVersion": "10" + "minimum": "11", + "verified": "11" + } } \ No newline at end of file diff --git a/packs/macros/000010.log b/packs/macros/000010.log new file mode 100644 index 0000000..e69de29 diff --git a/packs/macros/CURRENT b/packs/macros/CURRENT new file mode 100644 index 0000000..d408ea0 --- /dev/null +++ b/packs/macros/CURRENT @@ -0,0 +1 @@ +MANIFEST-000008 diff --git a/packs/macros/LOCK b/packs/macros/LOCK new file mode 100644 index 0000000..e69de29 diff --git a/packs/macros/LOG b/packs/macros/LOG new file mode 100644 index 0000000..045a86d --- /dev/null +++ b/packs/macros/LOG @@ -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) diff --git a/packs/macros/LOG.old b/packs/macros/LOG.old new file mode 100644 index 0000000..ddad39d --- /dev/null +++ b/packs/macros/LOG.old @@ -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) diff --git a/packs/macros/MANIFEST-000008 b/packs/macros/MANIFEST-000008 new file mode 100644 index 0000000000000000000000000000000000000000..ce1297c9c928069303c9b9332830a144b48040a8 GIT binary patch literal 65 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAevy&q+B6OZMkY>924*f6 R2JQ;;R1lX7$mL;S007PJ5VQaQ literal 0 HcmV?d00001 diff --git a/scripts/patches.js b/scripts/patches.js index a1c3ccc..a1bca64 100644 --- a/scripts/patches.js +++ b/scripts/patches.js @@ -49,7 +49,7 @@ class WallHeightUtils{ schedulePerceptionUpdate(){ if (!canvas.ready) return; canvas.perception.update({ - forceUpdateFog: true, + initializeLighting: true, initializeSounds: true, initializeVision: true, @@ -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, @@ -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)) { @@ -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}`; @@ -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"); @@ -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( @@ -413,4 +423,4 @@ export function registerWrappers() { libWrapper.OVERRIDE, { perf_mode: libWrapper.PERF_FAST } ); -} +} \ No newline at end of file diff --git a/scripts/wall-height.js b/scripts/wall-height.js index 78dcb1c..c6f6994 100644 --- a/scripts/wall-height.js +++ b/scripts/wall-height.js @@ -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(`
${moduleLabel}