mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-07-04 13:47:10 -04:00
14: Tweak styles, tweak roll template
- Adjusted styles of item buttons. - Fixed an issue with item buttons when not using shorthand syntax. - Updated the `roll.toMessage()` call to include the player/actor name and the item/attribute name.
This commit is contained in:
parent
786d4095a9
commit
9ae2cce47a
4 changed files with 49 additions and 11 deletions
|
@ -25,6 +25,7 @@ export class SimpleActorSheet extends ActorSheet {
|
|||
for ( let attr of Object.values(data.data.attributes) ) {
|
||||
attr.isCheckbox = attr.dtype === "Boolean";
|
||||
}
|
||||
data.shorthand = !!game.settings.get("worldbuilding", "macroShorthand");
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -36,8 +37,15 @@ export class SimpleActorSheet extends ActorSheet {
|
|||
|
||||
// Handle rollable attributes.
|
||||
html.find('.items .rollable').click(ev => {
|
||||
let r = new Roll($(ev.currentTarget).data('roll'), this.actor.getRollData());
|
||||
r.roll().toMessage();
|
||||
let button = $(ev.currentTarget);
|
||||
let r = new Roll(button.data('roll'), this.actor.getRollData());
|
||||
const li = button.parents(".item");
|
||||
const item = this.actor.getOwnedItem(li.data("itemId"));
|
||||
r.roll().toMessage({
|
||||
user: game.user._id,
|
||||
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
|
||||
flavor: `<h2>${item.name}</h2><h3>${button.text()}</h3>`
|
||||
});
|
||||
});
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue