Finish the initial requirements for the header partial
This commit is contained in:
parent
d70c5113b1
commit
8ed6f49c8d
3 changed files with 32 additions and 9 deletions
|
|
@ -6,7 +6,7 @@ import { editItemFromElement, deleteItemFromElement } from "../utils.mjs";
|
|||
|
||||
const { HandlebarsApplicationMixin } = foundry.applications.api;
|
||||
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||
const { ContextMenu } = foundry.applications.ux;
|
||||
const { ContextMenu, TextEditor } = foundry.applications.ux;
|
||||
|
||||
export class BookGeistSheet extends
|
||||
LaidOutAppMixin(
|
||||
|
|
@ -99,7 +99,13 @@ export class BookGeistSheet extends
|
|||
|
||||
async _prepareHeaderContext(ctx) {
|
||||
ctx.name = this.actor.name;
|
||||
ctx.description = null; // this.actor.system.description;
|
||||
ctx.rank = this.actor.system.level.rank;
|
||||
ctx.ranks = Object.values(gameTerms.Rank)
|
||||
.map((value, index) => ({
|
||||
value,
|
||||
label: index
|
||||
}));
|
||||
ctx.description = await TextEditor.implementation.enrichHTML(this.actor.system.description);
|
||||
};
|
||||
|
||||
async _prepareStatsContext(ctx) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,18 @@
|
|||
import { EntityData } from "./Entity.mjs";
|
||||
|
||||
export class GeistData extends EntityData {};
|
||||
const { fields } = foundry.data;
|
||||
|
||||
export class GeistData extends EntityData {
|
||||
static defineSchema() {
|
||||
const schema = super.defineSchema();
|
||||
|
||||
schema.description = new fields.HTMLField({
|
||||
blank: true,
|
||||
nullable: true,
|
||||
trim: true,
|
||||
initial: null,
|
||||
});
|
||||
|
||||
return schema;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@
|
|||
value="{{name}}"
|
||||
>
|
||||
<div class="grow"></div>
|
||||
<label for="{{meta-idp}}-rank">
|
||||
Rank
|
||||
<select name="">
|
||||
<option value="novice">0</option>
|
||||
<option value="adept">I</option>
|
||||
<option value="master">II</option>
|
||||
<option value="expert">III</option>
|
||||
</label>
|
||||
<select
|
||||
id="{{meta.idp}}-rank"
|
||||
name="system.level.rank"
|
||||
>
|
||||
{{rc-options rank ranks}}
|
||||
</select>
|
||||
</div>
|
||||
{{#if description}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue