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.

130 lines
4.1 KiB

  1. import { SettingsMenuDorakoUX } from "./menu.js";
  2. export class HidingSettings extends SettingsMenuDorakoUX {
  3. static namespace = "hiding";
  4. static SETTINGS = [
  5. "no-cards",
  6. "no-chat-control-icon",
  7. "no-logo",
  8. "remove-attack-info-from-damage-roll-messages",
  9. "start-sidebar-collapsed",
  10. "start-navigation-collapsed",
  11. "no-compendium-banner-images",
  12. ];
  13. rerenderChatMessages() {}
  14. static get settings() {
  15. return {
  16. "restructure-card-info": {
  17. name: "pf2e-dorako-ux.settings.restructure-card-info.name",
  18. hint: "pf2e-dorako-ux.settings.restructure-card-info.hint",
  19. scope: "world",
  20. type: Boolean,
  21. default: true,
  22. config: true,
  23. requiresReload: false,
  24. onChange: () => {
  25. const messages = game.messages.filter((m) => m instanceof ChatMessage);
  26. for (const message of messages) {
  27. ui.chat.updateMessage(message);
  28. }
  29. },
  30. },
  31. "remove-attack-info-from-damage-roll-messages": {
  32. name: "pf2e-dorako-ux.settings.remove-attack-info-from-damage-roll-messages.name",
  33. hint: "pf2e-dorako-ux.settings.remove-attack-info-from-damage-roll-messages.hint",
  34. scope: "world",
  35. type: Boolean,
  36. default: true,
  37. config: true,
  38. requiresReload: false,
  39. onChange: () => {
  40. const messages = game.messages.filter((m) => m instanceof ChatMessage);
  41. for (const message of messages) {
  42. ui.chat.updateMessage(message);
  43. }
  44. },
  45. },
  46. "start-sidebar-collapsed": {
  47. name: "pf2e-dorako-ux.settings.start-sidebar-collapsed.name",
  48. hint: "pf2e-dorako-ux.settings.start-sidebar-collapsed.hint",
  49. scope: "client",
  50. config: true,
  51. default: false,
  52. type: Boolean,
  53. requiresReload: false,
  54. },
  55. "start-navigation-collapsed": {
  56. name: "pf2e-dorako-ux.settings.start-navigation-collapsed.name",
  57. hint: "pf2e-dorako-ux.settings.start-navigation-collapsed.hint",
  58. scope: "client",
  59. config: true,
  60. default: false,
  61. type: Boolean,
  62. requiresReload: false,
  63. },
  64. "no-compendium-banner-images": {
  65. name: "pf2e-dorako-ux.settings.no-compendium-banner-images.name",
  66. hint: "pf2e-dorako-ux.settings.no-compendium-banner-images.hint",
  67. scope: "client",
  68. config: true,
  69. default: false,
  70. type: Boolean,
  71. requiresReload: false,
  72. onChange: (value) => {
  73. $("#sidebar").toggleClass("no-compendium-banner-images");
  74. },
  75. },
  76. "no-logo": {
  77. name: "pf2e-dorako-ux.settings.no-logo.name",
  78. hint: "pf2e-dorako-ux.settings.no-logo.hint",
  79. scope: "client",
  80. config: true,
  81. default: true,
  82. type: Boolean,
  83. requiresReload: false,
  84. onChange: (value) => {
  85. if (value) {
  86. $("#logo")[0].style.setProperty("display", "none", "important");
  87. } else {
  88. $("#logo")[0].style.setProperty("display", "unset");
  89. }
  90. },
  91. },
  92. "no-chat-control-icon": {
  93. name: "pf2e-dorako-ux.settings.no-chat-control-icon.name",
  94. hint: "pf2e-dorako-ux.settings.no-chat-control-icon.hint",
  95. scope: "client",
  96. config: true,
  97. default: true,
  98. type: Boolean,
  99. requiresReload: false,
  100. onChange: (value) => {
  101. if (value) {
  102. $("#chat-controls")[0].classList.add("no-chat-control-icon");
  103. } else {
  104. $("#chat-controls")[0].classList.remove("no-chat-control-icon");
  105. }
  106. },
  107. },
  108. "no-cards": {
  109. name: "pf2e-dorako-ux.settings.no-cards.name",
  110. hint: "pf2e-dorako-ux.settings.no-cards.hint",
  111. scope: "client",
  112. config: true,
  113. default: false,
  114. type: Boolean,
  115. requiresReload: false,
  116. onChange: (value) => {
  117. if (value) {
  118. $(".item[data-tab=cards]").addClass("dorako-display-none");
  119. } else {
  120. $(".item[data-tab=cards]").removeClass("dorako-display-none");
  121. }
  122. },
  123. },
  124. };
  125. }
  126. }