feat: add resources to weapons

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
This commit is contained in:
Gergely Brautigam 2026-07-02 19:56:17 +02:00
parent 8c6a470d84
commit cdc507c5f7
No known key found for this signature in database
GPG key ID: 3763870D61A6E2CA
7 changed files with 38 additions and 9 deletions

View file

@ -1,3 +1,4 @@
{ {
"js/ts.preferGoToSourceDefinition": true "js/ts.preferGoToSourceDefinition": true,
"codeQL.githubDatabase.download": "never"
} }

View file

@ -2,11 +2,17 @@
## Table of Contents ## Table of Contents
- [Overview](#overview) - [Foundryborne Daggerheart](#foundryborne-daggerheart)
- [User Install Guide](#user-install) - [Table of Contents](#table-of-contents)
- [Documentation](#documentation) - [Overview](#overview)
- [Developer Setup](#development-setup) - [User Install](#user-install)
- [Contribution Info](#contributing) - [Documentation](#documentation)
- [Development Setup](#development-setup)
- [Available Scripts](#available-scripts)
- [Notes](#notes)
- [Contributing](#contributing)
- [AI Policy](#ai-policy)
- [Disclaimer](#disclaimer)
## Overview ## Overview
@ -72,7 +78,7 @@ Looking to contribute to the project? Look no further, check out our [contributi
The Foundryborne Daggerheart system does not make use of AI (generative or otherwise) for any area of its implementation. We expect all contributors to follow this same policy when contributing with a pull request; contributions made using AI will be rejected outright. The Foundryborne Daggerheart system does not make use of AI (generative or otherwise) for any area of its implementation. We expect all contributors to follow this same policy when contributing with a pull request; contributions made using AI will be rejected outright.
## Disclaimer: ## Disclaimer
**Daggerheart System** **Daggerheart System**
Daggerheart is a trademark of Darrington Press LLC. All original content, mechanics, and intellectual property related to the Daggerheart roleplaying game are © Darrington Press LLC. Daggerheart is a trademark of Darrington Press LLC. All original content, mechanics, and intellectual property related to the Daggerheart roleplaying game are © Darrington Press LLC.

View file

@ -9,7 +9,8 @@ export default class DHWeapon extends AttachableItem {
type: 'weapon', type: 'weapon',
hasDescription: true, hasDescription: true,
isInventoryItem: true, isInventoryItem: true,
hasActions: true hasActions: true,
hasResource: true
}); });
} }

View file

@ -243,6 +243,13 @@
/ 40px 1fr min-content; / 40px 1fr min-content;
column-gap: 8px; column-gap: 8px;
&:has(> .item-resource, > .item-resources) {
grid-template:
'img name resource controls' auto
'img labels labels labels' 1fr
/ 40px 1fr min-content min-content;
}
> .img-portait { > .img-portait {
grid-area: img; grid-area: img;
} }
@ -251,6 +258,15 @@
line-height: 1; line-height: 1;
padding-bottom: 1px; padding-bottom: 1px;
} }
> .item-resource,
> .item-resources {
grid-area: resource;
align-self: center;
input {
width: 40px;
}
}
> .controls { > .controls {
grid-area: controls; grid-area: controls;
align-self: start; align-self: start;

View file

@ -23,7 +23,6 @@
collection=@root.inventory.weapons collection=@root.inventory.weapons
isGlassy=true isGlassy=true
canCreate=@root.editable canCreate=@root.editable
hideResources=true
}} }}
{{> 'daggerheart.inventory-items' {{> 'daggerheart.inventory-items'
title='TYPES.Item.armor' title='TYPES.Item.armor'

View file

@ -17,6 +17,11 @@
{{!-- Item Name --}} {{!-- Item Name --}}
<span class="item-name">{{localize item.name}}</span> <span class="item-name">{{localize item.name}}</span>
{{!-- Resource --}}
{{#if (and (eq type 'weapon') item.system.resource)}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{!-- Tags Start --}} {{!-- Tags Start --}}
{{#with item}} {{#with item}}
<div class="item-labels"> <div class="item-labels">

View file

@ -45,4 +45,5 @@
<span>{{localize "TYPES.Item.feature"}}</span> <span>{{localize "TYPES.Item.feature"}}</span>
<input type="text" class="features-input" value="{{features}}" /> <input type="text" class="features-input" value="{{features}}" />
</fieldset> </fieldset>
{{> "systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs" }}
</section> </section>