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.

120 lines
3.6 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. import { SettingsMenuDorakoUX } from "./menu.js";
  2. import { refreshChat } from "./settings.js";
  3. export class AvatarSettings extends SettingsMenuDorakoUX {
  4. static namespace = "avatar";
  5. static SETTINGS = [
  6. "source",
  7. "hide-when-token-hidden",
  8. "hide-gm-avatar-when-secret",
  9. "size",
  10. "popout-support",
  11. "reacts-to-degree-of-success",
  12. "small-creature-token-avatar-size",
  13. "use-user-avatar",
  14. ];
  15. static get settings() {
  16. return {
  17. source: {
  18. name: "pf2e-dorako-ux.settings.avatar-source.name",
  19. hint: "pf2e-dorako-ux.settings.avatar-source.hint",
  20. scope: "client",
  21. config: true,
  22. default: "token",
  23. type: String,
  24. choices: {
  25. token: "pf2e-dorako-ux.settings.avatar-source.choice.token",
  26. actor: "pf2e-dorako-ux.settings.avatar-source.choice.actor",
  27. none: "pf2e-dorako-ux.text.disabled",
  28. },
  29. requiresReload: false,
  30. onChange: refreshChat,
  31. },
  32. size: {
  33. name: "pf2e-dorako-ux.settings.avatar-size.name",
  34. hint: "pf2e-dorako-ux.settings.avatar-size.hint",
  35. scope: "client",
  36. type: Number,
  37. default: 40,
  38. range: {
  39. min: 10,
  40. max: 60,
  41. step: 1,
  42. },
  43. config: true,
  44. requiresReload: false,
  45. onChange: () => {
  46. const root = document.querySelector(":root").style;
  47. root.setProperty("--avatar-size", game.settings.get("pf2e-dorako-ux", "avatar.size").toString() + "px");
  48. },
  49. },
  50. "small-creature-token-avatar-size": {
  51. name: "pf2e-dorako-ux.settings.small-creature-token-avatar-size.name",
  52. hint: "pf2e-dorako-ux.settings.small-creature-token-avatar-size.hint",
  53. scope: "client",
  54. type: Number,
  55. default: 0.8,
  56. range: {
  57. min: 0.7,
  58. max: 1.0,
  59. step: 0.1,
  60. },
  61. config: true,
  62. requiresReload: false,
  63. onChange: refreshChat,
  64. },
  65. "popout-support": {
  66. name: "pf2e-dorako-ux.settings.popout-support.name",
  67. hint: "pf2e-dorako-ux.settings.popout-support.hint",
  68. scope: "world",
  69. type: Boolean,
  70. default: true,
  71. config: true,
  72. requiresReload: false,
  73. onChange: refreshChat,
  74. },
  75. "reacts-to-degree-of-success": {
  76. name: "pf2e-dorako-ux.settings.avatar-reacts-to-degree-of-success.name",
  77. hint: "pf2e-dorako-ux.settings.avatar-reacts-to-degree-of-success.hint",
  78. scope: "client",
  79. type: Boolean,
  80. default: true,
  81. config: true,
  82. requiresReload: false,
  83. onChange: refreshChat,
  84. },
  85. "hide-when-token-hidden": {
  86. name: "pf2e-dorako-ux.settings.hide-avatar-when-token-hidden.name",
  87. hint: "pf2e-dorako-ux.settings.hide-avatar-when-token-hidden.hint",
  88. scope: "world",
  89. type: Boolean,
  90. default: true,
  91. config: true,
  92. requiresReload: false,
  93. onChange: refreshChat,
  94. },
  95. "hide-gm-avatar-when-secret": {
  96. name: "pf2e-dorako-ux.settings.hide-gm-avatar-when-secret.name",
  97. hint: "pf2e-dorako-ux.settings.hide-gm-avatar-when-secret.hint",
  98. scope: "world",
  99. config: true,
  100. default: true,
  101. type: Boolean,
  102. requiresReload: false,
  103. onChange: refreshChat,
  104. },
  105. "use-user-avatar": {
  106. name: "pf2e-dorako-ux.settings.use-user-avatar.name",
  107. hint: "pf2e-dorako-ux.settings.use-user-avatar.hint",
  108. scope: "world",
  109. type: Boolean,
  110. default: false,
  111. config: true,
  112. requiresReload: false,
  113. onChange: refreshChat,
  114. },
  115. };
  116. }
  117. }