Skip to content

Commit 11b905f

Browse files
committed
Update for V11
1 parent cbdf4e0 commit 11b905f

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

module.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
"email": "dev7355608@gmail.com"
1010
}
1111
],
12-
"version": "2.0.5",
12+
"version": "2.0.6",
1313
"compatibility": {
14-
"minimum": "10.276",
15-
"verified": "10.291",
16-
"maximum": "10"
14+
"minimum": "10",
15+
"verified": "11"
1716
},
1817
"minimumCoreVersion": "10",
1918
"esmodules": [
@@ -29,8 +28,8 @@
2928
},
3029
"url": "https://github.com/dev7355608/advanced-drawing-tools",
3130
"manifest": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/module.json",
32-
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.5/module.zip",
33-
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.5",
31+
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.6/module.zip",
32+
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.6",
3433
"bugs": "https://github.com/dev7355608/advanced-drawing-tools/issues",
3534
"readme": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/README.md",
3635
"license": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/LICENSE"

scripts/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Hooks.once("libWrapper.Ready", () => {
5454
processNumberArray(`flags.${MODULE_ID}.textStyle.fillGradientStops`);
5555

5656
return cleanData(data, { deletionKeys: !this.options.configureDefault });
57-
}, "WRAPPER");
57+
}, libWrapper.WRAPPER);
5858
});
5959

6060
Hooks.on("renderDrawingConfig", (app, html) => {

scripts/edit-mode.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ Hooks.once("libWrapper.Ready", () => {
55
wrapped(...args);
66

77
this._refreshEditMode();
8-
}, "WRAPPER");
8+
}, libWrapper.WRAPPER);
99

1010
libWrapper.register(MODULE_ID, "Drawing.prototype.activateListeners", function (wrapped, ...args) {
1111
wrapped(...args);
1212

13-
this.frame.handle.off("mouseup").on("mouseup", this._onHandleMouseUp.bind(this));
14-
}, "WRAPPER");
13+
const pointerup = isNewerVersion(game.version, 11) ? "pointerup" : "mouseup";
14+
15+
this.frame.handle.off(pointerup).on(pointerup, this._onHandleMouseUp.bind(this));
16+
}, libWrapper.WRAPPER);
1517

1618
libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleHoverIn", function (event) {
1719
if (this._dragHandle) {
@@ -26,7 +28,7 @@ Hooks.once("libWrapper.Ready", () => {
2628
} else if (handle) {
2729
handle.scale.set(1.5, 1.5);
2830
}
29-
}, "OVERRIDE");
31+
}, libWrapper.OVERRIDE);
3032

3133
libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleHoverOut", function (event) {
3234
const handle = event.data.handle;
@@ -37,13 +39,13 @@ Hooks.once("libWrapper.Ready", () => {
3739
} else if (handle) {
3840
handle.scale.set(1.0, 1.0);
3941
}
40-
}, "OVERRIDE");
42+
}, libWrapper.OVERRIDE);
4143

4244
libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleMouseDown", function (event) {
4345
if (!this.document.locked) {
4446
this._dragHandle = true;
4547
}
46-
}, "OVERRIDE");
48+
}, libWrapper.OVERRIDE);
4749

4850
libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleDragStart", function (event) {
4951
this._original = this.document.toObject();
@@ -71,7 +73,7 @@ Hooks.once("libWrapper.Ready", () => {
7173
this.document.updateSource(update);
7274
this.refresh();
7375
}
74-
}, "OVERRIDE");
76+
}, libWrapper.OVERRIDE);
7577

7678
libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleDragMove", function (event) {
7779
const { handle, destination, origin, originalEvent } = event.data;
@@ -110,7 +112,7 @@ Hooks.once("libWrapper.Ready", () => {
110112
this.document.updateSource(update);
111113
this.refresh();
112114
} catch (err) { }
113-
}, "OVERRIDE");
115+
}, libWrapper.OVERRIDE);
114116

115117
libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleDragDrop", function (event) {
116118
let { handle, destination, origin, originalEvent } = event.data;
@@ -149,7 +151,7 @@ Hooks.once("libWrapper.Ready", () => {
149151
}
150152

151153
return this.document.update(update, { diff: false });
152-
}, "OVERRIDE");
154+
}, libWrapper.OVERRIDE);
153155

154156
libWrapper.register(MODULE_ID, "Drawing.prototype._onClickRight", function (wrapped, event) {
155157
const handle = event.data.handle;
@@ -179,7 +181,7 @@ Hooks.once("libWrapper.Ready", () => {
179181
}
180182

181183
return wrapped(event);
182-
}, "MIXED");
184+
}, libWrapper.MIXED);
183185
});
184186

185187
Drawing.prototype._onHandleMouseUp = function (event) {

scripts/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Hooks.once("libWrapper.Ready", () => {
2121
else if (size >= 64) return 8;
2222
else if (size >= 32) return 4;
2323
return 1;
24-
}, "OVERRIDE");
24+
}, libWrapper.OVERRIDE);
2525
libWrapper.ignore_conflicts(MODULE_ID, "precise-drawing-tools", "DrawingsLayer.prototype.gridPrecision");
2626

2727
libWrapper.register(MODULE_ID, "Drawing.prototype._rescaleDimensions", function (original, dx, dy) {
@@ -43,7 +43,7 @@ Hooks.once("libWrapper.Ready", () => {
4343
y: original.y,
4444
shape: { width: Math.roundFast(width), height: Math.roundFast(height), points }
4545
});
46-
}, "OVERRIDE");
46+
}, libWrapper.OVERRIDE);
4747
});
4848

4949
function preProcess(data) {

scripts/text.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Hooks.once("libWrapper.Ready", () => {
6666
if (conclude) {
6767
this.release();
6868
}
69-
}, "OVERRIDE");
69+
}, libWrapper.OVERRIDE);
7070
});
7171

7272
Hooks.on("refreshDrawing", drawing => {

0 commit comments

Comments
 (0)