Nexus Clash: Bold Shadows

Helps to see hunting targets at a glance: if shadows can be seen from outside a building it makes that part of the description bold

当前为 2014-09-25 提交的版本,查看 最新版本

// ==UserScript==
// @name         Nexus Clash: Bold Shadows
// @namespace    http://nexusclash.com/wiki/index.php/user:xensyria
// @version      1.0
// @description  Helps to see hunting targets at a glance: if shadows can be seen from outside a building it makes that part of the description bold
// @match        http://nexusclash.com/modules.php?name=Game*
// @match        http://www.nexusclash.com/modules.php?name=Game*
// @exclude      http://nexusclash.com/modules.php?name=Game&op=disconnect
// @exclude      http://www.nexusclash.com/modules.php?name=Game&op=disconnect
// @copyright    PD
// ==/UserScript==

  // Check if any "shadow"s moving in "windows" are in the tile description
if (document.getElementById('Messages').parentNode.childNodes[18].textContent.match(/shadow[^\.]+windows\./)){
    // Get the tile description split up into parts
  var tileDesc = document.getElementById('Messages').parentNode.childNodes[18].textContent.match(/(.*)\.([^\.]+shadow[^\.]+windows\.)(.*)/);
    // Since this node can't include HTML directly, set it as the first part of the description, before the bold tags begin
  document.getElementById('Messages').parentNode.childNodes[18].textContent = tileDesc[1] + ". ";
    // Use the next element to insert the HTML bold tags and the rest of the description
  document.getElementById('Messages').parentNode.childNodes[18].nextSibling.insertAdjacentHTML('beforebegin', '<b>' + tileDesc[2] + '</b>' + tileDesc[3]);
}

QingJ © 2025

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