diff --git a/langs/en-ca.2.json b/langs/en-ca.2.json index ae5e9b7..82a260e 100644 --- a/langs/en-ca.2.json +++ b/langs/en-ca.2.json @@ -84,7 +84,7 @@ "empty": "---" }, "sheet-names": { - "UntypedDataSheet": "Data Sheet" + "*DataSheet": "Data Sheet" } }, "TYPES": { diff --git a/module/hooks/devInit.mjs b/module/hooks/devInit.mjs index 4f604e0..b7ef326 100644 --- a/module/hooks/devInit.mjs +++ b/module/hooks/devInit.mjs @@ -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`, } ); }; diff --git a/module/sheets/Datasheets/GroupDataSheet.mjs b/module/sheets/Datasheets/GroupDataSheet.mjs new file mode 100644 index 0000000..6c9527a --- /dev/null +++ b/module/sheets/Datasheets/GroupDataSheet.mjs @@ -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; + }; +}; diff --git a/templates/datasheets/actor/group.hbs b/templates/datasheets/actor/group.hbs new file mode 100644 index 0000000..5cd9830 --- /dev/null +++ b/templates/datasheets/actor/group.hbs @@ -0,0 +1,36 @@ +
+
+ + +
+
+ + +
+
+ + +
+
+ Milestones Hit +
+ {{ computed.milestones_hit_viewable }} +
+
\ No newline at end of file