Add the ability to automate items and attributes using a Macro
This commit is contained in:
parent
47892d116b
commit
8f67bff2ec
8 changed files with 45 additions and 2 deletions
|
|
@ -68,7 +68,8 @@
|
|||
"weight": "Weight",
|
||||
"quantity": "Quantity",
|
||||
"equipped": "Equipped",
|
||||
"group": "Group"
|
||||
"group": "Group",
|
||||
"trigger": "Macro to Execute"
|
||||
},
|
||||
"attribute": {
|
||||
"key": {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export class GenericItemSheet extends
|
|||
],
|
||||
position: {
|
||||
width: 400,
|
||||
height: 450,
|
||||
height: 550,
|
||||
},
|
||||
window: {
|
||||
resizable: true,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel {
|
|||
aboveTheFold: new fields.BooleanField({
|
||||
initial: false,
|
||||
}),
|
||||
trigger: new fields.DocumentUUIDField({
|
||||
embedded: false,
|
||||
relative: false,
|
||||
type: foundry.documents.Macro.documentName,
|
||||
}),
|
||||
|
||||
/* The attributes current value */
|
||||
value: new fields.NumberField({
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ export class GenericItemData extends foundry.abstract.TypeDataModel {
|
|||
equipped: new fields.BooleanField({
|
||||
initial: true,
|
||||
}),
|
||||
trigger: new fields.DocumentUUIDField({
|
||||
embedded: false,
|
||||
relative: false,
|
||||
type: foundry.documents.Macro.documentName,
|
||||
}),
|
||||
description: new fields.HTMLField({
|
||||
blank: true,
|
||||
trim: true,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@
|
|||
gap: 2px 8px;
|
||||
margin: 0 8px 8px;
|
||||
|
||||
&.wide-input {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.hint {
|
||||
grid-column: 1 / -1;
|
||||
margin: 0;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@
|
|||
justify-items: left;
|
||||
gap: 8px;
|
||||
|
||||
&.wide-input {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
taf-toggle {
|
||||
justify-self: end;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,4 +36,16 @@
|
|||
>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="property wide-input">
|
||||
<label for="{{meta.idp}}-trigger">
|
||||
{{ localize "taf.misc.item.trigger" }}
|
||||
</label>
|
||||
<document-tags
|
||||
id="{{meta.idp}}-trigger"
|
||||
single
|
||||
type="Macro"
|
||||
name="system.trigger"
|
||||
value="{{system.trigger}}"
|
||||
></document-tags>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,18 @@
|
|||
{{checked system.equipped}}
|
||||
></taf-toggle>
|
||||
</div>
|
||||
<div class="property wide-input">
|
||||
<label for="{{meta.idp}}-trigger">
|
||||
{{ localize "taf.misc.item.trigger" }}
|
||||
</label>
|
||||
<document-tags
|
||||
id="{{meta.idp}}-trigger"
|
||||
single
|
||||
type="Macro"
|
||||
name="system.trigger"
|
||||
value="{{system.trigger}}"
|
||||
></document-tags>
|
||||
</div>
|
||||
<div class="bordered description">
|
||||
{{#if meta.editable}}
|
||||
<prose-mirror
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue