Initialize the BookGeistSheet
This commit is contained in:
parent
163423ea5b
commit
7935a85188
9 changed files with 153 additions and 8 deletions
99
module/Apps/ActorSheets/BookGeistSheet.mjs
Normal file
99
module/Apps/ActorSheets/BookGeistSheet.mjs
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
import { filePath } from "../../consts.mjs";
|
||||||
|
import { GenericAppMixin } from "../mixins/GenericApp.mjs";
|
||||||
|
import { LaidOutAppMixin } from "../mixins/LaidOutAppMixin.mjs";
|
||||||
|
|
||||||
|
const { HandlebarsApplicationMixin } = foundry.applications.api;
|
||||||
|
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||||
|
|
||||||
|
export class BookGeistSheet extends LaidOutAppMixin(GenericAppMixin(HandlebarsApplicationMixin(ActorSheetV2))) {
|
||||||
|
// #region Options
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: [
|
||||||
|
`ripcrypt--actor`,
|
||||||
|
`BookGeistSheet`,
|
||||||
|
],
|
||||||
|
// position: {
|
||||||
|
// width: ``,
|
||||||
|
// height: ``,
|
||||||
|
// },
|
||||||
|
window: {
|
||||||
|
resizable: true,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
submitOnChange: true,
|
||||||
|
closeOnSubmite: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static PARTS = {
|
||||||
|
layout: {
|
||||||
|
root: true,
|
||||||
|
template: filePath(`templates/Apps/BookGeistSheet/layout.hbs`),
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
template: filePath(`templates/Apps/BookGeistSheet/image.hbs`),
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
template: filePath(`templates/Apps/BookGeistSheet/header.hbs`),
|
||||||
|
},
|
||||||
|
stats: {
|
||||||
|
template: filePath(`templates/Apps/BookGeistSheet/stats.hbs`),
|
||||||
|
},
|
||||||
|
items: {
|
||||||
|
template: filePath(`templates/Apps/BookGeistSheet/items.hbs`),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
// #endregion Options
|
||||||
|
|
||||||
|
// #region Lifecycle
|
||||||
|
// #endregion Lifecycle
|
||||||
|
|
||||||
|
// #region Data Prep
|
||||||
|
_preparePartContext(partID, ctx) {
|
||||||
|
|
||||||
|
switch (partID) {
|
||||||
|
case `layout`: this._prepareLayoutContext(ctx); break;
|
||||||
|
case `image`: this._prepareImageContext(ctx); break;
|
||||||
|
case `header`: this._prepareHeaderContext(ctx); break;
|
||||||
|
case `stats`: this._prepareStatsContext(ctx); break;
|
||||||
|
case `items`: this._prepareItemsContext(ctx); break;
|
||||||
|
};
|
||||||
|
|
||||||
|
return ctx;
|
||||||
|
};
|
||||||
|
|
||||||
|
_prepareLayoutContext(ctx) {
|
||||||
|
ctx.imageVisible = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
_prepareImageContext(ctx) {
|
||||||
|
ctx.url = this.actor.img;
|
||||||
|
};
|
||||||
|
|
||||||
|
_prepareHeaderContext(ctx) {
|
||||||
|
ctx.name = this.actor.name;
|
||||||
|
ctx.description = null; // this.actor.system.description;
|
||||||
|
};
|
||||||
|
|
||||||
|
_prepareStatsContext(ctx) {
|
||||||
|
const system = this.actor.system;
|
||||||
|
ctx.path = system.fate;
|
||||||
|
Object.assign(ctx, system.ability);
|
||||||
|
ctx.guts = system.guts;
|
||||||
|
ctx.speed = system.speed;
|
||||||
|
};
|
||||||
|
|
||||||
|
_prepareItemsContext(ctx) {
|
||||||
|
ctx.attacks = [];
|
||||||
|
ctx.defense = {
|
||||||
|
locations: `None`,
|
||||||
|
protection: 0,
|
||||||
|
shield: false,
|
||||||
|
};
|
||||||
|
ctx.traits = [];
|
||||||
|
};
|
||||||
|
// #endregion Data Prep
|
||||||
|
|
||||||
|
// #region Actions
|
||||||
|
// #endregion Actions
|
||||||
|
};
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// Applications
|
// Applications
|
||||||
import { AllItemSheetV1 } from "../Apps/ItemSheets/AllItemSheetV1.mjs";
|
import { AllItemSheetV1 } from "../Apps/ItemSheets/AllItemSheetV1.mjs";
|
||||||
import { ArmourSheet } from "../Apps/ItemSheets/ArmourSheet.mjs";
|
import { ArmourSheet } from "../Apps/ItemSheets/ArmourSheet.mjs";
|
||||||
|
import { BookGeistSheet } from "../Apps/ActorSheets/BookGeistSheet.mjs";
|
||||||
import { CombinedHeroSheet } from "../Apps/ActorSheets/CombinedHeroSheet.mjs";
|
import { CombinedHeroSheet } from "../Apps/ActorSheets/CombinedHeroSheet.mjs";
|
||||||
import { CraftCardV1 } from "../Apps/ActorSheets/CraftCardV1.mjs";
|
import { CraftCardV1 } from "../Apps/ActorSheets/CraftCardV1.mjs";
|
||||||
import { DelveDiceHUD } from "../Apps/DelveDiceHUD.mjs";
|
import { DelveDiceHUD } from "../Apps/DelveDiceHUD.mjs";
|
||||||
|
|
@ -90,22 +91,21 @@ Hooks.once(`init`, () => {
|
||||||
label: `RipCrypt.sheet-names.StatsCardV1`,
|
label: `RipCrypt.sheet-names.StatsCardV1`,
|
||||||
themes: StatsCardV1.themes,
|
themes: StatsCardV1.themes,
|
||||||
});
|
});
|
||||||
Actors.registerSheet(game.system.id, StatsCardV1, {
|
|
||||||
makeDefault: true,
|
|
||||||
types: [`geist`],
|
|
||||||
label: `RipCrypt.sheet-names.StatsCardV1`,
|
|
||||||
themes: StatsCardV1.themes,
|
|
||||||
});
|
|
||||||
Actors.registerSheet(game.system.id, SkillsCardV1, {
|
Actors.registerSheet(game.system.id, SkillsCardV1, {
|
||||||
types: [`hero`, `geist`],
|
types: [`hero`],
|
||||||
label: `RipCrypt.sheet-names.SkillsCardV1`,
|
label: `RipCrypt.sheet-names.SkillsCardV1`,
|
||||||
themes: SkillsCardV1.themes,
|
themes: SkillsCardV1.themes,
|
||||||
});
|
});
|
||||||
Actors.registerSheet(game.system.id, CraftCardV1, {
|
Actors.registerSheet(game.system.id, CraftCardV1, {
|
||||||
types: [`hero`, `geist`],
|
types: [`hero`],
|
||||||
label: `RipCrypt.sheet-names.CraftCardV1`,
|
label: `RipCrypt.sheet-names.CraftCardV1`,
|
||||||
themes: CraftCardV1.themes,
|
themes: CraftCardV1.themes,
|
||||||
});
|
});
|
||||||
|
Actors.registerSheet(game.system.id, BookGeistSheet, {
|
||||||
|
types: [`geist`],
|
||||||
|
label: `RipCrypt.sheet-names.BookGeistSheet`,
|
||||||
|
themes: BookGeistSheet.themes,
|
||||||
|
});
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region Items
|
// #region Items
|
||||||
|
|
|
||||||
7
templates/Apps/BookGeistSheet/header.hbs
Normal file
7
templates/Apps/BookGeistSheet/header.hbs
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="name"
|
||||||
|
value="{{name}}"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
3
templates/Apps/BookGeistSheet/image.hbs
Normal file
3
templates/Apps/BookGeistSheet/image.hbs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<div>
|
||||||
|
IMAGE
|
||||||
|
</div>
|
||||||
1
templates/Apps/BookGeistSheet/items.hbs
Normal file
1
templates/Apps/BookGeistSheet/items.hbs
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<div>ITEMS</div>
|
||||||
10
templates/Apps/BookGeistSheet/layout.hbs
Normal file
10
templates/Apps/BookGeistSheet/layout.hbs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<div>
|
||||||
|
{{#if imageVisible}}
|
||||||
|
<div data-application-part="image"></div>
|
||||||
|
{{/if}}
|
||||||
|
<div class="info">
|
||||||
|
<div data-application-part="header"></div>
|
||||||
|
<div data-application-part="stats"></div>
|
||||||
|
<div data-application-part="items"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
11
templates/Apps/BookGeistSheet/stats.hbs
Normal file
11
templates/Apps/BookGeistSheet/stats.hbs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<div>
|
||||||
|
<ul>
|
||||||
|
<li>Path: {{path}}</li>
|
||||||
|
<li>Grit: {{grit}}</li>
|
||||||
|
<li>Gait: {{gait}}</li>
|
||||||
|
<li>Grip: {{grip}}</li>
|
||||||
|
<li>Glim: {{glim}}</li>
|
||||||
|
<li>Guts: {{guts.value}} / {{guts.max}}</li>
|
||||||
|
<li>Move: {{speed.move}} / {{speed.run}}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
13
templates/Apps/BookGeistSheet/style.css
Normal file
13
templates/Apps/BookGeistSheet/style.css
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
.BookGeistSheet {
|
||||||
|
> .window-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
@import url("./RichEditor/style.css");
|
@import url("./RichEditor/style.css");
|
||||||
@import url("./ArmourSheet/style.css");
|
@import url("./ArmourSheet/style.css");
|
||||||
@import url("./TraitSheet/style.css");
|
@import url("./TraitSheet/style.css");
|
||||||
|
@import url("./BookGeistSheet/style.css");
|
||||||
|
|
||||||
@import url("./popover.css");
|
@import url("./popover.css");
|
||||||
@import url("./popovers/AmmoTracker/style.css");
|
@import url("./popovers/AmmoTracker/style.css");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue