diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3fb34b7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: Release Creation + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Get part of the tag after the `v`. + - name: Extract tag version number + id: get_version + uses: battila7/get-version-action@v2 + + # Remove HotReload and update version and download properties. + - name: Modify Manifest to remove HotReload + uses: microsoft/variable-substitution@v1 + with: + files: "module.json" + env: + flags.hotReload: false + version: ${{steps.get_version.outputs.version-without-v}} + download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip + + # Create zip file. + - name: Create ZIP archive + run: zip -r ./module.zip module.json LICENSE styles/ scripts/ lang/ + + # Create a release for this specific version. + - name: Update Release with Files + id: create_version_release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + name: ${{ github.event.release.name }} + draft: false + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: "./module.json, ./module.zip" + tag: ${{ github.event.release.tag_name }} + body: ${{ github.event.release.body }} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4884f7e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,11 @@ +# Contributing to Effective Tray +- If you want to contribute, if your fix or suggestion is short and easy to understand, you can just make a PR. For anything more complicated, please make an issue first. +- Any style is fine, any kind of suggestion is fine. PRs that touch more than one issue or idea are also fine as long as they come with an explanation. +- Bear in mind my skill is limited and that will change what might get implemented. +※ *Please do not change anything to typescript.* + +## Branches to Target +- For small fixes, target the branch with the version the smallest increment up from the current release (generally **N.N.X**). +- For fixes in line with a major system release, target the next major release (generally **N.X.N**). +- Generally speaking, make your PR targets branches with current milestones. +※ *If the above information becomes inapplicable, perhaps because I forgot to update it, just target the main branch.* \ No newline at end of file diff --git a/README.md b/README.md index c4ff8cb..b067990 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Effective Tray (for D&D Fifth Edition) A module for dnd5e on foundryvtt that allows the effects tray to be used more effectively. -## What it does -#### TLDR: Left click to apply to selected tokens, right click to apply to targeted tokens. +## What it does: left click to apply to selected tokens, right click to apply to targeted tokens. Allows users to apply active effects to tokens from chat cards even if they do not own the actor that made the chat card. - Adds a setting (on by default) that allows users to apply effects to targeted tokens by right clicking the apply button. - Adds a setting (on by default) that starts the effects tray in its expanded position. diff --git a/module.json b/module.json index debb5a9..14bb87c 100644 --- a/module.json +++ b/module.json @@ -6,7 +6,7 @@ "minimum": "11", "verified": "11" }, - "esmodules": ["setup.mjs"], + "esmodules": ["scripts/setup.mjs"], "styles": ["styles/effectivetray.css"], "relationships": { "systems": [ @@ -25,7 +25,7 @@ "flags": {} } ], - "flags": {"hotReload": {"extensions": ["css"], "paths": ["styles/effectivetray.css"]}}, + "flags": {"hotReload": {"extensions": ["css", "json"], "paths": ["styles/effectivetray.css", "lang"]}}, "socket": true, "url": "https://github.com/etiquettestartshere/effectivetray", "manifest": "https://github.com/etiquettestartshere/effectivetray/releases/latest/download/module.json", diff --git a/scripts/effective-tray.mjs b/scripts/effective-tray.mjs index 0c95dc8..60294fd 100644 --- a/scripts/effective-tray.mjs +++ b/scripts/effective-tray.mjs @@ -17,7 +17,7 @@ export class effectiveTray { }; // Remove transfer from all effects with duration - static async _removeTransfer(item) { + static _removeTransfer(item) { if (!game.settings.get(MODULE, "removeTransfer")) return; const effects = item.effects.contents; if (!effects) return; @@ -25,7 +25,7 @@ export class effectiveTray { const transfer = effect.transfer; const duration = effect.duration; if (transfer && (duration.seconds || duration.turns || duration.rounds)) { - await effect.updateSource({"transfer": false}); + effect.updateSource({"transfer": false}); }; }; }; @@ -132,7 +132,7 @@ export class effectiveSocket { }; // Apply effect, or toggle it if it exists -async function _applyEffects(actor, effect) { +function _applyEffects(actor, effect) { const existingEffect = actor.effects.find(e => e.origin === effect.uuid); if (existingEffect) { if (!game.settings.get(MODULE, "deleteInstead")) existingEffect.update({ disabled: !existingEffect.disabled }); diff --git a/scripts/setup.mjs b/scripts/setup.mjs new file mode 100644 index 0000000..224200b --- /dev/null +++ b/scripts/setup.mjs @@ -0,0 +1,6 @@ +import { moduleSettings } from "./settings.mjs"; +import { effectiveSocket, effectiveTray } from "./effective-tray.mjs"; + +Hooks.once("init", effectiveSocket.init); +Hooks.once("init", moduleSettings.init); +Hooks.once("init", effectiveTray.init); \ No newline at end of file diff --git a/setup.mjs b/setup.mjs deleted file mode 100644 index adc11d1..0000000 --- a/setup.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import { moduleSettings } from "./scripts/settings.mjs"; -import { effectiveSocket, effectiveTray } from "./scripts/effective-tray.mjs"; - -Hooks.once("init", effectiveSocket.init); -Hooks.once("init", moduleSettings.init); -Hooks.once("init", effectiveTray.init); \ No newline at end of file