Added "send to chat" header button on Actor sheets
This commit is contained in:
@@ -186,4 +186,16 @@ export class ActorL5r5e extends Actor {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the text template for this Actor (tooltips and chat)
|
||||
* @return {Promise<string|null>}
|
||||
*/
|
||||
async renderTextTemplate() {
|
||||
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}actors/actor-text.html`, this);
|
||||
if (!tpl) {
|
||||
return null;
|
||||
}
|
||||
return tpl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,24 @@ export class BaseSheetL5r5e extends ActorSheet {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the SendToChat button on top of sheet
|
||||
* @override
|
||||
*/
|
||||
_getHeaderButtons() {
|
||||
let buttons = super._getHeaderButtons();
|
||||
|
||||
// Send To Chat
|
||||
buttons.unshift({
|
||||
label: game.i18n.localize("l5r5e.global.send_to_chat"),
|
||||
class: "send-to-chat",
|
||||
icon: "fas fa-comment-dots",
|
||||
onclick: async () => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
|
||||
});
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
getData(options = {}) {
|
||||
const sheetData = super.getData(options);
|
||||
|
||||
Reference in New Issue
Block a user