Skip to content

Commit

Permalink
Merge branch 'development' of github.com:TheGiddyLimit/5etoolsR20 int…
Browse files Browse the repository at this point in the history
…o development
  • Loading branch information
TheGiddyLimit committed Nov 26, 2023
2 parents 462107e + 60d1ac6 commit e11e78a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/5etools-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const betteR205etools = function () {
d20plus.weather.addWeather();
d20plus.engine.repairPrototypeMethods();
d20plus.engine.disableFrameRecorder();
d20plus.engine.fixPolygonTool();
// d20plus.ut.fixSidebarLayout();
d20plus.chat.enhanceChat();

Expand Down
12 changes: 12 additions & 0 deletions js/base-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,18 @@ function d20plusEngine () {
d20.engine.frame_recorder._active = false;
}
};

d20plus.engine.fixPolygonTool = () => {
if (d20plus.isOptedInNewUI) return;
$("#editor-wrapper").on("pointerdown", x => { d20plus.engine.leftClicked = x.which === 1 });
$("#editor-wrapper").on("pointerup", x => { d20plus.engine.leftClicked = false });
d20plus.ut.injectCode(d20.engine, "finishCurrentPolygon", (finishDrawing, params) => {
if (!d20plus.engine.leftClicked) finishDrawing(...params);
});
d20plus.ut.injectCode(d20.engine, "finishPolygonReveal", (finishRevealing, params) => {
if (!d20plus.engine.leftClicked) finishRevealing(...params);
});
};
}

SCRIPT_EXTENSIONS.push(d20plusEngine);
1 change: 1 addition & 0 deletions js/core-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const betteR20Core = function () {
d20plus.weather.addWeather();
d20plus.engine.repairPrototypeMethods();
d20plus.engine.disableFrameRecorder();
d20plus.engine.fixPolygonTool();
// d20plus.ut.fixSidebarLayout();
d20plus.chat.enhanceChat();

Expand Down

0 comments on commit e11e78a

Please sign in to comment.