mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-23 16:03:39 +02:00
Fix regression with actions list
This commit is contained in:
parent
5bde5a8fe5
commit
61a453a504
4 changed files with 7 additions and 5 deletions
|
|
@ -57,7 +57,7 @@ export default class ActionSelectionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
async _prepareContext(options) {
|
async _prepareContext(options) {
|
||||||
const actions = this.#item.system.actions.map(action => ({
|
const actions = this.#item.system.actionsList.map(action => ({
|
||||||
...action.toObject(),
|
...action.toObject(),
|
||||||
id: action.id,
|
id: action.id,
|
||||||
img: action.baseAction ? action.parent.parent.img : action.img
|
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) {
|
static async #onChooseAction(event, button) {
|
||||||
const { actionId } = button.dataset;
|
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', {
|
Object.defineProperty(this.event, 'shiftKey', {
|
||||||
get() {
|
get() {
|
||||||
return event.shiftKey;
|
return event.shiftKey;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
this.action =
|
this.action =
|
||||||
config.data.attack?._id == config.source.action
|
config.data.attack?._id == config.source.action
|
||||||
? config.data.attack
|
? 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:
|
default:
|
||||||
const item = actionActor.items.get(this.source.item);
|
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() {
|
get actionsList() {
|
||||||
// No actions on non-characters
|
// 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;
|
return this.actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue