[Feature] TokenConfig Actor Size Edit (#1470)

* Added the select and handliing

* Fixed so tokenPreview works with tokenSize

* Correction for prototypeToken

* Extracted common logic to token-config-mixin.mjs

* Update templates/sheets-settings/token-config/appearance.hbs

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

---------

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
WBHarry 2025-12-25 02:12:36 +01:00 committed by GitHub
parent c63ba3b41d
commit 50a307b271
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 167 additions and 85 deletions

View file

@ -10,22 +10,31 @@
</select>
</div>
{{/if}}
<fieldset>
<legend>{{localize "Token Size"}}</legend>
{{#if usesActorSize}}
<div class="form-group lim">
<label>{{localize "Size Category"}}</label>
<select id="dhTokenSize">
{{selectOptions tokenSizes selected=tokenSize valueAttr="id" labelAttr="label" localize=true}}
</select>
</div>
{{/if}}
<div class="form-group slim" {{#if actorSizeUsed}}data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.actorSizeUsed"}}"{{/if}}>
<label>
{{localize "TOKEN.Dimensions"}} <span class="units">({{localize "GridSpaces"}})</span>
{{#if actorSizeUsed}}
<i class="fa-solid fa-lock"></i>
{{/if}}
</label>
<div class="form-fields">
<label for="{{rootId}}-width">{{localize "DOCUMENT.FIELDS.width.label"}}</label>
{{formInput fields.width value=source.width id=(concat rootId "-width") disabled=actorSizeUsed}}
<label for="{{rootId}}-height">{{localize "DOCUMENT.FIELDS.height.label"}}</label>
{{formInput fields.height value=source.height id=(concat rootId "-height") disabled=actorSizeUsed}}
<div id="tokenSizeDimensions" class="form-group slim" {{#if actorSizeDisable}}data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.actorSizeUsed"}}"{{/if}}>
<label>
{{localize "TOKEN.Dimensions"}} <span class="units">({{localize "GridSpaces"}})</span>
<i class="fa-solid fa-lock" {{#unless actorSizeDisable}}style="opacity: 0%;"{{/unless}}></i>
</label>
<div class="form-fields">
<label for="{{rootId}}-width">{{localize "DOCUMENT.FIELDS.width.label"}}</label>
{{formInput fields.width value=source.width id=(concat rootId "-width") disabled=actorSizeDisable}}
<label for="{{rootId}}-height">{{localize "DOCUMENT.FIELDS.height.label"}}</label>
{{formInput fields.height value=source.height id=(concat rootId "-height") disabled=actorSizeDisable}}
</div>
</div>
</div>
</fieldset>
{{#if shapes}}
{{formGroup fields.shape value=source.shape choices=shapes classes="slim" rootId=rootId}}