well you can assign it to a variable and return it
well you can assign it to a variable and return it
Hooks.on("renderPlayerList", onRenderPlayerList);const onRenderPlayerList = (_playerList, html) => {console.warn as the hook function.called.$(".my-button").on("click", () => doSomething())flattenTilePrompt() when clicked). Hooks.on("renderPlayerList", onRenderPlayerList);const onRenderPlayerList = (_playerList, html) => {console.warncall$(".my-button").on("click", () => doSomething())flattenTilePrompt() static call(hook, ...args) {
if ( CONFIG.debug.hooks ) {
console.log(`DEBUG | Calling ${hook} hook with args:`);
console.log(args);
}
if ( !this._hooks.hasOwnProperty(hook) ) return;
const fns = new Array(...this._hooks[hook]);
for ( let fn of fns ) {
let callAdditional = this._call(hook, fn, args);
if ( callAdditional === false ) return false;
}
return true;
}Hooks.on("getSceneControlButtons", addFlattenerButton); //add the button for this to the menu
function addFlattenerButton(buttons) {
let tilesButton = buttons.find(b => b.name == "tiles")
if (tilesButton) {
tilesButton.tools.push({
name: "request-roll",
title: game.i18n.localize('TILE-FLATTENER.Button'),
icon: "fas fa-layer-group",
visible: game.user.isGM,
onClick: () => flattenTilePrompt(),
button: true
});
}
};