This commit is contained in:
WBHarry 2026-01-17 20:30:32 +01:00
parent 91d22292e1
commit 08c9c86d48
5 changed files with 95 additions and 52 deletions

View file

@ -2,15 +2,16 @@
<img src="{{source.img}}" data-action="editImage" data-edit="img" alt="{{localize "DOCUMENT.FIELDS.img.label"}}">
<input type="text" name="name" value="{{source.name}}" placeholder="{{localize "DOCUMENT.FIELDS.name.label"}}" aria-label="{{localize "DOCUMENT.FIELDS.name.label"}}">
<div class="form-group">
<label>{{localize "Formula"}}</label>
<div class="form-fields">
<select class="system-update-field" data-path="activeAltFormula">
{{selectOptions this.altFormulaOptions selected=this.activeAltFormula labelAttr="name"}}
</select>
{{#if usesAltFormula}}
<div class="form-group">
<label>{{localize "Formula"}}</label>
<div class="form-fields">
<select class="system-update-field" data-path="activeAltFormula">
{{selectOptions this.altFormulaOptions selected=this.activeAltFormula labelAttr="name"}}
</select>
</div>
</div>
</div>
{{/if}}
<button data-action="changeMode">
<i class="fa-solid fa-eye" inert></i>

View file

@ -2,9 +2,11 @@
<img src="{{document.img}}" alt="{{localize "DOCUMENT.FIELDS.img.label"}}">
<h1>{{document.name}}</h1>
<div class="roll-table-view-formula-container">
<select class="system-update-field" data-path="activeAltFormula">
{{selectOptions this.altFormulaOptions selected=this.activeAltFormula labelAttr="name"}}
</select>
{{#if usesAltFormula}}
<select class="system-update-field" data-path="activeAltFormula">
{{selectOptions this.altFormulaOptions selected=this.activeAltFormula labelAttr="name"}}
</select>
{{/if}}
<h4>{{selectedFormula}}</h4>
</div>
<button data-action="changeMode">

View file

@ -7,12 +7,12 @@
<span>{{localize "DAGGERHEART.ROLLTABLES.FIELDS.formulaName.label"}}</span>
<span>{{localize "Formula Roll"}}</span>
<span></span>
{{formInput systemFields.formulaName value=@root.formulaName name="flags.daggerheart.formulaName"}}
<input type="text" value="{{@root.formulaName}}" class="system-update-field" data-path="formulaName" />
{{formInput fields.formula value=source.formula placeholder=formulaPlaceholder rootId=rootId}}
<button class="formula-button" data-action="addFormula"><i class="fa-solid fa-plus"></i></button>
{{#each @root.altFormula as | formula key |}}
{{formInput @root.systemFields.altFormula.element.fields.name value=formula.name name=(concat "flags.daggerheart.altFormula." key ".name")}}
{{formInput @root.systemFields.altFormula.element.fields.formula value=formula.formula name=(concat "flags.daggerheart.altFormula." key ".formula")}}
<input type="text" value="{{formula.name}}" class="system-update-field" data-path="{{concat "altFormula." key ".name"}}" />
<input type="text" value="{{formula.formula}}" class="system-update-field" data-path="{{concat "altFormula." key ".formula"}}" />
<a class="formula-button" data-action="removeFormula" data-key="{{key}}"><i class="fa-solid fa-trash"></i></a>
{{/each}}
</div>