All user data for FoundryVTT. Includes worlds, systems, modules, and any asset in the "foundryuserdata" directory. Does NOT include the FoundryVTT installation itself.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

1 year ago
  1. import Autocomplete from "./Autocomplete.mjs";
  2. import ChatCommands from "./ChatCommands.mjs";
  3. Hooks.once('ready', function() {
  4. let chatCommands = new ChatCommands();
  5. window.game.chatCommands = chatCommands;
  6. Hooks.on("chatMessage", (chatlog, messageText, chatData) => {
  7. return chatCommands.handleChatMessage(chatlog, messageText, chatData);
  8. });
  9. game.settings.register("_chatcommands", "autocomplete", {
  10. name: "Should commands be autocompleted?",
  11. scope: 'client',
  12. config: true,
  13. type: Boolean,
  14. default: true
  15. });
  16. game.settings.register("_chatcommands", "includeCoreCommands", {
  17. name: "Should core commands be included in autocomplete?",
  18. scope: 'client',
  19. config: true,
  20. type: Boolean,
  21. default: true
  22. });
  23. Hooks.callAll("chatCommandsReady", chatCommands);
  24. });
  25. Hooks.on('renderSidebarTab', (app, html, data) => {
  26. if (app.tabName !== "chat") {
  27. return;
  28. }
  29. let autocomplete = new Autocomplete();
  30. autocomplete.handleRenderSidebarTab(app, html, data);
  31. });