Skip to content

Commit

Permalink
curvy-walls: Fix tool crash on layer change
Browse files Browse the repository at this point in the history
Fix #369
  • Loading branch information
flamewave000 committed Feb 24, 2025
1 parent df0056a commit 6dea9b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions df-curvy-walls/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Release 4.0.0 (2025-02-24)
- **UPDATE:** Migrated to v12.
- **UPDATE:** Downgraded TS -> JS (such sad).
- **FIX #369:** Fix tool crash when tool is being placed and user switches canvas layers.

## Release 3.4.0 (2022-10-15)
- **UPDATE:** Migrated to FoundryVTT v10.
Expand Down
3 changes: 2 additions & 1 deletion df-curvy-walls/include
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Settings.mjs
Settings.mjs
libWrapper.d.ts
2 changes: 1 addition & 1 deletion df-curvy-walls/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"id": "lib-df-buttons",
"type": "module",
"compatibility": { "verified": "2.0.1", "minimum": "2.0.1" }
"compatibility": { "verified": "2.0.2", "minimum": "2.0.1" }
}
]
},
Expand Down
5 changes: 5 additions & 0 deletions df-curvy-walls/src/CurvyWallToolManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/// <reference path="./types.d.ts" />
/// <reference path="./tools/BezierTool.mjs" />
/// <reference path="./tools/ToolInputHandler.mjs" />
/// <reference path="../common/libWrapper.d.ts" />

import { ToolMode } from './tools/BezierTool.mjs';
import CircleTool from './tools/CircleTool.mjs';
Expand Down Expand Up @@ -348,6 +349,10 @@ export class CurvyWallToolManager {
this.clearTool();
wrapper(...args);
}, 'WRAPPER');
libWrapper.register(SETTINGS.MOD_NAME, 'WallsLayer.prototype.clearPreviewContainer', (/**@type {Function}*/wrapped) => {
this.clearTool();
return wrapped();
}, 'WRAPPER');
}

patchWallsLayer() {
Expand Down

0 comments on commit 6dea9b6

Please sign in to comment.