Planets.nu Explosion Ship Name (original client only)

Planets.nu Explosion Ship Name

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           Planets.nu Explosion Ship Name (original client only)
// @description    Planets.nu Explosion Ship Name
// @include        http://planets.nu/home
// @include        http://planets.nu/games/*
// @include        http://play.planets.nu/*
// @include 	   http://*.planets.nu/*
// @version        0.4
// @namespace https://greasyfork.org/users/2860
// ==/UserScript==
// 0.2 First working version
// 0.3 Updated code to play nicely with other mods.
// 0.4 Updated to work with new URLs

function wrapper () { // wrapper for injection
  


oldDrawExplosions = vgapMap.prototype.drawExplosions;


vgapMap.prototype.drawExplosions = function () {

oldDrawExplosions.apply(this, arguments);  
 for (var i = 0; i < vgap.messages.length; i++) {
            var message = vgap.messages[i];
            if (message.messagetype == 10) {
 		var attr = { stroke: "#ff00ff", "stroke-width": "2", "stroke-opacity": 0.5 };
                var x = message.x;
                var y = message.y;
              	this.drawText(x+20,y+14, message.body.substr(message.body.indexOf("the name of the ship was:")+"the name of the ship was:".length));

            }
        }
};


} //wrapper for injection

var script = document.createElement("script");
script.type = "application/javascript";
script.textContent = "(" + wrapper + ")();";

document.body.appendChild(script);