Attempted wrapping of hook
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"id": "on-site-vtt",
|
||||
"title": "On-Site VTT - Virtual Tabletop, now with less virtual",
|
||||
"description": "A simple module adding functionality to improve playability for multiple players on a single screen/digital map.",
|
||||
"version": "0.0.3",
|
||||
"version": "0.0.4",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "11"
|
||||
@@ -27,7 +27,7 @@
|
||||
],
|
||||
"url": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT",
|
||||
"manifest": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/main/on-site-vtt/module.json",
|
||||
"download": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/archive/0.0.3.zip",
|
||||
"download": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/archive/0.0.4.zip",
|
||||
"bugs": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/issues",
|
||||
"readme": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/main/README.md",
|
||||
"license" :"https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/main/LICENSE.txt",
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
Hooks.on('init', function () {
|
||||
Hooks.on('getSceneControlButtons', (controls: SceneControl[]) => {
|
||||
if(game.modules.get("on-site-vtt")?.active) {
|
||||
Hooks.on("init", function () {
|
||||
Hooks.on(
|
||||
"getSceneControlButtons",
|
||||
(controls: SceneControl[]) => {
|
||||
controls.find(x => x.name === 'token').tools.push({
|
||||
name: 'rotateView',
|
||||
title: 'on-site-vtt.rotate',
|
||||
icon: 'fas fa-refresh',
|
||||
name: "rotateView",
|
||||
title: "on-site-vtt.rotate",
|
||||
icon: "fas fa-refresh",
|
||||
visible: true,
|
||||
toggle: false,
|
||||
active: false,
|
||||
button: true,
|
||||
onClick: () => rotateView(),
|
||||
button: true
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function rotateView() {
|
||||
if(document.getElementsByTagName("body")[0].className.includes("nsvRotate")) {
|
||||
|
||||
Reference in New Issue
Block a user