mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Added level advancement selection data
This commit is contained in:
parent
d7ebeb3b2a
commit
b131f2831d
6 changed files with 41 additions and 28 deletions
|
|
@ -748,6 +748,8 @@
|
|||
"TakeLevelUp": "Finish Level Up",
|
||||
"notifications": {
|
||||
"info": {
|
||||
"tierAdvancementInfo": "Advancements from a higher tier can always be used to select advancements in a lower tier.",
|
||||
"remainingAdvancementInfo": "Remaining Choices: {choices}",
|
||||
"insufficentAdvancements": "You don't have enough advancements left.",
|
||||
"insufficientTierAdvancements": "You have no available advancements for this tier."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ export class DhLevelup extends foundry.abstract.DataModel {
|
|||
acc.total += tier.selections.total;
|
||||
for (var key in tier.selections.available) {
|
||||
const availableSelections = tier.selections.available[key];
|
||||
acc.totalAvailable += availableSelections;
|
||||
|
||||
if (acc.available[key]) acc.available[key] += availableSelections;
|
||||
else acc.available[key] = availableSelections;
|
||||
|
|
@ -52,7 +53,7 @@ export class DhLevelup extends foundry.abstract.DataModel {
|
|||
|
||||
return acc;
|
||||
},
|
||||
{ total: 0, available: {} }
|
||||
{ total: 0, available: {}, totalAvailable: 0 }
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -128,16 +129,20 @@ class DhLevelupTier extends foundry.abstract.DataModel {
|
|||
const allSelections = Object.keys(this.levels).reduce(
|
||||
(acc, key) => {
|
||||
const { selections, available } = this.levels[key].nrSelections;
|
||||
|
||||
if (acc.available[key]) acc.available[key] += available;
|
||||
else acc.available[key] = available;
|
||||
|
||||
acc.totalAvailable += available;
|
||||
acc.total += selections;
|
||||
|
||||
return acc;
|
||||
},
|
||||
{ available: {}, total: 0 }
|
||||
{ available: {}, totalAvailable: 0, total: 0 }
|
||||
);
|
||||
return {
|
||||
available: allSelections.available,
|
||||
totalAvailable: allSelections.totalAvailable,
|
||||
total: allSelections.total
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { diceSoNicePresets, getDiceSoNicePresets } from '../config/generalConfig.mjs';
|
||||
import { getDiceSoNicePresets } from '../config/generalConfig.mjs';
|
||||
|
||||
export const loadCompendiumOptions = async compendiums => {
|
||||
const compendiumValues = [];
|
||||
|
|
|
|||
|
|
@ -2786,7 +2786,7 @@ div.daggerheart.views.multiclass {
|
|||
.theme-light {
|
||||
/* Add specifics*/
|
||||
}
|
||||
.daggerheart.levelup div[data-application-part="form"] {
|
||||
.daggerheart.levelup div[data-application-part='form'] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
|
@ -3269,6 +3269,7 @@ div.daggerheart.views.multiclass {
|
|||
width: 100%;
|
||||
object-fit: cover;
|
||||
mask-image: linear-gradient(0deg, transparent 0%, black 10%);
|
||||
cursor: pointer;
|
||||
}
|
||||
.application.sheet.daggerheart.dh-style .item-card-header .item-icons-list {
|
||||
position: absolute;
|
||||
|
|
@ -3398,12 +3399,6 @@ div.daggerheart.views.multiclass {
|
|||
/* Flex */
|
||||
/****/
|
||||
}
|
||||
.daggerheart .vertical-separator {
|
||||
border-left: 2px solid black;
|
||||
height: 56px;
|
||||
flex: 0;
|
||||
align-self: center;
|
||||
}
|
||||
.daggerheart .flex-centered {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -75,5 +75,26 @@
|
|||
|
||||
.levelup-footer {
|
||||
display: flex;
|
||||
|
||||
.advancement-information-container {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
border: 1px solid;
|
||||
border-radius: 4px;
|
||||
margin-left: 8px;
|
||||
align-items: center;
|
||||
padding: 0 8px;
|
||||
border-color: rgb(159, 132, 117);
|
||||
|
||||
.advancement-tier-stats {
|
||||
border: 1px solid;
|
||||
padding: 0 2px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.advancement-tier-info {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,23 +30,13 @@
|
|||
</div>
|
||||
<footer class="levelup-footer">
|
||||
<button data-action="save">{{localize "Finish Levelup"}}</button>
|
||||
</footer>
|
||||
</div>
|
||||
<div class="advancement-information-container">
|
||||
{{localize "DAGGERHEART.Application.LevelUp.notifications.info.remainingAdvancementInfo" choices=this.levelup.levelSelections.totalAvailable}}
|
||||
|
||||
{{!-- <div class="flex-col">
|
||||
<div class="levelup-title-container">Level {{activeLevel}}</div>
|
||||
<div class="levelup-section">
|
||||
{{#each data}}
|
||||
{{> "systems/daggerheart/templates/views/parts/level.hbs" data=this }}
|
||||
{{/each}}
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
{{#if (eq activeLevel changedLevel )}}
|
||||
<button data-action="finishLevelup" {{#if (not completedSelection)}}disabled{{/if}}>{{localize "DAGGERHEART.Application.LevelUp.TakeLevelUp"}}</button>
|
||||
{{else}}
|
||||
<button data-action="advanceLevel" {{#if (not completedSelection)}}disabled{{/if}}>{{localize "DAGGERHEART.Application.LevelUp.AdvanceLevel" level=(add activeLevel 1)}}</button>
|
||||
{{/if}}
|
||||
<button data-action="close">{{localize "DAGGERHEART.Application.Cancel"}}</button>
|
||||
{{#each this.levelup.tiers as |tier key|}}
|
||||
<div class="advancement-tier-stats">Tier {{tier.tier}}: {{tier.selections.totalAvailable}}</div>
|
||||
{{/each}}
|
||||
<i class="advancement-tier-info fa-solid fa-circle-question" data-tooltip="{{localize "DAGGERHEART.Application.LevelUp.notifications.info.tierAdvancementInfo"}}"></i>
|
||||
</div>
|
||||
</footer>
|
||||
</div> --}}
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue