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.

55 lines
1.7 KiB

  1. Hooks.on("render" + "Sidebar", (app, html, data) => {
  2. if (isExcluded(app)) return;
  3. app.element[0].dataset.dorakoUiScope = "sidebar";
  4. });
  5. Hooks.on("render" + "SceneControls", (app, html, data) => {
  6. if (isExcluded(app)) return;
  7. app.element[0].dataset.dorakoUiScope = "controls";
  8. });
  9. Hooks.on("render" + "SceneNavigation", (app, html, data) => {
  10. if (isExcluded(app)) return;
  11. app.element[0].dataset.dorakoUiScope = "navigation";
  12. });
  13. Hooks.on("render" + "Hotbar", (app, html, data) => {
  14. if (isExcluded(app)) return;
  15. app.element[0].dataset.dorakoUiScope = "hotbar";
  16. });
  17. Hooks.on("render" + "EffectsPanel", (app, html, data) => {
  18. if (isExcluded(app)) return;
  19. app.element[0].dataset.dorakoUiScope = "effects";
  20. });
  21. for (const appName of ["PlayerList", "SmallTimeApp"]) {
  22. Hooks.on("render" + appName, (app, html, data) => {
  23. if (isExcluded(app)) return;
  24. app.element[0].dataset.dorakoUiScope = "players";
  25. });
  26. }
  27. for (const appName of ["TokenHUD", "TileHUD"]) {
  28. Hooks.on("render" + appName, (app, html, data) => {
  29. if (isExcluded(app)) return;
  30. app.element[0].dataset.dorakoUiScope = "placeable-hud";
  31. });
  32. }
  33. for (const appName of ["PlaylistDirectory"]) {
  34. Hooks.on("render" + appName, (app, html, data) => {
  35. if (isExcluded(app)) return;
  36. app.element[0].dataset.dorakoUiScope = "unlimited";
  37. });
  38. }
  39. function isExcluded(app) {
  40. const excludeString = game.settings.get("pf2e-dorako-ui", "customization.excluded-applications");
  41. const excludeList = excludeString.split(/[\s,]+/);
  42. if (excludeList.includes(app.constructor.name)) {
  43. console.debug(`${MODULE_NAME} | render${app.constructor.name} | is included in excluded applications string`);
  44. return true;
  45. }
  46. return false;
  47. }