mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 13:41:07 +01:00
Beastform button shifts to cancelBeastform
This commit is contained in:
parent
bea5c08fbd
commit
332b90afec
4 changed files with 24 additions and 19 deletions
|
|
@ -216,7 +216,8 @@
|
||||||
},
|
},
|
||||||
"viewLevelups": "View Levelups",
|
"viewLevelups": "View Levelups",
|
||||||
"InvalidOldCharacterImportTitle": "Old Character Import",
|
"InvalidOldCharacterImportTitle": "Old Character Import",
|
||||||
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?"
|
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?",
|
||||||
|
"cancelBeastform": "Cancel Beastform"
|
||||||
},
|
},
|
||||||
"Companion": {
|
"Companion": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
|
|
@ -316,8 +317,7 @@
|
||||||
"toLoadout": "Send to Loadout",
|
"toLoadout": "Send to Loadout",
|
||||||
"toVault": "Send to Vault",
|
"toVault": "Send to Vault",
|
||||||
"unequip": "Unequip",
|
"unequip": "Unequip",
|
||||||
"useItem": "Use Item",
|
"useItem": "Use Item"
|
||||||
"cancelBeastform": "Cancel Beastform"
|
|
||||||
},
|
},
|
||||||
"Countdown": {
|
"Countdown": {
|
||||||
"addCountdown": "Add Countdown",
|
"addCountdown": "Add Countdown",
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
toggleEquipItem: CharacterSheet.#toggleEquipItem,
|
toggleEquipItem: CharacterSheet.#toggleEquipItem,
|
||||||
toggleResourceDice: CharacterSheet.#toggleResourceDice,
|
toggleResourceDice: CharacterSheet.#toggleResourceDice,
|
||||||
handleResourceDice: CharacterSheet.#handleResourceDice,
|
handleResourceDice: CharacterSheet.#handleResourceDice,
|
||||||
|
cancelBeastform: CharacterSheet.#cancelBeastform,
|
||||||
useDowntime: this.useDowntime
|
useDowntime: this.useDowntime
|
||||||
},
|
},
|
||||||
window: {
|
window: {
|
||||||
|
|
@ -219,6 +220,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
context.beastformActive = this.document.effects.find(x => x.type === 'beastform');
|
||||||
|
|
||||||
const homebrewCurrency = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).currency;
|
const homebrewCurrency = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).currency;
|
||||||
if (homebrewCurrency.enabled) {
|
if (homebrewCurrency.enabled) {
|
||||||
context.inventory.currency = homebrewCurrency;
|
context.inventory.currency = homebrewCurrency;
|
||||||
|
|
@ -848,6 +851,15 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static async #cancelBeastform(_, target) {
|
||||||
|
const item = await getDocFromElement(target);
|
||||||
|
if (!item) return;
|
||||||
|
game.system.api.fields.ActionFields.BeastformField.handleActiveTransformations.call(item);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open the downtime application.
|
* Open the downtime application.
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
|
|
|
||||||
|
|
@ -420,19 +420,6 @@ export default function DHApplicationMixin(Base) {
|
||||||
];
|
];
|
||||||
|
|
||||||
if (usable) {
|
if (usable) {
|
||||||
options.unshift({
|
|
||||||
name: 'DAGGERHEART.APPLICATIONS.ContextMenu.cancelBeastform',
|
|
||||||
icon: 'fa-solid fa-ban',
|
|
||||||
condition: target => {
|
|
||||||
const doc = getDocFromElementSync(target);
|
|
||||||
return doc && doc.system?.actions?.some(a => a.type === 'beastform');
|
|
||||||
},
|
|
||||||
callback: async target =>
|
|
||||||
game.system.api.fields.ActionFields.BeastformField.handleActiveTransformations.call(
|
|
||||||
await getDocFromElement(target)
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
options.unshift({
|
options.unshift({
|
||||||
name: 'DAGGERHEART.GENERAL.damage',
|
name: 'DAGGERHEART.GENERAL.damage',
|
||||||
icon: 'fa-solid fa-explosion',
|
icon: 'fa-solid fa-explosion',
|
||||||
|
|
|
||||||
|
|
@ -139,9 +139,15 @@ Parameters:
|
||||||
<div class="item-buttons">
|
<div class="item-buttons">
|
||||||
{{#each item.system.actions as | action |}}
|
{{#each item.system.actions as | action |}}
|
||||||
<div class="item-button">
|
<div class="item-button">
|
||||||
<button type="button" data-action="useItem" data-item-uuid="{{action.uuid}}">
|
{{#if (and (eq action.type 'beastform') @root.beastformActive)}}
|
||||||
{{action.name}}
|
<button type="button" data-action="cancelBeastform" data-item-uuid="{{action.uuid}}">
|
||||||
</button>
|
{{localize "DAGGERHEART.ACTORS.Character.cancelBeastform"}}
|
||||||
|
</button>
|
||||||
|
{{else}}
|
||||||
|
<button type="button" data-action="useItem" data-item-uuid="{{action.uuid}}">
|
||||||
|
{{action.name}}
|
||||||
|
</button>
|
||||||
|
{{/if}}
|
||||||
{{#if action.uses.max}}
|
{{#if action.uses.max}}
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
<button type="button" class="action-uses-button" data-action="increaseActionUses" data-item-uuid="{{action.uuid}}">
|
<button type="button" class="action-uses-button" data-action="increaseActionUses" data-item-uuid="{{action.uuid}}">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue