Daggerfall Unity - NexusMods Know Issues

Shows a warning for Mods in the Know-IssuesList for Daggerfall mods on NexusMods.

  1. // ==UserScript==
  2. // @name Daggerfall Unity - NexusMods Know Issues
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.5
  5. // @description Shows a warning for Mods in the Know-IssuesList for Daggerfall mods on NexusMods.
  6. // @author Excoriated
  7. // @match https://www.nexusmods.com/daggerfallunity/mods/*
  8. // @grant GM_xmlhttpRequest
  9. // @connect docs.google.com
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const sheetURL = "https://docs.google.com/spreadsheets/d/1q35AGp4v7ARCliygZdG8kJUYsfE339teE5I4PANqq3g/gviz/tq?tqx=out:json&gid=657665941";
  17.  
  18. function getModName() {
  19. const el = document.querySelector("#pagetitle h1");
  20. return el ? el.textContent.trim() : null;
  21. }
  22.  
  23. function showWarning(modName, reason, details) {
  24. const warningBox = document.createElement("div");
  25. warningBox.style.background = "red";
  26. warningBox.style.color = "white";
  27. warningBox.style.padding = "10px";
  28. warningBox.style.margin = "10px 0";
  29. warningBox.style.fontSize = "16px";
  30. warningBox.style.fontWeight = "bold";
  31. warningBox.style.borderRadius = "5px";
  32. warningBox.innerHTML = `<div style='text-align:center;font-size:2rem'>⚠ This Mod (${modName}) is in the know issues list.</div>`;
  33. warningBox.innerHTML += `<br /> Severity: ${reason}`;
  34. warningBox.innerHTML += `<br /> Details: ${details}<br />`;
  35. warningBox.innerHTML += ` <a href="https://docs.google.com/spreadsheets/d/1q35AGp4v7ARCliygZdG8kJUYsfE339teE5I4PANqq3g/edit#gid=657665941" target="_blank" style="color: yellow; text-decoration: underline;">Go to mod list</a>`;
  36.  
  37. const container = document.querySelector(".container.tab-description");
  38. if (container) {
  39. container.prepend(warningBox);
  40. }
  41. }
  42.  
  43. GM_xmlhttpRequest({
  44. method: "GET",
  45. url: sheetURL,
  46. onload: function(response) {
  47. try {
  48. const json = JSON.parse(response.responseText.substr(47).slice(0, -2));
  49. const rows = json.table.rows;
  50.  
  51. const modName = getModName();
  52. if (!modName) return;
  53.  
  54. const modNameNormalized = modName.trim().toLowerCase();
  55.  
  56. for (let row of rows) {
  57. const nameCell = row.c[1];
  58. const reasonCell = row.c[2];
  59. const detailsCell = row.c[3];
  60.  
  61. if (!nameCell || nameCell.v === "Mod") continue;
  62.  
  63. let modNameList = [];
  64.  
  65. if(nameCell.v.indexOf('&') > 0) {
  66. modNameList = nameCell.v.split('&');
  67. }
  68. else {
  69. modNameList.push(nameCell.v);
  70. }
  71.  
  72. for (let listMod of modNameList) {
  73.  
  74. const sheetNameNormalized = listMod.trim().toLowerCase();
  75. const reason = reasonCell ? reasonCell.v : null;
  76. const details = detailsCell ? detailsCell.v : null;
  77.  
  78. if (modNameNormalized === sheetNameNormalized) {
  79. showWarning(modName, reason, details);
  80. break;
  81. }
  82. }
  83. }
  84. } catch (e) {
  85. console.error("Error while parsing Google Sheet data:", e);
  86. }
  87. }
  88. });
  89. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址