Add datasheet for sync sheets
This commit is contained in:
parent
d8b676535f
commit
a1e9c565af
4 changed files with 79 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ Initialization of dev-specific features for the init hook, this is primarily
|
|||
used to register all of the data sheets of various entity types.
|
||||
*/
|
||||
|
||||
import { GroupDataSheet } from "../sheets/Datasheets/GroupDataSheet.mjs";
|
||||
import { UntypedDataSheet } from "../sheets/Datasheets/UntypedDataSheet.mjs";
|
||||
|
||||
export function devInit() {
|
||||
|
|
@ -11,7 +12,16 @@ export function devInit() {
|
|||
UntypedDataSheet,
|
||||
{
|
||||
types: [`untyped`, `foil`],
|
||||
label: `dotdungeon.sheet-names.UntypedDataSheet`,
|
||||
label: `dotdungeon.sheet-names.*DataSheet`,
|
||||
}
|
||||
);
|
||||
|
||||
Actors.registerSheet(
|
||||
`dotdungeon`,
|
||||
GroupDataSheet,
|
||||
{
|
||||
types: [`sync`],
|
||||
label: `dotdungeon.sheet-names.*DataSheet`,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
|
|||
31
module/sheets/Datasheets/GroupDataSheet.mjs
Normal file
31
module/sheets/Datasheets/GroupDataSheet.mjs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
export class GroupDataSheet extends ActorSheet {
|
||||
static get defaultOptions() {
|
||||
let opts = foundry.utils.mergeObject(
|
||||
super.defaultOptions,
|
||||
{
|
||||
template: `systems/dotdungeon/templates/datasheets/actor/group.hbs`,
|
||||
width: 200,
|
||||
height: 275
|
||||
},
|
||||
);
|
||||
opts.classes.push(`dotdungeon`, `style-v3`);
|
||||
return opts;
|
||||
};
|
||||
|
||||
async getData() {
|
||||
const ctx = {};
|
||||
|
||||
ctx.actor = this.actor;
|
||||
ctx.system = this.actor.system;
|
||||
|
||||
ctx.computed = {
|
||||
milestones_hit_viewable: [...this.actor.system.milestones_hit.values()].join(`, `)
|
||||
}
|
||||
|
||||
ctx.meta = {
|
||||
idp: this.actor.uuid,
|
||||
};
|
||||
|
||||
return ctx;
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue