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.

163 lines
5.9 KiB

  1. import { SettingsMenuDorakoUI } from "./menu.js";
  2. import { refreshChat } from "./settings.js";
  3. export class ThemeSettings extends SettingsMenuDorakoUI {
  4. static namespace = "theme";
  5. static SETTINGS = [
  6. "app-theme",
  7. "window-app-theme",
  8. "sheet-theme-color",
  9. "chat-message-standard-theme",
  10. "chat-message-opposition-theme",
  11. "chat-message-header-style",
  12. "border-radius",
  13. ];
  14. static get settings() {
  15. return {
  16. "app-theme": {
  17. name: "pf2e-dorako-ui.settings.theme.app-theme.name",
  18. hint: "pf2e-dorako-ui.settings.theme.app-theme.hint",
  19. scope: "client",
  20. config: true,
  21. default: "crb",
  22. type: String,
  23. choices: {
  24. "no-theme": "pf2e-dorako-ui.text.no-theme",
  25. crb: "pf2e-dorako-ui.text.glass",
  26. foundry2: "pf2e-dorako-ui.text.foundry2",
  27. bg3: "pf2e-dorako-ui.text.bg3",
  28. discord: "pf2e-dorako-ui.text.discord",
  29. opaque: "pf2e-dorako-ui.text.opaque",
  30. custom: "pf2e-dorako-ui.text.custom",
  31. },
  32. requiresReload: true, // re-render all windows
  33. onChange: (choice) => {},
  34. },
  35. "window-app-theme": {
  36. name: "pf2e-dorako-ui.settings.theme.window-app-theme.name",
  37. hint: "pf2e-dorako-ui.settings.theme.window-app-theme.hint",
  38. scope: "client",
  39. config: true,
  40. default: "crb-light",
  41. type: String,
  42. choices: {
  43. "no-theme": "pf2e-dorako-ui.text.no-theme",
  44. "crb-light": "pf2e-dorako-ui.text.crb-light",
  45. "crb-dark": "pf2e-dorako-ui.text.crb-dark",
  46. foundry2: "pf2e-dorako-ui.text.foundry2",
  47. bg3: "pf2e-dorako-ui.text.bg3",
  48. "discord-light": `pf2e-dorako-ui.text.discord-light`,
  49. "discord-dark": "pf2e-dorako-ui.text.discord-dark",
  50. "custom-light": "pf2e-dorako-ui.text.custom-light",
  51. "custom-dark": "pf2e-dorako-ui.text.custom-dark",
  52. },
  53. requiresReload: true, // re-render all windows
  54. onChange: (choice) => {},
  55. },
  56. "sheet-theme-color": {
  57. name: "pf2e-dorako-ui.settings.theme.sheet-theme-color.name",
  58. hint: "pf2e-dorako-ui.settings.theme.sheet-theme-color.hint",
  59. scope: "client",
  60. config: true,
  61. default: "default",
  62. type: String,
  63. choices: {
  64. default: "pf2e-dorako-ui.text.default",
  65. red: "pf2e-dorako-ui.text.colors.red",
  66. green: "pf2e-dorako-ui.text.colors.green",
  67. blue: "pf2e-dorako-ui.text.colors.blue",
  68. purple: "pf2e-dorako-ui.text.colors.purple",
  69. black: "pf2e-dorako-ui.text.colors.black",
  70. },
  71. requiresReload: false,
  72. onChange: () => {
  73. const apps = Object.values(ui.windows).filter((w) => w instanceof Application);
  74. for (const app of apps) {
  75. app.render();
  76. }
  77. },
  78. },
  79. "chat-message-standard-theme": {
  80. name: "pf2e-dorako-ui.settings.theme.chat-message-standard-theme.name",
  81. hint: "pf2e-dorako-ui.settings.theme.chat-message-standard-theme.hint",
  82. scope: "client",
  83. config: true,
  84. default: "crb-light",
  85. type: String,
  86. choices: {
  87. "no-theme": "pf2e-dorako-ui.text.no-theme",
  88. "crb-light": "pf2e-dorako-ui.text.crb-light",
  89. "crb-dark": "pf2e-dorako-ui.text.crb-dark",
  90. foundry2: "pf2e-dorako-ui.text.foundry2",
  91. "bg3-brown": "pf2e-dorako-ui.text.bg3-brown",
  92. "bg3-blue": "pf2e-dorako-ui.text.bg3-blue",
  93. "discord-light": `pf2e-dorako-ui.text.discord-light`,
  94. "discord-dark": "pf2e-dorako-ui.text.discord-dark",
  95. "custom-light": "pf2e-dorako-ui.text.custom-light",
  96. "custom-dark": "pf2e-dorako-ui.text.custom-dark",
  97. },
  98. requiresReload: true, // re-render all windows
  99. onChange: (choice) => {},
  100. },
  101. "chat-message-opposition-theme": {
  102. name: "pf2e-dorako-ui.settings.theme.chat-message-opposition-theme.name",
  103. hint: "pf2e-dorako-ui.settings.theme.chat-message-opposition-theme.hint",
  104. scope: "client",
  105. config: true,
  106. default: "bg3-brown",
  107. type: String,
  108. choices: {
  109. "no-theme": "pf2e-dorako-ui.text.no-theme",
  110. "crb-light": "pf2e-dorako-ui.text.crb-light",
  111. "crb-dark": "pf2e-dorako-ui.text.crb-dark",
  112. foundry2: "pf2e-dorako-ui.text.foundry2",
  113. "bg3-brown": "pf2e-dorako-ui.text.bg3-brown",
  114. "bg3-blue": "pf2e-dorako-ui.text.bg3-blue",
  115. "discord-light": `pf2e-dorako-ui.text.discord-light`,
  116. "discord-dark": "pf2e-dorako-ui.text.discord-dark",
  117. "custom-light": "pf2e-dorako-ui.text.custom-light",
  118. "custom-dark": "pf2e-dorako-ui.text.custom-dark",
  119. },
  120. requiresReload: true, // re-render all windows
  121. onChange: (choice) => {},
  122. },
  123. "chat-message-header-style": {
  124. name: "pf2e-dorako-ui.settings.theme.chat-message-header-style.name",
  125. hint: "pf2e-dorako-ui.settings.theme.chat-message-header-style.hint",
  126. scope: "client",
  127. config: true,
  128. default: "none",
  129. type: String,
  130. choices: {
  131. tint: "pf2e-dorako-ui.text.colors.player",
  132. red: "pf2e-dorako-ui.text.colors.red",
  133. green: "pf2e-dorako-ui.text.colors.green",
  134. blue: "pf2e-dorako-ui.text.colors.blue",
  135. none: "pf2e-dorako-ui.text.disabled",
  136. },
  137. requiresReload: false,
  138. onChange: refreshChat,
  139. },
  140. "border-radius": {
  141. name: "pf2e-dorako-ui.settings.theme.border-radius.name",
  142. hint: "pf2e-dorako-ui.settings.theme.border-radius.hint",
  143. scope: "client",
  144. type: Number,
  145. default: 3,
  146. range: {
  147. min: 0,
  148. max: 48,
  149. step: 1,
  150. },
  151. config: true,
  152. requiresReload: false,
  153. onChange: (value) => {
  154. const root = document.querySelector(":root").style;
  155. root.setProperty("--border-radius", `${value}px`);
  156. },
  157. },
  158. };
  159. }
  160. }