Amélioration du split

Bouton split géré avec itemActions

Ajout d'un bouton pour augmenter les piles (pour le MJ)
This commit is contained in:
2025-01-19 17:56:55 +01:00
parent 8969d5e0ed
commit 6083dd41fa
8 changed files with 39 additions and 38 deletions

View File

@ -200,23 +200,19 @@ export class RdDItemSheet extends ItemSheet {
this.html.find('.chat-roll-text').click(async event => await RdDTextEditor.chatRollText(event))
if (this.actor) {
// TODO
this.html.find('.actionItem').click(event => ItemAction.onActionItem(event, this.actor, this.options))
// TODO: utiliser un itemAction?
this.html.find('.item-potion-consommer').click(event => this.itemActionConsommer(event))
this.html.find('.item-split').click( event => this.itemActionSplit(event))
this.html.find('.item-edit').click(async event => RdDSheetUtility.getItem(event, this.actor)?.sheet.render(true));
this.html.find('.item-delete').click(async event => this.itemActionDelete(event));
this.html.find('.item-quantite-plus').click(async event => {
await this.actor.itemQuantiteIncDec(RdDSheetUtility.getItemId(event), 1)
this.render();
});
this.render()
})
this.html.find('.item-quantite-moins').click(async event => {
await this.actor.itemQuantiteIncDec(RdDSheetUtility.getItemId(event), -1)
this.render();
});
this.render()
})
}
const updateItemTimestamp = (path, timestamp) => this.item.update({ [path]: foundry.utils.duplicate(timestamp) })