Functioning setup

This commit is contained in:
WBHarry 2026-04-18 15:02:41 +02:00
parent 4b92001f97
commit 0cb7ede933
24 changed files with 350 additions and 72 deletions

View file

@ -0,0 +1,42 @@
<fieldset class="one-column" data-key="area">
<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|}}
<div class="nest-inputs">
{{formField ../fields.type value=area.type name=(concat "area." index ".type") localize=true}}
{{formField ../fields.shape value=area.shape name=(concat "area." index ".shape") localize=true}}
{{formField ../fields.size value=area.size name=(concat "area." index ".size") 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="flexcol">
<div class="flexrow">
<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>
{{#each area.effects as |effectId index|}}
<input type="hidden" name={{concat "area." @../key ".effects." index "._id"}} value="{{effect._id}}">
<div class="inventory-item single-img" 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}}
<input type="hidden" name="effects.{{index}}._id" value="{{effectId}}">
<div class="controls">
<a data-tooltip="{{localize "CONTROLS.CommonDelete"}}" data-action="removeEffect" data-index="{{@../key}}" data-area-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/area.hbs' fields=fields.area.element.fields source=source.area}}
</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

@ -14,4 +14,5 @@
{{/unless}}
{{/if}}
{{#if (and hasEffect)}}<button class="duality-action-effect">{{localize "DAGGERHEART.UI.Chat.attackRoll.applyEffect"}}</button>{{/if}}
{{#if areas.length}}<button class="action-areas no-flex"><i class="fa-solid fa-crosshairs"></i></button>{{/if}}
</div>