enrich effects tab in actor sheet with more detail

This commit is contained in:
Johannes Loher 2021-09-12 18:35:07 +02:00
parent bd27aafe01
commit 8d32d0e3bb
6 changed files with 29 additions and 5 deletions

View file

@ -123,8 +123,12 @@
"DS4.SpellPrice": "Preis (Gold)",
"DS4.EffectEnabled": "Aktiv",
"DS4.EffectEnabledAbbr": "A",
"DS4.EffectEffectivelyEnabled": "Effektiv Aktiv (unter Betrachtung, ob ein eventuelles Quellen-Item ausgerüstet ist usw.)",
"DS4.EffectEffectivelyEnabledAbbr": "E",
"DS4.EffectLabel": "Bezeichnung",
"DS4.EffectSourceName": "Quelle",
"DS4.EffectFactor": "Faktor (wie oft der Effekt angewendet wird)",
"DS4.EffectFactorAbbr": "F",
"DS4.ActorName": "Name",
"DS4.ActorImageAltText": "Bild des Aktors",
"DS4.ActorTypeCharacter": "Charakter",

View file

@ -123,8 +123,12 @@
"DS4.SpellPrice": "Price (Gold)",
"DS4.EffectEnabled": "Enabled",
"DS4.EffectEnabledAbbr": "E",
"DS4.EffectEffectivelyEnabled": "Effectively Enabled (taking into account whether a potential source item is equipped etc.)",
"DS4.EffectEffectivelyEnabledAbbr": "EE",
"DS4.EffectLabel": "Label",
"DS4.EffectSourceName": "Source",
"DS4.EffectFactor": "Factor (the number of times the effect is being applied)",
"DS4.EffectFactorAbbr": "F",
"DS4.ActorName": "Name",
"DS4.ActorImageAltText": "Image of the Actor",
"DS4.ActorTypeCharacter": "Character",

View file

@ -53,6 +53,8 @@ export class DS4ActorSheet extends ActorSheet<ActorSheet.Options, DS4ActorSheetD
...effect.toObject(),
icon: effect.data.icon ?? DS4ActiveEffect.FALLBACK_ICON,
sourceName: await effect.getCurrentSourceName(),
factor: effect.factor,
isEffectivelyEnabled: !effect.data.disabled && !effect.isSurpressed,
};
});
const enrichedEffects = await Promise.all(enrichedEffectPromises);

View file

@ -77,8 +77,10 @@
}
&--effect {
grid-template-columns: $row-height $row-height 3fr 2fr 5ch;
:nth-child(5n + 1) {
grid-template-columns: $row-height $row-height $row-height 3fr 2fr $row-height 5ch;
:nth-child(7n + 1),
:nth-child(7n + 2),
:nth-child(7n + 6) {
justify-self: center;
}
}

View file

@ -11,9 +11,12 @@ SPDX-License-Identifier: MIT
--}}
<li class="ds4-embedded-document-list__row effect" data-effect-id="{{effectData._id}}">
{{!-- enabled --}}
<input class="ds4-embedded-document-list__editable ds4-embedded-document-list__editable--checkbox change-effect" type="checkbox" {{checked
(ne effectData.disabled true)}} data-dtype="Boolean" data-property="disabled" data-inverted="true"
title="{{localize 'DS4.EffectEnabled'}}">
<input class="ds4-embedded-document-list__editable ds4-embedded-document-list__editable--checkbox change-effect"
type="checkbox" {{checked (ne effectData.disabled true)}} data-dtype="Boolean" data-property="disabled"
data-inverted="true" title="{{localize 'DS4.EffectEnabled'}}">
{{!-- effectively enabled --}}
{{#if effectData.isEffectivelyEnabled}}<i class="fas fa-check"></i>{{else}}<i class="fas fa-ban"></i>{{/if}}
{{!-- icon --}}
{{> systems/ds4/templates/sheets/actor/components/rollable-image.hbs rollable=false src=effectData.icon
@ -25,6 +28,9 @@ SPDX-License-Identifier: MIT
{{!-- source name --}}
<div>{{effectData.sourceName}}</div>
{{!-- factor --}}
<div title="{{effectData.factor}}">{{effectData.factor}}</div>
{{!-- control button group --}}
{{> systems/ds4/templates/sheets/actor/components/control-button-group.hbs documentType="effect"
editTitle="DS4.UserInteractionEditEffectTitle" deleteTitle="DS4.UserInteractionDeleteEffectTitle"}}

View file

@ -12,6 +12,9 @@ SPDX-License-Identifier: MIT
{{!-- enabled --}}
<div title="{{localize 'DS4.EffectEnabled'}}">{{localize 'DS4.EffectEnabledAbbr'}}</div>
{{!-- effectively enabled --}}
<div title="{{localize 'DS4.EffectEffectivelyEnabled'}}">{{localize 'DS4.EffectEffectivelyEnabledAbbr'}}</div>
{{!-- icon --}}
<div></div>
@ -21,6 +24,9 @@ SPDX-License-Identifier: MIT
{{!-- source name --}}
<div>{{localize 'DS4.EffectSourceName'}}</div>
{{!-- factor --}}
<div title="{{localize 'DS4.EffectFactor'}}">{{localize 'DS4.EffectFactorAbbr'}}</div>
{{!-- control buttons placeholder --}}
<div></div>
</li>