38 Commits

Author SHA1 Message Date
Alexander
29c564380d feat(infra): Adds pre-comit setup and conventional commit message enforment
All checks were successful
On-Site VTT - Develop / build (push) Successful in 2m50s
Adds git-hooks for pre-commit package and configuration for repository checks and commit messages
2023-12-11 21:46:45 +01:00
Alexander
a8d01fd9bf Update pipelines
All checks were successful
On-Site VTT - Develop / build (push) Successful in 3m19s
2023-12-11 13:52:23 +01:00
Alexander
402c6da5df Preparation for main-pipeline 2023-12-11 13:47:49 +01:00
Alexander
f9fefaf404 Fixes locations of files in module 2023-12-11 13:22:56 +01:00
Alexander
fa3c98d2b7 Adds ready method and fixes spelling
All checks were successful
On-Site VTT - Develop / build (push) Successful in 2m44s
2023-12-11 13:11:30 +01:00
Alexander
69970fc5b6 Adds module.json to release output
All checks were successful
On-Site VTT - Develop / build (push) Successful in 3m17s
2023-12-11 12:15:02 +01:00
Alexander
95d74f841a zip issues
All checks were successful
On-Site VTT - Develop / build (push) Successful in 3m13s
2023-12-11 10:13:53 +01:00
Alexander
e62d45a936 zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m27s
2023-12-11 09:59:03 +01:00
Alexander
6e16d82d05 zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m24s
2023-12-11 09:17:11 +01:00
Alexander
0ca0dab066 zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 7s
2023-12-11 09:15:10 +01:00
Alexander
5ce7d937e8 zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m47s
2023-12-11 09:09:04 +01:00
Alexander
973a06e0b5 zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m47s
2023-12-11 09:01:51 +01:00
Alexander
25716a3cdb zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 3m7s
2023-12-11 08:47:02 +01:00
Alexander
903695dc95 zip issues
All checks were successful
On-Site VTT - Develop / build (push) Successful in 1m12s
2023-12-11 08:28:48 +01:00
Alexander
6b7c8adc47 zip issues
All checks were successful
On-Site VTT - Develop / build (push) Successful in 1m26s
2023-12-11 08:26:01 +01:00
Alexander
f274f6f237 zip issues
All checks were successful
On-Site VTT - Develop / build (push) Successful in 1m12s
2023-12-11 08:23:18 +01:00
Alexander
09c2a51e1e zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m19s
2023-12-11 08:20:10 +01:00
Alexander
70778f0e4f zip issues
Some checks are pending
On-Site VTT - Develop / build (push) Waiting to run
2023-12-11 08:16:10 +01:00
Alexander
aff154c514 zip issues
Some checks are pending
On-Site VTT - Develop / build (push) Waiting to run
2023-12-10 23:18:42 +01:00
Alexander
e8dc220e8c zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m2s
2023-12-10 23:13:22 +01:00
Alexander
47240cc1b9 zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 2m56s
2023-12-10 23:06:33 +01:00
Alexander
81ccfca6e3 zip issues
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m33s
2023-12-10 23:00:58 +01:00
Alexander
fca0144f01 zip issues
All checks were successful
On-Site VTT - Develop / build (push) Successful in 1m25s
2023-12-10 22:58:01 +01:00
Alexander
86a11a92c2 seperate packing
All checks were successful
On-Site VTT - Develop / build (push) Successful in 1m23s
2023-12-10 22:54:30 +01:00
Alexander
8f3bd53a48 seperate packing
Some checks failed
On-Site VTT - Develop / build (push) Failing after 1m19s
2023-12-10 22:47:18 +01:00
Alexander
8c28884fcb Starting pipeline
Some checks failed
On-Site VTT - Develop / build (push) Failing after 3m44s
2023-12-10 22:31:14 +01:00
Alexander
72558ca3b7 Forward from main
Some checks failed
On-Site VTT - Develop / build (push) Failing after 23s
2023-12-10 22:18:11 +01:00
Alexander
70d8762768 fixes for it being javascript 2023-12-10 21:22:37 +01:00
Alexander
61db04c71e 0.0.7 2023-12-10 21:07:17 +01:00
Alexander
453c52ca87 Reorganized structure 2023-12-10 21:00:31 +01:00
Alexander
e0d435e8d3 Adds logging output and uses esmodules 2023-12-10 20:15:45 +01:00
Alexander
5f1e04efc3 Attempted wrapping of hook 2023-12-10 20:04:07 +01:00
Alexander
a2398071ec Trying new button configuration 2023-12-10 19:23:03 +01:00
Alexander
f2f1d8416c Using correct release-path 2023-12-10 19:12:50 +01:00
Alexander
88ff20011a Fixes for missing attribute 2023-12-10 18:48:36 +01:00
Alexander
fbaa865790 Fake release for test 2023-12-10 18:45:41 +01:00
Alexander
a29709af61 Adds missing references to modules.json 2023-12-10 18:37:13 +01:00
Alexander
2cbeffc6a1 Implements basic logic for first throw 2023-12-10 18:00:02 +01:00
11 changed files with 154 additions and 55 deletions

View File

@@ -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}}"

View File

@@ -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}}"

21
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,21 @@
## See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-json
- id: check-byte-order-marker
- id: end-of-file-fixer
- id: mixed-line-ending
- id: detect-private-key
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.0.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [feat, fix, chore, test]

View File

@@ -0,0 +1 @@
# On-Site VTT

View File

@@ -1,3 +1,4 @@
{
"on-site-vtt.title": "On-Site VTT"
"on-site-vtt.title": "On-Site VTT",
"on-site-vtt.rotate": "Ansicht drehen"
}

View File

@@ -1,3 +1,4 @@
{
"on-site-vtt.title": "On-Site VTT"
"on-site-vtt.title": "On-Site VTT",
"on-site-vtt.rotate": "Rotate view"
}

View File

@@ -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"
]
}

View 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);

View File

@@ -0,0 +1,3 @@
.nsvRotate {
rotate: 180deg;
}