[Feature] Action Areas (#1815)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run

* Functioning setup

* .

* Fixes

* Completed

* Apply suggestions from code review

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>

* using function.call instead of function.bind

* Run lint fix on action areas PR (#1820)

* .

* .

* Restructured getTemplateShape to be a lot more readable

* .

* .

* Changed from 'area' to 'areas'

* .

* Moved the areas button to the left

* Fix regression with actions list

* Updated all SRD adversaries

---------

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
WBHarry 2026-04-21 22:27:52 +02:00 committed by GitHub
parent 646e0debbd
commit 3eda3c4c05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
89 changed files with 1871 additions and 686 deletions

View file

@ -0,0 +1,46 @@
<fieldset class="one-column" data-key="areas">
<legend>
{{localize "DAGGERHEART.ACTIONS.Config.area.sectionTitle"}}
<a><i class="fa-solid fa-plus icon-button" data-action="addElement"></i></a>
</legend>
{{#each source as |area index|}}
{{#unless @first}}<line-div></line-div>{{/unless}}
<div class="nest-inputs">
{{formField ../fields.name value=area.name name=(concat "areas." index ".name") localize=true}}
<a class="btn" data-tooltip="{{localize "CONTROLS.CommonDelete"}}" data-action="removeElement" data-index="{{index}}"><i class="fas fa-trash"></i></a>
</div>
<div class="nest-inputs">
{{formField ../fields.type value=area.type name=(concat "areas." index ".type") localize=true}}
{{formField ../fields.shape value=area.shape name=(concat "areas." index ".shape") localize=true}}
{{formField ../fields.size value=area.size name=(concat "areas." index ".size") localize=true}}
</div>
<div class="sub-section-header">
<span>{{localize "DAGGERHEART.GENERAL.Effect.plural"}}</span>
<a><i class="fa-solid fa-plus icon-button" data-action="addEffect" data-area-index="{{index}}"></i></a>
</div>
<div class="two-columns even" style="width: 100%;">
{{#each area.effects as |effectId index|}}
<input type="hidden" name={{concat "areas." @../key ".effects." index}} value="{{effectId}}">
<div class="inventory-item single-img bordered" data-effect-id="{{effectId}}" data-area-index="{{index}}" data-action="editEffect">
<div class="inventory-item-header">
{{#with (@root.getEffectDetails effectId) as | details |}}
<div class="img-portait">
<img class="item-img" src="{{img}}">
</div>
<div class="item-label">
<div class="item-name">{{name}}</div>
</div>
{{/with}}
<div class="controls">
<a data-tooltip="{{localize "CONTROLS.CommonDelete"}}" data-action="removeEffect" data-area-index="{{@../key}}" data-index="{{index}}"><i class="fas fa-trash"></i></a>
</div>
</div>
</div>
{{/each}}
</div>
{{/each}}
</fieldset>

View file

@ -1,12 +1,14 @@
<fieldset class="one-column">
<legend>{{localize "DAGGERHEART.GENERAL.range"}}{{#if fields.target}} & {{localize "DAGGERHEART.GENERAL.Target.single"}}{{/if}}</legend>
{{formField fields.range value=source.range label=(localize "DAGGERHEART.GENERAL.range") name=(concat path "range") localize=true}}
{{#if fields.target}}
<div class="nest-inputs">
{{#if (and source.target.type (not (eq source.target.type 'self')))}}
{{ formField fields.target.amount value=source.target.amount label=(localize "DAGGERHEART.GENERAL.amount") name=(concat path "target.amount") localize=true}}
{{/if}}
{{ formField fields.target.type value=source.target.type label=(localize "DAGGERHEART.GENERAL.Target.single") name=(concat path "target.type") localize=true }}
</div>
<div class="nest-inputs">
{{formField fields.range value=source.range label=(localize "DAGGERHEART.GENERAL.range") name=(concat path "range") localize=true}}
{{#if (and source.target.type (not (eq source.target.type 'self')))}}
{{ formField fields.target.amount value=source.target.amount label=(localize "DAGGERHEART.GENERAL.amount") name=(concat path "target.amount") localize=true}}
{{/if}}
{{ formField fields.target.type value=source.target.type label=(localize "DAGGERHEART.GENERAL.Target.single") name=(concat path "target.type") localize=true }}
</div>
{{else}}
{{formField fields.range value=source.range label=(localize "DAGGERHEART.GENERAL.range") name=(concat path "range") localize=true}}
{{/if}}
</fieldset>

View file

@ -6,4 +6,5 @@
{{> 'systems/daggerheart/templates/actionTypes/uses.hbs' fields=fields.uses.fields source=source.uses}}
{{> 'systems/daggerheart/templates/actionTypes/cost.hbs' fields=fields.cost.element.fields source=source.cost costOptions=costOptions}}
{{> 'systems/daggerheart/templates/actionTypes/range-target.hbs' fields=(object range=fields.range target=fields.target.fields) source=(object target=source.target range=source.range)}}
{{> 'systems/daggerheart/templates/actionTypes/areas.hbs' fields=fields.areas.element.fields source=source.areas}}
</section>

View file

@ -2,6 +2,7 @@
{{formGroup fields.tint value=source.tint rootId=rootId placeholder="#ffffff"}}
{{formGroup fields.description value=source.description rootId=rootId}}
{{formGroup fields.disabled value=source.disabled rootId=rootId}}
{{formGroup systemFields.targetDispositions value=source.system.targetDispositions name=(concat "system.targetDispositions") localize=true}}
{{#if isActorEffect}}
<div class="form-group">

View file

@ -24,7 +24,6 @@
<span>{{localize "DAGGERHEART.GENERAL.damage"}}</span>
</button>
{{/if}}
{{!-- {{#if action.cost.value}}<div class="ability-card-action-cost">{{action.cost.value}} {{action.cost.type}}</div>{{/if}} --}}
{{/each}}
</footer>
</div>

View file

@ -26,4 +26,9 @@
{{/if}}
</div>
</details>
{{#if action.areas.length}}
<div class="roll-buttons action-roll-buttons">
<button class="action-areas end-button"><i class="fa-solid fa-crosshairs"></i></button>
</div>
{{/if}}
</div>

View file

@ -1,4 +1,5 @@
<div class="roll-buttons">
{{#if areas.length}}<button class="action-areas end-button"><i class="fa-solid fa-crosshairs"></i></button>{{/if}}
{{#if hasDamage}}
{{#unless (empty damage)}}
<button class="duality-action damage-button">{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamage"}}</button>