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.

77 lines
2.4 KiB

1 year ago
  1. import { i18n, setting } from "./hotbar-expansion.js";
  2. export const registerSettings = function () {
  3. let modulename = "monks-hotbar-expansion";
  4. const debouncedReload = foundry.utils.debounce(function () { window.location.reload(); }, 100);
  5. const updateClass = () => {
  6. $('#hotbar .hotbar-page')
  7. .toggleClass('reverse', setting('reverse-row-order'))
  8. .toggleClass('hidefirst', setting('hide-first-row'));
  9. }
  10. game.settings.register(modulename, "number-rows", {
  11. name: i18n("MonksHotbarExpansion.number-rows.name"),
  12. hint: i18n("MonksHotbarExpansion.number-rows.hint"),
  13. scope: "client",
  14. config: true,
  15. default: 5,
  16. type: Number,
  17. range: {
  18. min: 2,
  19. max: 5,
  20. step: 1
  21. },
  22. onChange: debouncedReload
  23. });
  24. game.settings.register(modulename, "reverse-row-order", {
  25. name: i18n("MonksHotbarExpansion.reverse-row-order.name"),
  26. hint: i18n("MonksHotbarExpansion.reverse-row-order.hint"),
  27. scope: "client",
  28. config: true,
  29. default: false,
  30. type: Boolean,
  31. onChange: updateClass
  32. });
  33. game.settings.register(modulename, "hide-first-row", {
  34. name: i18n("MonksHotbarExpansion.hide-first-row.name"),
  35. hint: i18n("MonksHotbarExpansion.hide-first-row.hint"),
  36. scope: "client",
  37. config: true,
  38. default: false,
  39. type: Boolean,
  40. onChange: updateClass
  41. });
  42. game.settings.register(modulename, "collapse-on-open", {
  43. name: i18n("MonksHotbarExpansion.collapse-on-open.name"),
  44. hint: i18n("MonksHotbarExpansion.collapse-on-open.hint"),
  45. scope: "client",
  46. config: true,
  47. default: true,
  48. type: Boolean
  49. });
  50. game.settings.register(modulename, "collapse-on-select", {
  51. name: i18n("MonksHotbarExpansion.collapse-on-select.name"),
  52. hint: i18n("MonksHotbarExpansion.collapse-on-select.hint"),
  53. scope: "client",
  54. config: true,
  55. default: true,
  56. type: Boolean
  57. });
  58. game.settings.register(modulename, "hide-page-arrows", {
  59. name: i18n("MonksHotbarExpansion.hide-page-arrows.name"),
  60. hint: i18n("MonksHotbarExpansion.hide-page-arrows.hint"),
  61. scope: "client",
  62. config: true,
  63. default: false,
  64. type: Boolean,
  65. onChange: debouncedReload
  66. });
  67. };