Add datasheet for sync sheets
This commit is contained in:
parent
d8b676535f
commit
a1e9c565af
4 changed files with 79 additions and 2 deletions
|
|
@ -84,7 +84,7 @@
|
|||
"empty": "---"
|
||||
},
|
||||
"sheet-names": {
|
||||
"UntypedDataSheet": "Data Sheet"
|
||||
"*DataSheet": "Data Sheet"
|
||||
}
|
||||
},
|
||||
"TYPES": {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
36
templates/datasheets/actor/group.hbs
Normal file
36
templates/datasheets/actor/group.hbs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<form autocomplete="off" class="datasheet">
|
||||
<div>
|
||||
<label for="{{meta.idp}}-name" data-tooltip="name">Name</label>
|
||||
<input
|
||||
type="text"
|
||||
name="name"
|
||||
id="{{meta.idp}}-name"
|
||||
value="{{actor.name}}"
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<label for="{{meta.idp}}-sync" data-tooltip="system.value">Sync</label>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
name="system.value"
|
||||
id="{{meta.idp}}-sync"
|
||||
value="{{system.value}}"
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<label for="{{meta.idp}}-restdice" data-tooltip="system.rest_dice">Rest Dice</label>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
name="system.rest_dice"
|
||||
id="{{meta.idp}}-restdice"
|
||||
value="{{system.rest_dice}}"
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<span data-tooltip="system.milestones_hit">Milestones Hit</span>
|
||||
<br>
|
||||
{{ computed.milestones_hit_viewable }}
|
||||
</div>
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue