Attempted wrapping of hook
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
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',
|
||||
onClick: () => rotateView(),
|
||||
button: true
|
||||
});
|
||||
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",
|
||||
visible: true,
|
||||
toggle: false,
|
||||
active: false,
|
||||
button: true,
|
||||
onClick: () => rotateView(),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function rotateView() {
|
||||
if(document.getElementsByTagName("body")[0].className.includes("nsvRotate")) {
|
||||
|
||||
Reference in New Issue
Block a user