Skip to content

Commit

Permalink
Merge pull request #19 from etiquettestartshere/1.0.2
Browse files Browse the repository at this point in the history
1.0.2
  • Loading branch information
etiquettestartshere authored Mar 7, 2024
2 parents 1c01af1 + 0d9270a commit 4c33cf6
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 13 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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 }}
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.*
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"minimum": "11",
"verified": "11"
},
"esmodules": ["setup.mjs"],
"esmodules": ["scripts/setup.mjs"],
"styles": ["styles/effectivetray.css"],
"relationships": {
"systems": [
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions scripts/effective-tray.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ 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;
for (const effect of effects) {
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});
};
};
};
Expand Down Expand Up @@ -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 });
Expand Down
6 changes: 6 additions & 0 deletions scripts/setup.mjs
Original file line number Diff line number Diff line change
@@ -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);
6 changes: 0 additions & 6 deletions setup.mjs

This file was deleted.

0 comments on commit 4c33cf6

Please sign in to comment.