[Feature] Item Resource Support (#328)

* Initial

* Resource setup finished

* Fixed so that costs can be used

* Corrected standard resources

* Actions can only use item resources from their parent item

* Fixed up dice

* Fixed resource dice positioning

* Fixed parsing of resource.max

* Fixed styling on settings tab

* Added manual input for Dice Resources

* Lightmode fixes

* Fixed Feature spellcasting modifier

* Bugfix for item input to resourceDiceDialog

* Item fix for TokenInput

* PR Fixes
This commit is contained in:
WBHarry 2025-07-14 01:12:32 +02:00 committed by GitHub
parent eefa116d9a
commit 4be3e6179c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 972 additions and 329 deletions

View file

@ -4,6 +4,8 @@
@import './level-up/summary-container.less';
@import './level-up/tiers-container.less';
@import './resource-dice/sheet.less';
@import './actions/action-list.less';
@import './damage-selection/sheet.less';

View file

@ -0,0 +1,58 @@
.theme-light .daggerheart.dialog.dh-style.views.resource-dice {
.resource-items .resource-item {
input {
background-image: url('../assets/parchments/dh-parchment-light.png');
}
img {
filter: brightness(0) saturate(100%);
}
}
}
.daggerheart.dialog.dh-style.views.resource-dice {
.reroll-confirmation {
margin-bottom: 8px;
}
.resource-items {
display: flex;
justify-content: center;
gap: 8px;
.resource-item {
position: relative;
display: flex;
align-items: center;
justify-content: center;
input {
position: absolute;
border-color: light-dark(@dark-blue, @golden);
color: light-dark(black, white);
background-image: url('../assets/parchments/dh-parchment-dark.png');
z-index: 2;
line-height: 22px;
height: unset;
text-align: center;
}
img {
width: 48px;
height: 48px;
filter: brightness(0) saturate(100%) invert(97%) sepia(7%) saturate(580%) hue-rotate(332deg)
brightness(96%) contrast(95%);
}
}
}
footer {
display: flex;
gap: 8px;
button {
flex: 1;
white-space: nowrap;
}
}
}

View file

@ -112,7 +112,7 @@
margin: 5px;
height: inherit;
.tag {
box-shadow: 0 0 0 1.1em #E5E5E5 inset;
box-shadow: 0 0 0 1.1em @beige inset;
vertical-align: top;
box-sizing: border-box;
max-width: 100%;
@ -120,9 +120,9 @@
color: black;
border-radius: 3px;
white-space: nowrap;
transition: .13s ease-out;
transition: 0.13s ease-out;
height: 22px;
font-size: .9rem;
font-size: 0.9rem;
gap: 0.5em;
z-index: 1;
.remove {

View file

@ -6,6 +6,7 @@
@import './tab-actions.less';
@import './tab-features.less';
@import './tab-effects.less';
@import './tab-settings.less';
@import './item-header.less';
@import './feature-section.less';
@import './inventory-item.less';

View file

@ -1,6 +1,17 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.theme-light .application.daggerheart.dh-style {
.inventory-item,
.card-item {
.item-resource .item-dice-resource {
img {
filter: brightness(0) saturate(100%);
}
}
}
}
.application.daggerheart.dh-style {
.inventory-item {
display: grid;
@ -21,10 +32,19 @@
}
}
.item-label-wrapper {
display: grid;
grid-template-columns: 1fr 60px;
}
.item-label {
font-family: @font-body;
align-self: center;
&.fullWidth {
grid-column: span 2;
}
.item-name {
font-size: 14px;
}
@ -84,11 +104,27 @@
&:hover {
.card-label {
padding-top: 15px;
.controls {
.menu {
opacity: 1;
visibility: visible;
transition: all 0.3s ease;
max-height: 16px;
&.resource-menu {
max-height: 55px;
&.dice-menu {
max-height: 118px;
.item-resources {
flex-wrap: wrap;
}
.item-resource {
width: unset;
}
}
}
}
}
}
@ -97,6 +133,7 @@
height: 100%;
width: 100%;
object-fit: cover;
border-radius: 6px;
}
.card-label {
@ -123,15 +160,88 @@
color: @beige;
}
.controls {
.menu {
display: flex;
gap: 15px;
align-items: center;
flex-direction: column;
gap: 8px;
max-height: 0px;
opacity: 0;
visibility: collapse;
transition: all 0.3s ease;
color: @beige;
.controls {
display: flex;
gap: 2px;
gap: 15px;
justify-content: center;
}
}
}
.item-resources {
width: 92px;
}
.item-resource {
width: 92px;
}
}
.inventory-item,
.card-item {
.item-resources {
display: flex;
gap: 4px;
.resource-edit {
font-size: 14px;
}
}
.item-resource {
display: flex;
align-items: center;
justify-content: end;
gap: 4px;
i {
flex: none;
font-size: 14px;
}
input {
flex: 1;
}
.item-dice-resource {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 26px;
label {
position: absolute;
color: light-dark(white, black);
filter: drop-shadow(0 0 1px light-dark(@dark-blue, @golden));
z-index: 2;
font-size: 18px;
cursor: pointer;
}
img {
filter: brightness(0) saturate(100%) invert(97%) sepia(7%) saturate(580%) hue-rotate(332deg)
brightness(96%) contrast(95%);
}
i {
position: absolute;
text-shadow: 0 0 3px white;
filter: drop-shadow(0 1px white);
color: black;
font-size: 26px;
}
}
}
}

View file

@ -4,4 +4,4 @@
width: 100%;
}
}
}
}

View file

@ -0,0 +1,8 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.sheet.daggerheart.dh-style {
.tab.settings {
margin-bottom: 36px;
}
}

View file

@ -31,6 +31,14 @@
}
}
&.resource-roll {
.reroll-message {
text-align: center;
font-size: 18px;
margin-bottom: 0;
}
}
&.roll {
.dice-flavor {
text-align: center;