mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Fixed so UseItem macros get the img set
This commit is contained in:
parent
a198f6be48
commit
4b40dfd7be
2 changed files with 5 additions and 4 deletions
|
|
@ -65,6 +65,7 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
|
||||||
const attackData = {
|
const attackData = {
|
||||||
type: 'Attack',
|
type: 'Attack',
|
||||||
actorUuid: this.document.uuid,
|
actorUuid: this.document.uuid,
|
||||||
|
img: this.document.system.attack.img,
|
||||||
fromInternal: true
|
fromInternal: true
|
||||||
};
|
};
|
||||||
event.dataTransfer.setData('text/plain', JSON.stringify(attackData));
|
event.dataTransfer.setData('text/plain', JSON.stringify(attackData));
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ export default class DhHotbar extends foundry.applications.ui.Hotbar {
|
||||||
case 'subclass':
|
case 'subclass':
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
this.createItemMacro(data, slot);
|
this.createItemMacro(item, slot);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (data.type === 'Action') {
|
} else if (data.type === 'Action') {
|
||||||
|
|
@ -101,7 +101,7 @@ export default class DhHotbar extends foundry.applications.ui.Hotbar {
|
||||||
const macro = await Macro.implementation.create({
|
const macro = await Macro.implementation.create({
|
||||||
name: `${game.i18n.localize('Display')} ${name}`,
|
name: `${game.i18n.localize('Display')} ${name}`,
|
||||||
type: CONST.MACRO_TYPES.SCRIPT,
|
type: CONST.MACRO_TYPES.SCRIPT,
|
||||||
img: 'icons/svg/book.svg',
|
img: data.img,
|
||||||
command: `await game.system.api.applications.ui.DhHotbar.useItem("${data.uuid}");`
|
command: `await game.system.api.applications.ui.DhHotbar.useItem("${data.uuid}");`
|
||||||
});
|
});
|
||||||
await game.user.assignHotbarMacro(macro, slot);
|
await game.user.assignHotbarMacro(macro, slot);
|
||||||
|
|
@ -111,7 +111,7 @@ export default class DhHotbar extends foundry.applications.ui.Hotbar {
|
||||||
const macro = await Macro.implementation.create({
|
const macro = await Macro.implementation.create({
|
||||||
name: `${game.i18n.localize('Display')} ${name}`,
|
name: `${game.i18n.localize('Display')} ${name}`,
|
||||||
type: CONST.MACRO_TYPES.SCRIPT,
|
type: CONST.MACRO_TYPES.SCRIPT,
|
||||||
img: 'icons/svg/book.svg',
|
img: data.data.img,
|
||||||
command: `await game.system.api.applications.ui.DhHotbar.useAction("${data.data.itemUuid}", "${data.data.id}");`
|
command: `await game.system.api.applications.ui.DhHotbar.useAction("${data.data.itemUuid}", "${data.data.id}");`
|
||||||
});
|
});
|
||||||
await game.user.assignHotbarMacro(macro, slot);
|
await game.user.assignHotbarMacro(macro, slot);
|
||||||
|
|
@ -121,7 +121,7 @@ export default class DhHotbar extends foundry.applications.ui.Hotbar {
|
||||||
const macro = await Macro.implementation.create({
|
const macro = await Macro.implementation.create({
|
||||||
name: `${game.i18n.localize('Display')} ${name}`,
|
name: `${game.i18n.localize('Display')} ${name}`,
|
||||||
type: CONST.MACRO_TYPES.SCRIPT,
|
type: CONST.MACRO_TYPES.SCRIPT,
|
||||||
img: 'icons/svg/book.svg',
|
img: data.img,
|
||||||
command: `await game.system.api.applications.ui.DhHotbar.useAttack("${data.actorUuid}");`
|
command: `await game.system.api.applications.ui.DhHotbar.useAttack("${data.actorUuid}");`
|
||||||
});
|
});
|
||||||
await game.user.assignHotbarMacro(macro, slot);
|
await game.user.assignHotbarMacro(macro, slot);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue