Reorganized structure

This commit is contained in:
Alexander
2023-12-10 21:00:31 +01:00
parent e0d435e8d3
commit 453c52ca87
2 changed files with 17 additions and 10 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.5", "version": "0.0.6",
"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.5.zip", "download": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/archive/0.0.6.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,7 +1,8 @@
if(game.modules.get("on-site-vtt")?.active) {
console.log("on-site-vtt active");
Hooks.on("init", function () { function inti() {
if (game.modules.get("on-site-vtt")?.active) {
console.log("on-site-vtt | Enabled");
Hooks.on( Hooks.on(
"getSceneControlButtons", "getSceneControlButtons",
(controls: SceneControl[]) => { (controls: SceneControl[]) => {
@@ -15,16 +16,22 @@ if(game.modules.get("on-site-vtt")?.active) {
button: true, button: true,
onClick: () => rotateView(), onClick: () => rotateView(),
}); });
console.log("on-site-vtt | Added control button");
}); });
}); } else {
console.log("on-site-vtt | Disabled");
}
} }
function rotateView() { function rotateView() {
if(document.getElementsByTagName("body")[0].className.includes("nsvRotate")) { if (document.getElementsByTagName("body")[0].className.includes("nsvRotate")) {
document.getElementsByTagName("body")[0].className = document.getElementsByTagName("body")[0].className.replace( /(?:^|\s)nsvRotate(?!\S)/g , '' ) document.getElementsByTagName("body")[0].className = document.getElementsByTagName("body")[0].className.replace(/(?:^|\s)nsvRotate(?!\S)/g, '')
document.getElementById("board").className = document.getElementById("board").className.replace( /(?:^|\s)nsvRotate(?!\S)/g , '' ) document.getElementById("board").className = document.getElementById("board").className.replace(/(?:^|\s)nsvRotate(?!\S)/g, '')
} else { } else {
document.getElementsByTagName("body")[0].className += " nsvRotate"; document.getElementsByTagName("body")[0].className += " nsvRotate";
document.getElementById("board").className += " nsvRotate"; document.getElementById("board").className += " nsvRotate";
} }
} }
Hooks.on("init", init);