working weapons section in char sheet

Additions:
- re-added getData() method of actor sheet for sorted items
- added an item-description CSS class for handling of overflow
- added a 1.5 CSS flex box

Changes:
- restricted previous sample items section to only weapons
  (to be re-used for other item types)

Fixes:
- fixed input types in weapon sheet
This commit is contained in:
Gesina Schwalbe 2020-12-29 01:44:54 +01:00
parent 2fc7fb13c8
commit 2ac6d3a919
5 changed files with 80 additions and 13 deletions

View file

@ -6,6 +6,21 @@ import { DS4ActorDataType } from "./actor-data";
* @extends {ActorSheet}
*/
export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor> {
/**
* This method returns the data for the template of the actor sheet.
* It explicitly adds the items of the object sorted by type in the
* object itemsByType.
* @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);
return data;
}
/** @override */
static get defaultOptions(): FormApplicationOptions {
return mergeObject(super.defaultOptions, {