[Support] Update Development Branch (#1001)

* add typo report template (#971)

Co-authored-by: Psitacus <walther.johnson@ucalgary.ca>

* Fix/fix weapon damage datas in sheet (#988)

* Temp ActionField attack type missing

* Move missing attack type to getModel

* Fix weapon base attack reseting on update

* [PR]Fix/allow deal damage button use owner (#985)

* Temp ActionField attack type missing

* Move missing attack type to getModel

* Fix player not allowed to use Deal Damage button if Actor not assigned

* Fix/add translation key for Unarmed Attack (#973)

Co-authored-by: Chris Ryan <chrisr@blackhole>

* Add setup script for development (#981)

* [PR] testing something (#995)

* testing something

* added template for PR test

* Initial Commit (#992)

---------

Co-authored-by: Psitacus <59754077+Psitacus@users.noreply.github.com>
Co-authored-by: Psitacus <walther.johnson@ucalgary.ca>
Co-authored-by: Dapoulp <74197441+Dapoulp@users.noreply.github.com>
Co-authored-by: Chris Ryan <73275196+chrisryan10@users.noreply.github.com>
Co-authored-by: Chris Ryan <chrisr@blackhole>
Co-authored-by: Luiz HD Costa <luiz.costa@hey.com>
Co-authored-by: Nikhil Nagarajan <potter.nikhil@gmail.com>
This commit is contained in:
Murilo Brito 2025-08-17 22:19:22 -03:00 committed by GitHub
parent 577ed5f491
commit 495575fba4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 186 additions and 25 deletions

2
.env.example Normal file
View file

@ -0,0 +1,2 @@
FOUNDRY_MAIN_PATH=/path/to/foundry/resources/app/main.js
FOUNDRY_DATA_PATH=/path/to/foundry/data

View file

@ -1,10 +1,10 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] - "
about: Create a bug report to help us identify issues and resolve them
title: "[Bug] <Insert Title here> "
labels: bug
type: bug
assignees: ''
---
**Describe the bug**
@ -24,11 +24,11 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**Setup Information:**
- OS: [e.g. iOS]
- OS: [e.g. iOS, Windows]
- Browser [e.g. chrome, safari]
- Foundry Version [e.g. v13 b342]
- System Version [e.g. main-3593f44]
- System Version [e.g. v.1.0, v.1.0.1]
**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.

View file

@ -0,0 +1,14 @@
---
name: Feature report
about: Create a feature report for suggestions on improving the system
title: "[Feature] <Insert Title here> "
labels: enhancement, discussion, maybe
type: feature
assignees: ''
---
**Description**
A clear and concise description of what feature needs to be implemented.
**Screenshots**
If applicable, add screenshots to help explain the feature that needs to be implemented.

9
.github/ISSUE_TEMPLATE/typo_report.md vendored Normal file
View file

@ -0,0 +1,9 @@
---
name: Typo report
about: Create a new issue to report a compendium typo
title: "[TYPO] - "
labels: compendium, typo
type: bug
assignees: ''
---

View file

@ -0,0 +1,55 @@
---
name: Pull Request
about: Create a new pull request
title: "[Community PR] <Insert Title here>"
labels: community pr
assignees: ''
---
## Description
Please include a summary of the change and which issue is fixed (if applicable). Also include relevant context or motivation for the change.
- Fixes #(issue)
- Closes #(issue)
## Type of Change
Please check the relevant options:
- [ ] Bug fix
- [ ] New feature
- [ ] Code cleanup/refactor
- [ ] Documentation update
- [ ] Test coverage
- [ ] Dependency update
- [ ] Configuration change
- [ ] Other (please describe):
## How Has This Been Tested?
Please describe the tests you ran to verify your changes:
- [ ] Manual testing
- [ ] Other:
## Screenshots (if applicable)
Include screenshots or GIFs to help explain your changes visually.
## Checklist
- [ ] My code follows the project style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code where necessary
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings or errors
- [ ] I have added tests that prove my fix or feature works
- [ ] New and existing tests pass locally with my changes
## Additional Comments
Add any other context or questions here.
---
> Thank you for your contribution! 🎉

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.vscode
.env
node_modules
/packs
Build

View file

@ -24,24 +24,41 @@ You can find the documentation here: https://github.com/Foundryborne/daggerheart
## Development Setup
- Open a terminal in the directory with the repo `cd <path>/<to>/<repo>`
- NOTE: The repo should be placed in the system files are or somewhere else and a link (if on linux) is placed in the system directory
- NOTE: Linux link can be made using `ln -snf <path to development folder> daggerheart` inside the system folder
- Install npm `npm install`
- Update package.json to match your profile
1. **Navigate to the repo directory:**
```
"start": "concurrently \"rollup -c --watch\" \"node C:/FoundryDev/resources/app/main.js --dataPath=C:/FoundryDevFiles --noupnp\" \"gulp\"",
"start-test": "node C:/FoundryDev/resources/app/main.js --dataPath=C:/FoundryDevFiles && rollup -c --watch && gulp",
```bash
cd <path>/<to>/<repo>
```
```
2. **Install dependencies:**
- Replace `C:/FoundryDev/resources/app/main.js` with `<your>/<path>/<to>/<foundry>/<main.js>`
- The main is likely in `<Foundry Install Location>/resouces/app/main.js`
- Replace `--dataPath=C:/FoundryDevFiles` with `<your>/<path>/<to>/<foundry>/<data>`
```bash
npm install
```
Now you should be able to build the app using `npm start`
[Foundry VTT Website][1]
3. **Configure your Foundry paths:**
```bash
npm run setup:dev -- --foundry-path="/path/to/foundry/main.js" --data-path="/path/to/data"
```
4. **Start developing:**
```bash
npm start
```
### Available Scripts
- `npm start` - Start development with file watching and Foundry launching
- `npm run build` - One-time build
- `npm run setup:dev -- --foundry-path="<path>" --data-path="<path>"` - Configure development environment
### Notes
- The repo should be placed in your Foundry `Data/systems/` directory or symlinked there
- Linux symlink can be made using `ln -snf <path to development folder> daggerheart` inside the systems folder
- Your `.env` file is ignored by git, so each developer can have their own configuration
[Foundry VTT Website][1]
[1]: https://foundryvtt.com/

View file

@ -1995,7 +1995,7 @@
"true": "True",
"type": "Type",
"unarmed": "Unarmed",
"unarmedStrike": "Unarmed Strike",
"unarmedAttack": "Unarmed Attack",
"unarmored": "Unarmored",
"use": "Use",
"used": "Used",

View file

@ -108,7 +108,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
async onRollDamage(event, message) {
event.stopPropagation();
const actor = await this.getActor(message.system.source.actor);
if (game.user.character?.id !== actor.id && !game.user.isGM) return true;
if(!actor.isOwner) return true;
if (message.system.source.item && message.system.source.action) {
const action = this.getAction(actor, message.system.source.item, message.system.source.action);
if (!action || !action?.rollDamage) return;

View file

@ -95,7 +95,7 @@ export default class DhCharacter extends BaseDataActor {
}),
attack: new ActionField({
initial: {
name: 'Unarmed Attack',
name: 'DAGGERHEART.GENERAL.unarmedAttack',
img: 'icons/skills/melee/unarmed-punch-fist-yellow-red.webp',
_id: foundry.utils.randomID(),
systemPath: 'attack',

View file

@ -28,6 +28,14 @@ export default class DHItem extends foundry.documents.Item {
return doc;
}
/* -------------------------------------------- */
/** @inheritDoc */
static migrateData(source) {
if(source.system?.attack && !source.system.attack.type) source.system.attack.type = "attack";
return super.migrateData(source);
}
/**
* @inheritdoc
* @param {object} options - Options which modify the getRollData method.

View file

@ -7,7 +7,7 @@
"rollup": "^4.40.0"
},
"scripts": {
"start": "concurrently \"rollup -c --watch\" \"node ../../../../FoundryDev/main.js --dataPath=../../../ --noupnp\" \"gulp\"",
"start": "node ./tools/run-start.mjs",
"start-test": "node ./resources/app/main.js --dataPath=./ && rollup -c --watch && gulp",
"build": "npm run rollup && npm run gulp",
"rollup": "rollup -c",
@ -16,7 +16,8 @@
"pushLDBtoYML": "node ./tools/pushLDBtoYML.mjs",
"pullYMLtoLDB": "node ./tools/pullYMLtoLDB.mjs",
"pullYMLtoLDBBuild": "node ./tools/pullYMLtoLDBBuild.mjs",
"createSymlink": "node ./tools/create-symlink.mjs"
"createSymlink": "node ./tools/create-symlink.mjs",
"setup:dev": "node ./tools/dev-setup.mjs"
},
"devDependencies": {
"@foundryvtt/foundryvtt-cli": "^1.0.2",

View file

@ -1,3 +1,12 @@
---
name: Pull Request
about: Create a new pull request
title: "[PR] <Insert Title here>"
labels: pr
assignees: ''
---
Is this a community PR? Please go to preview tab and click [here](?expand=1&template=community_pull_request_template.md). If not, delete this line.
## Description
Please include a summary of the change and which issue is fixed (if applicable). Also include relevant context or motivation for the change.

18
tools/dev-setup.mjs Normal file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env node
import fs from 'fs';
const args = process.argv.slice(2);
const foundryPath = args.find(arg => arg.startsWith('--foundry-path='))?.split('=')[1];
const dataPath = args.find(arg => arg.startsWith('--data-path='))?.split('=')[1];
if (!foundryPath || !dataPath) {
console.log('Usage: npm run setup:dev -- --foundry-path="/path/to/foundry/main.js" --data-path="/path/to/data"');
process.exit(1);
}
const envContent = `FOUNDRY_MAIN_PATH=${foundryPath}
FOUNDRY_DATA_PATH=${dataPath}
`;
fs.writeFileSync('.env', envContent);
console.log(`✅ Development environment configured: ${foundryPath}, ${dataPath}`);

27
tools/run-start.mjs Normal file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env node
import { spawn } from 'child_process';
import fs from 'fs';
// Load .env file if it exists
if (fs.existsSync('.env')) {
const envFile = fs.readFileSync('.env', 'utf8');
envFile.split('\n').forEach(line => {
const [key, value] = line.split('=');
if (key && value) {
process.env[key] = value;
}
});
}
// Set defaults if not in environment
const foundryPath = process.env.FOUNDRY_MAIN_PATH || '../../../../FoundryDev/main.js';
const dataPath = process.env.FOUNDRY_DATA_PATH || '../../../';
// Run the original command with proper environment
const args = ['rollup -c --watch', `node "${foundryPath}" --dataPath="${dataPath}" --noupnp`, 'gulp'];
spawn('npx', ['concurrently', ...args.map(arg => `"${arg}"`)], {
stdio: 'inherit',
cwd: process.cwd(),
shell: true
});