Skip to content

Commit

Permalink
Update for V11
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed Feb 2, 2023
1 parent cbdf4e0 commit 11b905f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
11 changes: 5 additions & 6 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"email": "[email protected]"
}
],
"version": "2.0.5",
"version": "2.0.6",
"compatibility": {
"minimum": "10.276",
"verified": "10.291",
"maximum": "10"
"minimum": "10",
"verified": "11"
},
"minimumCoreVersion": "10",
"esmodules": [
Expand All @@ -29,8 +28,8 @@
},
"url": "https://github.com/dev7355608/advanced-drawing-tools",
"manifest": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/module.json",
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.5/module.zip",
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.5",
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.6/module.zip",
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.6",
"bugs": "https://github.com/dev7355608/advanced-drawing-tools/issues",
"readme": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/README.md",
"license": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Hooks.once("libWrapper.Ready", () => {
processNumberArray(`flags.${MODULE_ID}.textStyle.fillGradientStops`);

return cleanData(data, { deletionKeys: !this.options.configureDefault });
}, "WRAPPER");
}, libWrapper.WRAPPER);
});

Hooks.on("renderDrawingConfig", (app, html) => {
Expand Down
22 changes: 12 additions & 10 deletions scripts/edit-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ Hooks.once("libWrapper.Ready", () => {
wrapped(...args);

this._refreshEditMode();
}, "WRAPPER");
}, libWrapper.WRAPPER);

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

this.frame.handle.off("mouseup").on("mouseup", this._onHandleMouseUp.bind(this));
}, "WRAPPER");
const pointerup = isNewerVersion(game.version, 11) ? "pointerup" : "mouseup";

this.frame.handle.off(pointerup).on(pointerup, this._onHandleMouseUp.bind(this));
}, libWrapper.WRAPPER);

libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleHoverIn", function (event) {
if (this._dragHandle) {
Expand All @@ -26,7 +28,7 @@ Hooks.once("libWrapper.Ready", () => {
} else if (handle) {
handle.scale.set(1.5, 1.5);
}
}, "OVERRIDE");
}, libWrapper.OVERRIDE);

libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleHoverOut", function (event) {
const handle = event.data.handle;
Expand All @@ -37,13 +39,13 @@ Hooks.once("libWrapper.Ready", () => {
} else if (handle) {
handle.scale.set(1.0, 1.0);
}
}, "OVERRIDE");
}, libWrapper.OVERRIDE);

libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleMouseDown", function (event) {
if (!this.document.locked) {
this._dragHandle = true;
}
}, "OVERRIDE");
}, libWrapper.OVERRIDE);

libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleDragStart", function (event) {
this._original = this.document.toObject();
Expand Down Expand Up @@ -71,7 +73,7 @@ Hooks.once("libWrapper.Ready", () => {
this.document.updateSource(update);
this.refresh();
}
}, "OVERRIDE");
}, libWrapper.OVERRIDE);

libWrapper.register(MODULE_ID, "Drawing.prototype._onHandleDragMove", function (event) {
const { handle, destination, origin, originalEvent } = event.data;
Expand Down Expand Up @@ -110,7 +112,7 @@ Hooks.once("libWrapper.Ready", () => {
this.document.updateSource(update);
this.refresh();
} catch (err) { }
}, "OVERRIDE");
}, libWrapper.OVERRIDE);

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

return this.document.update(update, { diff: false });
}, "OVERRIDE");
}, libWrapper.OVERRIDE);

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

return wrapped(event);
}, "MIXED");
}, libWrapper.MIXED);
});

Drawing.prototype._onHandleMouseUp = function (event) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Hooks.once("libWrapper.Ready", () => {
else if (size >= 64) return 8;
else if (size >= 32) return 4;
return 1;
}, "OVERRIDE");
}, libWrapper.OVERRIDE);
libWrapper.ignore_conflicts(MODULE_ID, "precise-drawing-tools", "DrawingsLayer.prototype.gridPrecision");

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

function preProcess(data) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Hooks.once("libWrapper.Ready", () => {
if (conclude) {
this.release();
}
}, "OVERRIDE");
}, libWrapper.OVERRIDE);
});

Hooks.on("refreshDrawing", drawing => {
Expand Down

0 comments on commit 11b905f

Please sign in to comment.