File Structure Rework (#262)

* Restructured all the files

* Moved build/daggerheart.js to ./daggerheart.js. Changed rollup to use the css file instead of the less

* Restored build/ folder

* Mvoed config out form under application

* Moved roll.mjs to module/dice and renamed to dhRolls.mjs

* Update module/canvas/placeables/_module.mjs

Co-authored-by: joaquinpereyra98 <24190917+joaquinpereyra98@users.noreply.github.com>

* Le massive export update

* Removed unncessary import

---------

Co-authored-by: joaquinpereyra98 <24190917+joaquinpereyra98@users.noreply.github.com>
This commit is contained in:
WBHarry 2025-07-05 00:26:33 +02:00 committed by GitHub
parent 099a4576da
commit 9d76405221
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
203 changed files with 1556 additions and 2565 deletions

View file

@ -0,0 +1,15 @@
<div class="daggerheart chat domain-card">
<div class="domain-card-title">
<h2>{{name}}</h2>
</div>
<img src="{{img}}" />
<div>{{{description}}}</div>
<footer class="ability-card-footer">
{{#each actions as |action index|}}
<button class="ability-use-button" data-index="{{index}}">
{{action.name}}
</button>
{{#if action.cost.value}}<div class="ability-card-action-cost">{{action.cost.value}} {{action.cost.type}}</div>{{/if}}
{{/each}}
</footer>
</div>

View file

@ -0,0 +1,47 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll.formula}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
{{#each dice}}
<header class="part-header flexrow">
<span class="part-formula">{{number}}{{denomination}}</span>
<span class="part-total">{{total}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
{{#each results}}
<li class="roll die {{../denomination}}{{#if discarded}} discarded{{/if}} min">{{result}}</li>
{{/each}}
</ol>
<div class="attack-roll-advantage-container">{{#if ../advantageState}}{{localize "DAGGERHEART.General.Advantage.Full"}}{{/if}}{{#if (eq ../advantageState false)}}{{localize "DAGGERHEART.General.Disadvantage.Full"}}{{/if}}</div>
</div>
{{/each}}
</div>
</section>
</div>
</div>
<div class="dice-total">
<div class="dice-total-value">{{roll.total}}</div>
</div>
{{#if (gt targets.length 0)}}
<div class="target-section">
{{#each targets as |target|}}
<div class="dice-total target-container {{#if target.hit}}hit{{else}}miss{{/if}}" data-token="{{target.id}}">
<img src="{{target.img}}" />
<div class="target-inner-container">
{{#if target.hit}}{{localize "Hit"}}{{else}}{{localize "Miss"}}{{/if}}
</div>
</div>
{{/each}}
</div>
{{/if}}
<div class="flexrow">
<button class="duality-action" data-value="{{roll.total}}"><span>Roll Damage</span></button>
</div>
</div>
</div>

View file

@ -0,0 +1,62 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll.formula}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
{{#each roll.dice as | dice index |}}
<header class="part-header flexrow">
<span class="part-formula">{{formula}}</span>
<span class="part-total">{{total}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
{{#each results}}
<li class="roll die {{../dice}}{{#if discarded}} discarded{{/if}} min">{{result}}</li>
{{/each}}
</ol>
{{#if (eq index 0)}}
<div class="attack-roll-advantage-container">
{{#if (eq ../roll.advantage.type 1)}}{{localize "DAGGERHEART.General.Advantage.Full"}}{{/if}}{{#if (eq ../roll.advantage.type -1)}}{{localize "DAGGERHEART.General.Disadvantage.Full"}}{{/if}}
</div>
{{/if}}
</div>
{{/each}}
</div>
</section>
</div>
</div>
<div class="dice-total">
<div class="dice-total-value">{{roll.total}}</div>
</div>
</div>
</div>
<fieldset class="dice-roll daggerheart chat roll expanded{{#unless damage.roll}} hidden{{/unless}}" data-action="expandRoll">
<legend class="dice-flavor">Damage</legend>
<div class="dice-result">
<div class="dice-tooltip">
<div class="wrapper">
{{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=damage noTitle=true}}
</div>
</div>
</div>
</fieldset>
{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}}
{{#if hasDamage}}
<div class="dice-roll daggerheart chat roll">
<div class="dice-result">
{{#if damage.roll}}
<div class="dice-actions">
{{!-- <button class="damage-button" data-target-hit="true" {{#if (eq targets.length 0)}}disabled{{/if}}>{{localize "DAGGERHEART.Chat.DamageRoll.DealDamageToTargets"}}</button> --}}
<button class="damage-button">{{localize "DAGGERHEART.Chat.DamageRoll.DealDamage"}}</button>
</div>
{{else}}
<div class="flexrow">
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.DamageRoll.RollDamage"}}</span></button>
</div>
{{/if}}
</div>
</div>
{{/if}}

View file

@ -0,0 +1,9 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{title}}</div>
<div>{{{description}}}</div>
<div class="dice-result">
<div class="dice-actions">
<button class="duality-action-effect">{{localize "DAGGERHEART.Chat.AttackRoll.ApplyEffect"}}</button>
</div>
</div>
</div>

View file

@ -0,0 +1,10 @@
{{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=this}}
{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}}
<div class="dice-roll daggerheart chat roll">
<div class="dice-result">
<div class="dice-actions">
<button class="damage-button" data-target-hit="true" {{#if (eq targets.length 0)}}disabled{{/if}}>{{localize "DAGGERHEART.Chat.DamageRoll.DealDamageToTargets"}}</button>
<button class="damage-button">{{localize "DAGGERHEART.Chat.DamageRoll.DealDamage"}}</button>
</div>
</div>
</div>

View file

@ -0,0 +1,8 @@
<div class="daggerheart chat downtime">
<h2 class="downtime-title-container">
<div>{{this.player}} {{localize "DAGGERHEART.Chat.DeathMove.Title"}}</div>
<div class="downtime-subtitle">{{this.title}}</div>
</h2>
<img class="downtime-image" src="{{this.img}}" />
<div>{{{this.description}}}</div>
</div>

View file

@ -0,0 +1,11 @@
<div class="daggerheart chat downtime">
<h2 class="downtime-title-container">
<div>{{title}}</div>
</h2>
{{#each moves}}
<strong>{{this.name}}</strong>
<img class="downtime-image" src="{{this.img}}" />
<div>{{{this.description}}}</div>
{{#if (gt this.actions.length 0)}}<button class="action-use-button">{{localize "Action"}}</button>{{/if}}
{{/each}}
</div>

View file

@ -0,0 +1,154 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{title}}</div>
<div class="duality-modifiers">
{{#each roll.modifiers}}
<div class="duality-modifier">
{{localize label}} {{#if (gte value 0)}}+{{/if}}{{value}}
</div>
{{/each}}
{{#if (eq roll.advantage.type 1)}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Advantage.Full"}}
</div>
{{/if}}
{{#if (eq roll.advantage.type -1)}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Disadvantage.Full"}}
</div>
{{/if}}
</div>
<div class="dice-result">
<div class="dice-formula">{{roll.formula}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{roll.hope.dice}}</span>
|
<span>1{{roll.fear.dice}}</span>
</span>
<span class="part-total">{{roll.result.total}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls duality">
<li class="roll die {{roll.hope.dice}}" title="{{localize "DAGGERHEART.General.Hope"}}">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Hope"}}</div>
<div class="dice-inner-container hope" title="{{localize "DAGGERHEART.General.Hope"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{roll.hope.value}}</div>
</div>
</div>
</li>
<li class="roll die {{roll.fear.dice}}" title="{{localize "DAGGERHEART.General.Fear"}}">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Fear"}}</div>
<div class="dice-inner-container fear" title="{{localize "DAGGERHEART.General.Fear"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{roll.fear.value}}</div>
</div>
</div>
</li>
</ol>
</div>
</div>
{{#if roll.advantage.type}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{roll.advantage.dice}}</span>
</span>
<span class="part-total">{{roll.advantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{roll.advantage.dice}}">
<div class="dice-container">
<div class="dice-inner-container {{#if (eq roll.advantage.type 1)}}advantage{{else}}disadvantage{{/if}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d6-grey.svg"/>
</div>
<div class="dice-value">{{roll.advantage.value}}</div>
</div>
</div>
</li>
</ol>
</div>
</div>
{{/if}}
{{#each roll.extra as | extra | }}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{extra.dice}}</span>
</span>
<span class="part-total">{{extra.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{extra.dice}}">
<div class="dice-container">
<div class="dice-inner-container">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/{{extra.dice}}-grey.svg"/>
</div>
<div class="dice-value">{{extra.value}}</div>
</div>
</div>
</li>
</ol>
</div>
</div>
{{/each}}
{{#if roll.modifierTotal}}<div class="duality-modifier">{{#if (gt roll.modifierTotal 0)}}+{{/if}}{{roll.modifierTotal}}</div>{{/if}}
</section>
</div>
</div>
<div class="dice-total duality {{#if (eq roll.result.duality 1)}}hope{{else}}{{#if (eq roll.result.duality -1)}}fear{{else}}critical{{/if}}{{/if}}">
<div class="dice-total-label">{{roll.result.label}}</div>
<div class="dice-total-value">
{{roll.total}}
</div>
</div>
</div>
</div>
<fieldset class="dice-roll daggerheart chat roll expanded{{#unless damage.roll}} hidden{{/unless}}" data-action="expandRoll">
<legend class="dice-flavor">Damage</legend>
<div class="dice-result">
<div class="dice-tooltip">
<div class="wrapper">
{{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=damage noTitle=true}}
</div>
</div>
</div>
</fieldset>
{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}}
<div class="dice-roll daggerheart chat roll">
<div class="dice-result">
<div class="dice-actions{{#unless (or hasDamage hasHealing)}} duality-alone{{/unless}}">
{{#if hasDamage}}
{{#if damage.roll}}
<button class="duality-action damage-button" data-target-hit="true" data-value="{{roll.total}}"><span>Deal Damage</span></button>
{{else}}
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.AttackRoll.RollDamage"}}</span></button>
{{/if}}
{{else}}
{{#if hasHealing}}
<button class="duality-action duality-action-healing" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.AttackRoll.RollHealing"}}</span></button>
{{/if}}
{{/if}}
{{#if hasEffect}}
<button class="duality-action{{#if (or hasDamage hasHealing)}} duality-action-effect{{/if}}" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.Chat.AttackRoll.ApplyEffect"}}</span></button>
{{/if}}
<div class="duality-result">
<div>{{roll.total}} {{#if (eq roll.result.duality 1)}}With Hope{{else}}{{#if (eq roll.result.duality -1)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,29 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll.formula}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
{{#each roll.dice}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">{{formula}}</span>
<span class="part-total">{{total}}</span>
</header>
<ol class="dice-rolls">
{{#each results}}
<li class="roll die {{../denomination}} min">{{result}}</li>
{{/each}}
</ol>
</div>
{{/each}}
</section>
</div>
</div>
<div class="dice-total">{{roll.total}}</div>
<div class="flexrow">
<button class="healing-button"><span>{{localize "DAGGERHEART.Chat.HealingRoll.Heal"}}</span></button>
</div>
</div>
</div>

View file

@ -0,0 +1,28 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
{{#unless noTitle}}<div class="dice-flavor">{{damage.title}}</div>{{/unless}}
<div class="dice-result">
<div class="dice-formula">{{damage.roll.formula}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
{{#each damage.roll.dice}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">{{formula}}</span>
<span class="part-total">{{total}}</span>
</header>
<ol class="dice-rolls">
{{#each results}}
<li class="roll die {{../dice}} min">{{result}}</li>
{{/each}}
</ol>
</div>
{{/each}}
{{#if damage.roll.modifierTotal}}<div class="duality-modifier">{{#if (gt damage.roll.modifierTotal 0)}}+{{/if}}{{damage.roll.modifierTotal}}</div>{{/if}}
<div class="duality-result">Total: {{damage.roll.total}}</div>
</section>
</div>
</div>
<div class="dice-total">{{damage.roll.total}}</div>
</div>
</div>

View file

@ -0,0 +1,39 @@
{{#if (gt currentTargets.length 0)}}
<fieldset class="dice-roll daggerheart chat roll expanded" data-action="expandRoll">
<legend class="dice-flavor">Targets</legend>
<div class="dice-result">
<div class="dice-tooltip">
<div class="wrapper">
<div class="target-selection">
<label class="button-target-selection{{#if @root.targetSelection}} target-selected{{/if}}" data-target-hit="true">{{localize "DAGGERHEART.Chat.DamageRoll.HitTarget"}}</label>
<label class="button-target-selection{{#unless @root.targetSelection}} target-selected{{/unless}}">{{localize "DAGGERHEART.Chat.DamageRoll.SelectedTarget"}}</label>
</div>
{{#if (and hasSave @root.targetSelection @root.hasHitTarget)}}
<button class="inner-button inner-button-right roll-all-save-button">Roll All <i class="fa-solid fa-shield"></i></button>
{{/if}}
<div class="target-section">
{{#each currentTargets as |target|}}
<div class="dice-total target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
<img src="{{target.img}}" />
<div class="target-inner-container">
{{#if (or ../directDamage (not @root.targetSelection))}}
<div data-perm-id="{{target.actorId}}"><span>{{target.name}}</span></div>
{{else}}
{{#if target.hit}}{{localize "Hit"}}{{else}}{{#if (not ../total.alternate)}}{{localize "Miss"}}{{else}}?{{/if}}{{/if}}
{{/if}}
</div>
{{#if (and ../hasSave target.hit @root.targetSelection)}}
<button class="target-save-container{{#if target.saved.result includeZero=true}} is-rolled{{/if}}" data-perm-id="{{target.actorId}}">
{{!-- {{target.saved.result}} --}}
<i class="fa-solid {{#if target.saved.result includeZero=true}}{{#if target.saved.success}}fa-check{{else}}fa-xmark{{/if}}{{else}}fa-shield{{/if}}">
</i>
</button>
{{/if}}
</div>
{{/each}}
</div>
</div>
</div>
</div>
</fieldset>
{{/if}}