Compare commits
37 Commits
main
...
dev-2023-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8d01fd9bf
|
||
|
|
402c6da5df
|
||
|
|
f9fefaf404
|
||
|
|
fa3c98d2b7
|
||
|
|
69970fc5b6
|
||
|
|
95d74f841a
|
||
|
|
e62d45a936
|
||
|
|
6e16d82d05
|
||
|
|
0ca0dab066
|
||
|
|
5ce7d937e8
|
||
|
|
973a06e0b5
|
||
|
|
25716a3cdb
|
||
|
|
903695dc95
|
||
|
|
6b7c8adc47
|
||
|
|
f274f6f237
|
||
|
|
09c2a51e1e
|
||
|
|
70778f0e4f
|
||
|
|
aff154c514
|
||
|
|
e8dc220e8c
|
||
|
|
47240cc1b9
|
||
|
|
81ccfca6e3
|
||
|
|
fca0144f01
|
||
|
|
86a11a92c2
|
||
|
|
8f3bd53a48
|
||
|
|
8c28884fcb
|
||
|
|
72558ca3b7
|
||
|
|
70d8762768
|
||
|
|
61db04c71e
|
||
|
|
453c52ca87
|
||
|
|
e0d435e8d3
|
||
|
|
5f1e04efc3
|
||
|
|
a2398071ec
|
||
|
|
f2f1d8416c
|
||
|
|
88ff20011a
|
||
|
|
fbaa865790
|
||
|
|
a29709af61
|
||
|
|
2cbeffc6a1
|
@@ -9,28 +9,42 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.20'
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H-%M-%S')"
|
||||
- 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 }}
|
||||
replace: dev-${{ steps.date.outputs.date }}
|
||||
include: "on-site-vtt/module.json"
|
||||
- name: Replace branch in module.json
|
||||
uses: jacobtomlinson/gha-find-replace@v3
|
||||
with:
|
||||
find: "{{branch}}"
|
||||
replace: ${{ github.ref }}
|
||||
replace: ${{ github.ref_name }}
|
||||
include: "on-site-vtt/module.json"
|
||||
- name: Pack and release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
- name: Pack archive
|
||||
uses: montudor/action-zip@v1
|
||||
with:
|
||||
args: zip -r on-site-vtt.zip on-site-vtt
|
||||
- name: publish release
|
||||
uses: https://gitea.aweleczka.de/actions/release-action@main
|
||||
with:
|
||||
title: dev-${{ steps.date.outputs.date }}
|
||||
tag_name: dev-${{ steps.date.outputs.date }}
|
||||
files: |-
|
||||
on-site-vtt/**
|
||||
"LICENSE.txt"
|
||||
"README.md"
|
||||
"on-site-vtt/module.json"
|
||||
"on-site-vtt.zip"
|
||||
pre_release: true
|
||||
api_key: "${{secrets.RELEASE_TOKEN}}"
|
||||
|
||||
@@ -5,12 +5,14 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.20'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -27,9 +29,19 @@ jobs:
|
||||
find: "{{branch}}"
|
||||
replace: ${{ github.ref }}
|
||||
include: "on-site-vtt/module.json"
|
||||
- name: Pack and release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
- name: Pack archive
|
||||
uses: montudor/action-zip@v1
|
||||
with:
|
||||
args: zip -r on-site-vtt.zip on-site-vtt
|
||||
- name: publish release
|
||||
uses: https://gitea.aweleczka.de/actions/release-action@main
|
||||
with:
|
||||
title: dev-${{ steps.date.outputs.date }}
|
||||
tag_name: dev-${{ steps.date.outputs.date }}
|
||||
files: |-
|
||||
on-site-vtt/**
|
||||
"LICENSE.txt"
|
||||
"README.md"
|
||||
"on-site-vtt/module.json"
|
||||
"on-site-vtt.zip"
|
||||
pre_release: true
|
||||
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"
|
||||
}
|
||||
@@ -26,13 +26,18 @@
|
||||
}
|
||||
],
|
||||
"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",
|
||||
"download": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/releases/download/{{version}}/on-site-vtt.zip",
|
||||
"bugs": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/issues",
|
||||
"readme": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/{{branch}}/README.md",
|
||||
"license" :"https://gitea.aweleczka.de/aweleczka/On-Site-VTT/raw/branch/{{branch}}/LICENSE.txt",
|
||||
"manifest": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/releases/download/{{version}}/module.json",
|
||||
"download": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/releases/download/{{version}}/on-site-vtt.zip",
|
||||
"readme": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/releases/download/{{version}}/README.md",
|
||||
"license": "https://gitea.aweleczka.de/aweleczka/On-Site-VTT/releases/download/{{version}}/LICENSE.txt",
|
||||
"flags": {
|
||||
"allowBugReporter": true
|
||||
}
|
||||
|
||||
},
|
||||
"styles": [
|
||||
"./styles/on-site-vtt.css"
|
||||
],
|
||||
"esmodules": [
|
||||
"./scripts/on-site-vtt.js"
|
||||
]
|
||||
}
|
||||
41
on-site-vtt/scripts/on-site-vtt.js
Normal file
41
on-site-vtt/scripts/on-site-vtt.js
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
function init() {
|
||||
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 ready() {
|
||||
console.log("on-site-vtt | Ready");
|
||||
}
|
||||
|
||||
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);
|
||||
Hooks.on("ready", ready);
|
||||
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