Attempted wrapping of hook

This commit is contained in:
Alexander
2023-12-10 20:04:07 +01:00
parent a2398071ec
commit 5f1e04efc3
2 changed files with 19 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
"id": "on-site-vtt", "id": "on-site-vtt",
"title": "On-Site VTT - Virtual Tabletop, now with less virtual", "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.", "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": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "11" "verified": "11"
@@ -27,7 +27,7 @@
], ],
"url": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT", "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", "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", "bugs": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/issues",
"readme": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/main/README.md", "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", "license" :"https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/main/LICENSE.txt",

View File

@@ -1,14 +1,21 @@
Hooks.on('init', function () { if(game.modules.get("on-site-vtt")?.active) {
Hooks.on('getSceneControlButtons', (controls: SceneControl[]) => { Hooks.on("init", function () {
controls.find(x => x.name === 'token').tools.push({ Hooks.on(
name: 'rotateView', "getSceneControlButtons",
title: 'on-site-vtt.rotate', (controls: SceneControl[]) => {
icon: 'fas fa-refresh', controls.find(x => x.name === 'token').tools.push({
onClick: () => rotateView(), name: "rotateView",
button: true title: "on-site-vtt.rotate",
}); icon: "fas fa-refresh",
visible: true,
toggle: false,
active: false,
button: true,
onClick: () => rotateView(),
});
});
}); });
}); }
function rotateView() { function rotateView() {
if(document.getElementsByTagName("body")[0].className.includes("nsvRotate")) { if(document.getElementsByTagName("body")[0].className.includes("nsvRotate")) {