mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Merge branch 'feature/action-areas' of https://github.com/Foundryborne/daggerheart into feature/action-areas
This commit is contained in:
commit
cb999d3d48
4 changed files with 7 additions and 5 deletions
|
|
@ -57,7 +57,7 @@ export default class ActionSelectionDialog extends HandlebarsApplicationMixin(Ap
|
|||
|
||||
/** @inheritDoc */
|
||||
async _prepareContext(options) {
|
||||
const actions = this.#item.system.actions.map(action => ({
|
||||
const actions = this.#item.system.actionsList.map(action => ({
|
||||
...action.toObject(),
|
||||
id: action.id,
|
||||
img: action.baseAction ? action.parent.parent.img : action.img
|
||||
|
|
@ -72,7 +72,7 @@ export default class ActionSelectionDialog extends HandlebarsApplicationMixin(Ap
|
|||
|
||||
static async #onChooseAction(event, button) {
|
||||
const { actionId } = button.dataset;
|
||||
this.action = this.item.system.actions.find(a => a._id === actionId);
|
||||
this.action = this.item.system.actionsList.find(a => a._id === actionId);
|
||||
Object.defineProperty(this.event, 'shiftKey', {
|
||||
get() {
|
||||
return event.shiftKey;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
|||
this.action =
|
||||
config.data.attack?._id == config.source.action
|
||||
? config.data.attack
|
||||
: this.item.system.actions?.find(a => a.id === config.source.action);
|
||||
: this.item.system.actionsList?.find(a => a.id === config.source.action);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
|||
];
|
||||
default:
|
||||
const item = actionActor.items.get(this.source.item);
|
||||
return item ? item.system.actions?.find(a => a.id === this.source.action) : null;
|
||||
return item ? item.system.actionsList?.find(a => a.id === this.source.action) : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,9 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
|
||||
get actionsList() {
|
||||
// No actions on non-characters
|
||||
if (this.actor && this.actor.type !== 'character') return [];
|
||||
if (this.metadata.isInventoryItem && this.actor && this.actor.type !== 'character') {
|
||||
return [];
|
||||
}
|
||||
return this.actions;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue