Skip to content

Commit

Permalink
Merge pull request #32 from eastcw/foundry-v12
Browse files Browse the repository at this point in the history
Foundry v12 compatibility
  • Loading branch information
eastcw authored Jun 19, 2024
2 parents dee02d1 + ec91816 commit e97b786
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 29 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -43,15 +43,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
run: npm run build

- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
Expand All @@ -93,10 +93,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download production artifacts for publication
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand All @@ -121,11 +121,11 @@ jobs:
prerelease: ${{ github.event.release.prerelease }}

# Publish this new version to the Foundry VTT Module Listing
- name: FoundryVTT AutoPublish
uses: Varriount/[email protected]
with:
username: ${{ secrets.FOUNDRY_ADMIN_USER }}
password: ${{ secrets.FOUNDRY_ADMIN_PW }}
module-id: ${{ secrets.FOUNDRY_MODULE_ID }}
manifest-url: https://github.com/${{github.repository}}/releases/download/v${{ steps.get_version.outputs.version-without-v }}/module.json
manifest-file: src/module.json
# - name: FoundryVTT AutoPublish
# uses: Varriount/[email protected]
# with:
# username: ${{ secrets.FOUNDRY_ADMIN_USER }}
# password: ${{ secrets.FOUNDRY_ADMIN_PW }}
# module-id: ${{ secrets.FOUNDRY_MODULE_ID }}
# manifest-url: https://github.com/${{github.repository}}/releases/download/v${{ steps.get_version.outputs.version-without-v }}/module.json
# manifest-file: src/module.json
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@
"lint-staged": {
"*.(js|cjs|mjs)": "eslint --fix",
"*.(json|yml|scss)": "prettier --write"
},
"dependencies": {
"all": "^0.0.0"
}
}
11 changes: 6 additions & 5 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
"manifest": "https://github.com/eastcw/foundryvtt-compactBeyond5eSheet/releases/latest/download/module.json",
"readme": "https://github.com/eastcw/foundryvtt-compactBeyond5eSheet/blob/master/README.md",
"url": "https://github.com/eastcw/foundryvtt-compactBeyond5eSheet/",
"version": "3.1.0",
"version": "3.2.0-beta1",
"compatibility": {
"minimum": "11",
"verified": "11.315"
"verified": "12.324",
"maximum": "12"
},
"scripts": [],
"esmodules": ["module/foundryvtt-compactBeyond5eSheet.js"],
Expand All @@ -44,8 +45,8 @@
"id": "dnd5e",
"type": "system",
"compatibility": {
"minimum": "3.1.0",
"verified": "3.1.1"
"minimum": "3.2.0",
"verified": "3.2.0"
}
}
],
Expand All @@ -55,7 +56,7 @@
"type": "module",
"compatibility": {
"minimum": "7.1.0",
"verified": "7.1.0"
"verified": "7.1.1"
}
}
],
Expand Down
12 changes: 7 additions & 5 deletions src/module/compact-beyond-5e-sheet.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 Andrew Krigline
// SPDX-FileCopyrightText: 2024 Andrew Krigline & Cameron East
//
// SPDX-License-Identifier: MIT
import { CompactBeyond5e } from './foundryvtt-compactBeyond5eSheet.mjs';
Expand Down Expand Up @@ -28,7 +28,7 @@ export class CompactBeyond5eSheet extends dnd5e.applications.actor.ActorSheet5eC
const options = super.defaultOptions;

// inject our own css class and filter options
mergeObject(options, {
foundry.utils.mergeObject(options, {
classes: [...options.classes, 'cb5es'],
scrollY: [...options.scrollY, '.sheet-sidebar'],
height: 680,
Expand Down Expand Up @@ -122,16 +122,18 @@ export class CompactBeyond5eSheet extends dnd5e.applications.actor.ActorSheet5eC

// apply the bonuses if they are equivalent
if (bonuses.msak.attack === bonuses.rsak.attack) {
spellAttackModFormula.push(bonuses.msak.attack);
spellAttackModFormula.push(bonuses.msak.attack || 0);
} else if (!!bonuses.msak.attack && !!bonuses.rsak.attack) {
const formulaA = new Roll(bonuses.msak.attack);
const formulaB = new Roll(bonuses.rsak.attack);

// apply the lesser deterministic bonus
if (formulaA.isDeterministic && formulaB.isDeterministic) {
spellAttackModFormula.push(
Math.min(formulaA.evaluate({ async: false }).total, formulaB.evaluate({ async: false }.total))
let lesserBonus = Math.min(
formulaA.evaluate({ async: false }).total,
formulaB.evaluate({ async: false }.total)
);
spellAttackModFormula.push(lesserBonus || 0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/module/foundryvtt-compactBeyond5eSheet.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 Andrew Krigline
// SPDX-FileCopyrightText: 2024 Andrew Krigline & Cameron East
//
// SPDX-License-Identifier: MIT
import { CompactBeyond5eSheet } from './compact-beyond-5e-sheet.mjs';
Expand Down
2 changes: 1 addition & 1 deletion src/templates/character-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<span class="ability-save" data-tooltip="{{ localize 'DND5E.SavingThrow' }}">{{numberFormat ability.save decimals=0
sign=true}}</span>
</div>
<a class="config-button" data-action="ability" data-tooltip="{{localize 'DND5E.AbilityConfigure'}}">
<a class="config-button" data-action="ability" data-tooltip="{{localize "DND5E.AbilityConfigure" ability=ability.label}}">
<i class="fas fa-cog"></i>
</a>
</li>
Expand Down

0 comments on commit e97b786

Please sign in to comment.