Splits the Chatlog into tabs that can be customized.
You can set the message types that will show up on each tab, and you can set messages to be exclusive to the tabs they're being posted.
Your module should hook on the chat-tabs.init
hook and call on the game.chatTabs.register()
function.
Example:
Hooks.on("chat-tabs.init", () => {
const data = {
key: "custom-module",
label: "Custom Module Messages", // Optional, if key is the module's id, its title will be used. Otherwise, defaults to the key value.
hint: "Custom Module's messages which are sent when something happens.", // Optional
};
game.chatTabs.register(data);
});
Any messages created by your module should include a "chat-tabs" flag with a "module" property that matches the registered key. These will show up on the tabs the users have set to be shown.
await ChatMessage.create({
content: "Hello world",
flags: {
"chat-tabs": {
module: "custom-module",
},
},
});
This is a fork of Tabbed Chatlog.