mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Add checkboxes
This commit is contained in:
parent
73a19fc0bb
commit
0f0cb0a53b
5 changed files with 9 additions and 2 deletions
|
|
@ -85,6 +85,9 @@
|
||||||
},
|
},
|
||||||
"applyTo": {
|
"applyTo": {
|
||||||
"label": "Targeted Resource"
|
"label": "Targeted Resource"
|
||||||
|
},
|
||||||
|
"consumeOnSuccess": {
|
||||||
|
"label": "Consume on Success only"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ export default class CostField extends fields.ArrayField {
|
||||||
keyIsID: new fields.BooleanField(),
|
keyIsID: new fields.BooleanField(),
|
||||||
value: new fields.NumberField({ nullable: true, initial: 1 }),
|
value: new fields.NumberField({ nullable: true, initial: 1 }),
|
||||||
scalable: new fields.BooleanField({ initial: false }),
|
scalable: new fields.BooleanField({ initial: false }),
|
||||||
step: new fields.NumberField({ nullable: true, initial: null })
|
step: new fields.NumberField({ nullable: true, initial: null }),
|
||||||
|
consumeOnSuccess: new fields.BooleanField({ initial: false, label: "DAGGERHEART.ACTIONS.Settings.consumeOnSuccess.label" })
|
||||||
});
|
});
|
||||||
super(element, options, context);
|
super(element, options, context);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ export default class UsesField extends fields.SchemaField {
|
||||||
choices: CONFIG.DH.GENERAL.refreshTypes,
|
choices: CONFIG.DH.GENERAL.refreshTypes,
|
||||||
initial: null,
|
initial: null,
|
||||||
nullable: true
|
nullable: true
|
||||||
})
|
}),
|
||||||
|
consumeOnSuccess: new fields.BooleanField({ initial: false, label: "DAGGERHEART.ACTIONS.Settings.consumeOnSuccess.label" })
|
||||||
};
|
};
|
||||||
super(usesFields, options, context);
|
super(usesFields, options, context);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
<a><i class="fa-solid fa-plus icon-button" data-action="addElement"></i></a>
|
<a><i class="fa-solid fa-plus icon-button" data-action="addElement"></i></a>
|
||||||
</legend>
|
</legend>
|
||||||
{{#each source as |cost index|}}
|
{{#each source as |cost index|}}
|
||||||
|
{{formField ../fields.consumeOnSuccess value=cost.consumeOnSuccess name=(concat "cost." index ".consumeOnSuccess") classes="checkbox" rootId=partId localize=true}}
|
||||||
<div class="nest-inputs">
|
<div class="nest-inputs">
|
||||||
{{formField ../fields.scalable label="Scalable" value=cost.scalable name=(concat "cost." index ".scalable") classes="checkbox"}}
|
{{formField ../fields.scalable label="Scalable" value=cost.scalable name=(concat "cost." index ".scalable") classes="checkbox"}}
|
||||||
{{formField ../fields.key choices=(@root.disableOption index @root.costOptions ../source) label="Resource" value=cost.key name=(concat "cost." index ".key") localize=true blank=false}}
|
{{formField ../fields.key choices=(@root.disableOption index @root.costOptions ../source) label="Resource" value=cost.key name=(concat "cost." index ".key") localize=true blank=false}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<fieldset class="one-column">
|
<fieldset class="one-column">
|
||||||
<legend>{{localize "DAGGERHEART.GENERAL.uses"}}</legend>
|
<legend>{{localize "DAGGERHEART.GENERAL.uses"}}</legend>
|
||||||
|
{{formField fields.consumeOnSuccess value=source.consumeOnSuccess name="uses.consumeOnSuccess" classes="checkbox" rootId=partId localize=true}}
|
||||||
<div class="nest-inputs">
|
<div class="nest-inputs">
|
||||||
{{formField fields.value label="Spent" value=source.value name="uses.value" rootId=partId}}
|
{{formField fields.value label="Spent" value=source.value name="uses.value" rootId=partId}}
|
||||||
{{formField fields.max label="Max" value=source.max name="uses.max" rootId=partId}}
|
{{formField fields.max label="Max" value=source.max name="uses.max" rootId=partId}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue