Compare commits
11 Commits
main
...
70d8762768
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70d8762768
|
||
|
|
61db04c71e
|
||
|
|
453c52ca87
|
||
|
|
e0d435e8d3
|
||
|
|
5f1e04efc3
|
||
|
|
a2398071ec
|
||
|
|
f2f1d8416c
|
||
|
|
88ff20011a
|
||
|
|
fbaa865790
|
||
|
|
a29709af61
|
||
|
|
2cbeffc6a1
|
@@ -1,36 +0,0 @@
|
|||||||
name: On-Site VTT - Develop
|
|
||||||
run-name: Run on ${{ github.ref }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Get current date
|
|
||||||
id: date
|
|
||||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
||||||
- name: Replace version in module.json
|
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
|
||||||
with:
|
|
||||||
find: "{{version}}"
|
|
||||||
replace: dev-${{ steps.date.outputs.date }}-${{ github.run_number }}
|
|
||||||
include: "on-site-vtt/module.json"
|
|
||||||
- name: Replace branch in module.json
|
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
|
||||||
with:
|
|
||||||
find: "{{branch}}"
|
|
||||||
replace: ${{ github.ref }}
|
|
||||||
include: "on-site-vtt/module.json"
|
|
||||||
- name: Pack and release
|
|
||||||
uses: https://gitea.com/actions/release-action@main
|
|
||||||
with:
|
|
||||||
files: |-
|
|
||||||
on-site-vtt/**
|
|
||||||
api_key: "${{secrets.RELEASE_TOKEN}}"
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
name: On-Site VTT - Release
|
|
||||||
run-name: Run for tag ${{ github.ref_name }} on ${{ github.ref }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
tags:
|
|
||||||
- "*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Replace version in module.json
|
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
|
||||||
with:
|
|
||||||
find: "{{version}}"
|
|
||||||
replace: ${{ github.ref_name }}
|
|
||||||
include: "on-site-vtt/module.json"
|
|
||||||
- name: Replace branch in module.json
|
|
||||||
uses: jacobtomlinson/gha-find-replace@v3
|
|
||||||
with:
|
|
||||||
find: "{{branch}}"
|
|
||||||
replace: ${{ github.ref }}
|
|
||||||
include: "on-site-vtt/module.json"
|
|
||||||
- name: Pack and release
|
|
||||||
uses: https://gitea.com/actions/release-action@main
|
|
||||||
with:
|
|
||||||
files: |-
|
|
||||||
on-site-vtt/**
|
|
||||||
api_key: "${{secrets.RELEASE_TOKEN}}"
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"on-site-vtt.title": "On-Site VTT"
|
"on-site-vtt.title": "On-Site VTT",
|
||||||
|
"on-site-vtt.rotate": "Ansicht drehen"
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"on-site-vtt.title": "On-Site VTT"
|
"on-site-vtt.title": "On-Site VTT",
|
||||||
|
"on-site-vtt.rotate": "Rotate view"
|
||||||
}
|
}
|
||||||
@@ -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": "{{version}}",
|
"version": "0.0.8",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
"verified": "11"
|
"verified": "11"
|
||||||
@@ -26,13 +26,18 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"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/{{branch}}/on-site-vtt/module.json",
|
"manifest": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/develop/on-site-vtt/module.json",
|
||||||
"download": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/releases/download/{{version}}/on-site-vtt.zip",
|
"download": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/releases/download/0.0.8/on-site-vtt_0.0.8.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/{{branch}}/README.md",
|
"readme": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/develop/README.md",
|
||||||
"license" :"https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/{{branch}}/LICENSE.txt",
|
"license" :"https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/develop/LICENSE.txt",
|
||||||
"flags": {
|
"flags": {
|
||||||
"allowBugReporter": true
|
"allowBugReporter": true
|
||||||
}
|
},
|
||||||
|
"styles": [
|
||||||
}
|
"./styles/on-site-vtt.css"
|
||||||
|
],
|
||||||
|
"esmodules": [
|
||||||
|
"./scripts/on-site-vtt.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
37
on-site-vtt/scripts/on-site-vtt.js
Normal file
37
on-site-vtt/scripts/on-site-vtt.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
function inti() {
|
||||||
|
if (game.modules.get("on-site-vtt")?.active) {
|
||||||
|
console.log("on-site-vtt | Enabled");
|
||||||
|
|
||||||
|
Hooks.on(
|
||||||
|
"getSceneControlButtons",
|
||||||
|
(controls) => {
|
||||||
|
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(),
|
||||||
|
});
|
||||||
|
console.log("on-site-vtt | Added control button");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log("on-site-vtt | Disabled");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function rotateView() {
|
||||||
|
if (document.getElementsByTagName("body")[0].className.includes("nsvRotate")) {
|
||||||
|
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, '')
|
||||||
|
} else {
|
||||||
|
document.getElementsByTagName("body")[0].className += " nsvRotate";
|
||||||
|
document.getElementById("board").className += " nsvRotate";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Hooks.on("init", init);
|
||||||
3
on-site-vtt/styles/on-site-vtt.css
Normal file
3
on-site-vtt/styles/on-site-vtt.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.nsvRotate {
|
||||||
|
rotate: 180deg;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user