added a (really really) rudimentary character Sheet
Pull Request Check / testing (pull_request) Successful in 8s Details

pull/13/head
Jendrik 2025-09-26 09:59:35 +02:00
parent 41de33cef3
commit b896af479e
3 changed files with 36 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import {PlayerCharacterDataModel} from "./module/character/character.mjs"; import {PlayerCharacterDataModel} from "./module/character/character.mjs";
import {DsaActor} from "./module/Actors/dsa-actor.mjs"; import {DsaActor} from "./module/Actors/dsa-actor.mjs";
import {CharacterSheet} from "./module/Sheet/CharacterSheet.mjs";
Hooks.once("init", () => { Hooks.once("init", () => {
// Configure custom Document implementations. // Configure custom Document implementations.
@ -10,5 +11,10 @@ Hooks.once("init", () => {
character: PlayerCharacterDataModel, character: PlayerCharacterDataModel,
}; };
foundry.documents.collections.Actors.registerSheet("dsa41.character", CharacterSheet, {
types: ["character"],
makeDefault: true
});
console.log("DSA 4.1 is ready for development!") console.log("DSA 4.1 is ready for development!")
}) })

View File

@ -0,0 +1,20 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
export class CharacterSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
template: "systems/DSA_4-1/templates/sheets/character-sheet.hbs",
width: 600,
height: 600,
});
}
}
Handlebars.registerHelper("formatCharacter", function(actor) {
return JSON.stringify(actor, null, 4);
});

View File

@ -0,0 +1,10 @@
<form class="flexcol" autocomplete="off">
<header class="sheet-header">
<div class="header-fields">
<h1 class="charname">{{actor.name}}</h1>
</div>
</header>
<section class="sheet-body">
<textarea readonly>{{formatCharacter actor}}</textarea>
</section>
</form>