From 17d0213e62826b6665d831a89402910d594e78dd Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sun, 10 Jan 2021 02:05:30 +0100 Subject: [PATCH] add basic creature sheet --- src/lang/de.json | 3 + src/lang/en.json | 3 + src/module/actor/actor-data.ts | 2 + src/module/actor/actor-sheet.ts | 29 +++++--- src/module/config.ts | 3 + src/template.json | 4 +- .../{actor-sheet.hbs => character-sheet.hbs} | 14 ++-- src/templates/actor/creature-sheet.hbs | 74 +++++++++++++++++++ src/templates/actor/partials/profile.hbs | 4 +- src/templates/item/partials/body.hbs | 2 +- src/templates/item/partials/description.hbs | 2 +- 11 files changed, 120 insertions(+), 20 deletions(-) rename src/templates/actor/{actor-sheet.hbs => character-sheet.hbs} (88%) create mode 100644 src/templates/actor/creature-sheet.hbs diff --git a/src/lang/de.json b/src/lang/de.json index e52673cc..fc973952 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -10,6 +10,7 @@ "DS4.HeadingProfile": "Profil", "DS4.HeadingTalents": "Talente & Fähigkeiten", "DS4.HeadingSpells": "Zaubersprüche", + "DS4.HeadingDescription": "Beschreibung", "DS4.AttackType": "Angriffs Typ", "DS4.AttackTypeAbbr": "AT", "DS4.WeaponBonus": "Waffen Bonus", @@ -130,6 +131,7 @@ "DS4.TalentRankTotal": "Gesamter Rang", "DS4.CharacterLanguageLanguages": "Sprachen", "DS4.CharacterLanguageAlphabets": "Schriftzeichen", + "DS4.CharacterProfileBiography": "Biographie", "DS4.CharacterProfileGender": "Geschlecht", "DS4.CharacterProfileBirthday": "Geburtstag", "DS4.CharacterProfileBirthplace": "Geburtsort", @@ -156,6 +158,7 @@ "DS4.CreatureBaseInfoCreatureType": "Kreaturengruppe", "DS4.CreatureBaseInfoSizeCategory": "Größenkategorie", "DS4.CreatureBaseInfoExperiencePoints": "Erfahrungspunkte", + "DS4.CreatureBaseInfoDescription": "Beschreibung", "DS4.WarningManageActiveEffectOnOwnedItem": "Das Verwalten von aktiven Effekten innerhalb eines besessen Items wird derzeit nicht unterstützt und wird in einem nachfolgenden Update hinzugefügt.", "DS4.ErrorDiceCritOverlap": "Es gibt eine Überlappung zwischen Patzern und Immersiegen.", "DS4.ErrorExplodingRecursionLimitExceeded": "Die maximale Rekursionstiefe für slayende Würfelwürfe wurde überschritten.", diff --git a/src/lang/en.json b/src/lang/en.json index 23a382c5..f3b4e8a1 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -10,6 +10,7 @@ "DS4.HeadingProfile": "Profile", "DS4.HeadingTalents": "Talents & Abilities", "DS4.HeadingSpells": "Spells", + "DS4.HeadingDescription": "Description", "DS4.AttackType": "Attack Type", "DS4.AttackTypeAbbr": "AT", "DS4.WeaponBonus": "Weapon Bonus", @@ -130,6 +131,7 @@ "DS4.TalentRankTotal": "Total Ranks", "DS4.CharacterLanguageLanguages": "Languages", "DS4.CharacterLanguageAlphabets": "Alphabets", + "DS4.CharacterProfileBiography": "Biography", "DS4.CharacterProfileGender": "Gender", "DS4.CharacterProfileBirthday": "Birthday", "DS4.CharacterProfileBirthplace": "Birthplace", @@ -156,6 +158,7 @@ "DS4.CreatureBaseInfoCreatureType": "Creature Type", "DS4.CreatureBaseInfoSizeCategory": "Size Category", "DS4.CreatureBaseInfoExperiencePoints": "Experience Points", + "DS4.CreatureBaseInfoDescription": "Description", "DS4.WarningManageActiveEffectOnOwnedItem": "Managing Active Effects within an Owned Item is not currently supported and will be added in a subsequent update.", "DS4.ErrorDiceCritOverlap": "There's an overlap between Fumbles and Coups", "DS4.ErrorExplodingRecursionLimitExceeded": "Maximum recursion depth for exploding dice roll exceeded", diff --git a/src/module/actor/actor-data.ts b/src/module/actor/actor-data.ts index 1a935841..edacb2c2 100644 --- a/src/module/actor/actor-data.ts +++ b/src/module/actor/actor-data.ts @@ -75,6 +75,7 @@ interface DS4ActorDataCharacterLanguage { } interface DS4ActorDataCharacterProfile { + biography: string; gender: string; birthday: string; birthplace: string; @@ -100,4 +101,5 @@ interface DS4ActorDataCreatureBaseInfo { creatureType: CreatureType; sizeCategory: SizeCategory; experiencePoints: number; + description: string; } diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index ca14fd0d..3e711d30 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -7,6 +7,24 @@ import { DS4ActorDataType } from "./actor-data"; * @extends {ActorSheet} */ export class DS4ActorSheet extends ActorSheet { + /** @override */ + static get defaultOptions(): FormApplicationOptions { + return mergeObject(super.defaultOptions, { + classes: ["ds4", "sheet", "actor"], + width: 745, + height: 600, + tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }], + }); + } + + /** @override */ + get template(): string { + const path = "systems/ds4/templates/actor"; + return `${path}/${this.actor.data.type}-sheet.hbs`; + } + + /* -------------------------------------------- */ + /** * 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 @@ -25,17 +43,6 @@ export class DS4ActorSheet extends ActorSheet
- +
- +
@@ -39,7 +41,8 @@
- +
@@ -81,7 +84,8 @@ {{!-- Biography Tab --}}
- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} + {{editor content=data.profile.biography target="data.profile.biography" button=true owner=owner + editable=editable}}
- \ No newline at end of file + diff --git a/src/templates/actor/creature-sheet.hbs b/src/templates/actor/creature-sheet.hbs new file mode 100644 index 00000000..40d5eaf4 --- /dev/null +++ b/src/templates/actor/creature-sheet.hbs @@ -0,0 +1,74 @@ +
+ {{!-- Sheet Header --}} +
+ +
+

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ {{> systems/ds4/templates/actor/partials/attributes-traits.hbs}} + {{> systems/ds4/templates/actor/partials/combat-values.hbs}} +
+
+ + {{!-- Sheet Tab Navigation --}} + + + {{!-- Sheet Body --}} +
+ {{!-- Items Tab --}} + {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + + {{!-- Spells Tab --}} + {{> systems/ds4/templates/actor/partials/spells-overview.hbs}} + + {{!-- Description Tab --}} +
+ {{editor content=data.baseInfo.description target="data.baseInfo.description" button=true owner=owner + editable=editable}} +
+
+
\ No newline at end of file diff --git a/src/templates/actor/partials/profile.hbs b/src/templates/actor/partials/profile.hbs index 05d51146..ea62c70a 100644 --- a/src/templates/actor/partials/profile.hbs +++ b/src/templates/actor/partials/profile.hbs @@ -1,6 +1,7 @@
{{#each data.profile as |profile-data-value profile-data-key|}} + {{#if (neq profile-data-key 'biography')}}
+ {{/if}} {{/each}}
-
\ No newline at end of file +
diff --git a/src/templates/item/partials/body.hbs b/src/templates/item/partials/body.hbs index a7ac4d72..2a9eaecd 100644 --- a/src/templates/item/partials/body.hbs +++ b/src/templates/item/partials/body.hbs @@ -2,7 +2,7 @@ {{!-- Sheet Tab Navigation --}}