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 { HandlebarsApplicationMixin } = foundry.applications.api;
|
||||||
const { ActorSheetV2 } = foundry.applications.sheets;
|
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||||
const { ContextMenu } = foundry.applications.ux;
|
const { ContextMenu, TextEditor } = foundry.applications.ux;
|
||||||
|
|
||||||
export class BookGeistSheet extends
|
export class BookGeistSheet extends
|
||||||
LaidOutAppMixin(
|
LaidOutAppMixin(
|
||||||
|
|
@ -99,7 +99,13 @@ export class BookGeistSheet extends
|
||||||
|
|
||||||
async _prepareHeaderContext(ctx) {
|
async _prepareHeaderContext(ctx) {
|
||||||
ctx.name = this.actor.name;
|
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) {
|
async _prepareStatsContext(ctx) {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,18 @@
|
||||||
import { EntityData } from "./Entity.mjs";
|
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}}"
|
value="{{name}}"
|
||||||
>
|
>
|
||||||
<div class="grow"></div>
|
<div class="grow"></div>
|
||||||
Rank
|
<label for="{{meta-idp}}-rank">
|
||||||
<select name="">
|
Rank
|
||||||
<option value="novice">0</option>
|
</label>
|
||||||
<option value="adept">I</option>
|
<select
|
||||||
<option value="master">II</option>
|
id="{{meta.idp}}-rank"
|
||||||
<option value="expert">III</option>
|
name="system.level.rank"
|
||||||
|
>
|
||||||
|
{{rc-options rank ranks}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{{#if description}}
|
{{#if description}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue