proper localization of item vals in char sheet

Additions:
- added TODOs
- added armor item list to char sheet
- proper overflow handling in tabs (now: scrollable)

Changes:
- proper localization of item values
- "Description" not abbreviated anymore
- cleaned up getData() of ActorSheet (data now truly const)
This commit is contained in:
Gesina Schwalbe 2020-12-29 19:06:17 +01:00
parent 2ae005f432
commit 48d8d6e44d
3 changed files with 18 additions and 9 deletions

View file

@ -13,11 +13,14 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor> {
* @returns the data fed to the template of the actor sheet
*/
getData(): ActorSheetData<DS4ActorDataType, DS4Actor> {
const data = super.getData();
// Add the items explicitly sorted by type to the data:
const itemsByType = this.actor.itemTypes;
data["itemsByType"] = itemsByType;
console.log("Shields:", data);
const data = {
...super.getData(),
// Add the localization config to the data:
config: CONFIG.DS4,
// Add the items explicitly sorted by type to the data:
itemsByType: this.actor.itemTypes,
};
console.log("Data:", data);
return data;
}

View file

@ -9,7 +9,10 @@
.tab {
height: 100%;
overflow-y: auto;
overflow-y: scroll;
align-content: flex-start;
ol {
overflow-y: visible;
}
}
}

View file

@ -1,8 +1,11 @@
{{!-- TODO: hover shows complete name of abbreviations --}}
{{!-- TODO: try to use alias for the item type via HBS with and lookup --}}
{{!-- TODO: Where possible use icons with complete names as hovers instead of long names --}}
{{!-- Tab with overview and quick-actions on owned items --}}
<div class="tab items" data-group="primary" data-tab="items">
{{!-- WEAPONS --}}
<h3>{{localize "DS4.ItemTypeWeapon"}}</h3>
<h3>{{localize "DS4.ItemTypeWeapon"}}</h3> {{!-- SPECIFIC --}}
<ol class="items-list">
<li class="item flexrow item-header">
<div class="flexrow flex15">
@ -16,7 +19,7 @@
<div>{{localize "DS4.WeaponBonusAbbr"}}</div> {{!-- SPECIFIC --}}
<div>{{localize "DS4.OpponentDefenseAbbr"}}</div> {{!-- SPECIFIC --}}
</div>
<div class="flex4">{{localize "DS4.DescriptionAbbr"}}</div>
<div class="flex4">{{localize "DS4.Description"}}</div>
{{!-- add button --}}
<div class="item-controls"> {{!-- SPECIFIC --}}
<a class="item-control item-create" title="Create item" data-type="weapon"><i class="fas fa-plus"></i>
@ -41,7 +44,7 @@
{{!-- name --}}
<h4 class="item-name flex2">{{item.name}}</h4>
{{!-- item specifics --}}
<div>{{itemData.attackType}}</div> {{!-- SPECIFIC --}}
<div>{{lookup ../../config.attackTypes itemData.attackType}}</div> {{!-- SPECIFIC --}}
<div class="flexrow flex15">
<div>{{itemData.weaponBonus}}</div> {{!-- SPECIFIC --}}
<div>{{itemData.opponentDefense}}</div> {{!-- SPECIFIC --}}