mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Merge branch 'development' into feature/673-weapon-custom-formula
This commit is contained in:
commit
442cfd4097
1136 changed files with 12094 additions and 5832 deletions
|
|
@ -25,7 +25,7 @@ export default class CostField extends fields.ArrayField {
|
|||
config.costs = CostField.calcCosts.call(this, costs);
|
||||
const hasCost = CostField.hasCost.call(this, config.costs);
|
||||
if (config.isFastForward && !hasCost)
|
||||
return ui.notifications.warn("You don't have the resources to use that action.");
|
||||
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.insufficientResources'));
|
||||
return hasCost;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default class UsesField extends fields.SchemaField {
|
|||
if (uses && !uses.value) uses.value = 0;
|
||||
config.uses = uses;
|
||||
const hasUses = UsesField.hasUses.call(this, config.uses);
|
||||
if (config.isFastForward && !hasUses) return ui.notifications.warn("That action doesn't have remaining uses.");
|
||||
if (config.isFastForward && !hasUses) return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.actionNoUsesRemaining'));
|
||||
return hasUses;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ export class ActionsField extends MappingField {
|
|||
*/
|
||||
export class ActionField extends foundry.data.fields.ObjectField {
|
||||
getModel(value) {
|
||||
if (value && !value.type) value.type = 'attack';
|
||||
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,4 +38,13 @@ export default class ForeignDocumentUUIDField extends foundry.data.fields.Docume
|
|||
toObject(value) {
|
||||
return value?.uuid ?? value;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
_cast(value) {
|
||||
if (typeof value === 'string') return value;
|
||||
if (value instanceof foundry.abstract.Document) return value.uuid;
|
||||
throw new Error(
|
||||
`The value provided to a ForeignDocumentUUIDField must be a ${foundry.abstract.Document.name} instance or a UUID string.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue