Merge branch 'improved-effects-display' into 'master'

enrich effects tab in actor sheet with more detail

See merge request dungeonslayers/ds4!137
This commit is contained in:
Johannes Loher 2021-09-12 16:36:58 +00:00
commit cd03451b95
6 changed files with 29 additions and 5 deletions

View file

@ -123,8 +123,12 @@
"DS4.SpellPrice": "Preis (Gold)", "DS4.SpellPrice": "Preis (Gold)",
"DS4.EffectEnabled": "Aktiv", "DS4.EffectEnabled": "Aktiv",
"DS4.EffectEnabledAbbr": "A", "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.EffectLabel": "Bezeichnung",
"DS4.EffectSourceName": "Quelle", "DS4.EffectSourceName": "Quelle",
"DS4.EffectFactor": "Faktor (wie oft der Effekt angewendet wird)",
"DS4.EffectFactorAbbr": "F",
"DS4.ActorName": "Name", "DS4.ActorName": "Name",
"DS4.ActorImageAltText": "Bild des Aktors", "DS4.ActorImageAltText": "Bild des Aktors",
"DS4.ActorTypeCharacter": "Charakter", "DS4.ActorTypeCharacter": "Charakter",

View file

@ -123,8 +123,12 @@
"DS4.SpellPrice": "Price (Gold)", "DS4.SpellPrice": "Price (Gold)",
"DS4.EffectEnabled": "Enabled", "DS4.EffectEnabled": "Enabled",
"DS4.EffectEnabledAbbr": "E", "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.EffectLabel": "Label",
"DS4.EffectSourceName": "Source", "DS4.EffectSourceName": "Source",
"DS4.EffectFactor": "Factor (the number of times the effect is being applied)",
"DS4.EffectFactorAbbr": "F",
"DS4.ActorName": "Name", "DS4.ActorName": "Name",
"DS4.ActorImageAltText": "Image of the Actor", "DS4.ActorImageAltText": "Image of the Actor",
"DS4.ActorTypeCharacter": "Character", "DS4.ActorTypeCharacter": "Character",

View file

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

View file

@ -77,8 +77,10 @@
} }
&--effect { &--effect {
grid-template-columns: $row-height $row-height 3fr 2fr 5ch; grid-template-columns: $row-height $row-height $row-height 3fr 2fr $row-height 5ch;
:nth-child(5n + 1) { :nth-child(7n + 1),
:nth-child(7n + 2),
:nth-child(7n + 6) {
justify-self: center; 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}}"> <li class="ds4-embedded-document-list__row effect" data-effect-id="{{effectData._id}}">
{{!-- enabled --}} {{!-- enabled --}}
<input class="ds4-embedded-document-list__editable ds4-embedded-document-list__editable--checkbox change-effect" type="checkbox" {{checked <input class="ds4-embedded-document-list__editable ds4-embedded-document-list__editable--checkbox change-effect"
(ne effectData.disabled true)}} data-dtype="Boolean" data-property="disabled" data-inverted="true" type="checkbox" {{checked (ne effectData.disabled true)}} data-dtype="Boolean" data-property="disabled"
title="{{localize 'DS4.EffectEnabled'}}"> 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 --}} {{!-- icon --}}
{{> systems/ds4/templates/sheets/actor/components/rollable-image.hbs rollable=false src=effectData.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 --}} {{!-- source name --}}
<div>{{effectData.sourceName}}</div> <div>{{effectData.sourceName}}</div>
{{!-- factor --}}
<div title="{{effectData.factor}}">{{effectData.factor}}</div>
{{!-- control button group --}} {{!-- control button group --}}
{{> systems/ds4/templates/sheets/actor/components/control-button-group.hbs documentType="effect" {{> systems/ds4/templates/sheets/actor/components/control-button-group.hbs documentType="effect"
editTitle="DS4.UserInteractionEditEffectTitle" deleteTitle="DS4.UserInteractionDeleteEffectTitle"}} editTitle="DS4.UserInteractionEditEffectTitle" deleteTitle="DS4.UserInteractionDeleteEffectTitle"}}

View file

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