VCR+

For planets.nu - Cleans up VCR name display

当前为 2018-04-07 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        VCR+
// @author      Psydev
// @copyright   Psydev, 2018
// @license     Lesser Gnu Public License, version 3
// @description For planets.nu - Cleans up VCR name display
// @namespace   psydev/planets.nu
// @include     http://planets.nu/*
// @include     http://play.planets.nu/*
// @include     http://test.planets.nu/*
// @version     0.1
// @grant       none
// ==/UserScript==

vcrSim.prototype.startVCR = function() {

        vgap.playSound("vcr");

        this.container.show();

        var vcr = this.vcr;

        //determine setup
        this.vsPlanet = (vcr.battletype == 1);
        this.hasStarbase = vcr.right.hasstarbase;
        this.battleType = vcr.battletype;
        this.seed = vcr.seed;

        //load left and right images
        this.leftImg.attr("src", hullImg(vcr.left.hullid, vcr.left.beamcount));
        if (!this.vsPlanet)
            this.rightImg.attr("src", hullLeftImg(vcr.right.hullid, vcr.right.beamcount));
        else
            this.rightImg.attr("src", vgap.planetPic(vcr.right.temperature));

        this.leftImg.show();
        this.rightImg.show();

        //show base image if needed
        if (this.vsPlanet && this.hasStarbase)
            this.baseImg.show();
        else
            this.baseImg.hide();

        //Get Top Display Text left vs right (battletitle)
        var lHull = vgap.getHull(vcr.left.hullid);
        var lRace = vgap.getRace(vcr.left.raceid);
        var rRace = vgap.getRace(vcr.right.raceid);
        var rHull = vgap.getHull(vcr.right.hullid);

        var title = "";

/////////////////////////////////////////////////////////////////////
// Empire Qtanker (psydev) #92 Vs Rebel Rush Carrier (jact704) - Badmama-4 #224

		title += "<div>"; // style='background-color:#00AA00'

//names, left and right.
		title += "<div style='float:left'; 'width:10%'; 'padding:20px';>";
		title += lRace.adjective + "<br>" + vgap.players[vcr.leftownerid - 1].username;
		title += "</div>";
		title += "<div style='float:right'; 'width:10%'>";
		title += rRace.adjective + "<br>" + vgap.players[vcr.rightownerid - 1].username;
		title += "</div>";

//ships
	// left ship
		if (lHull.name != vcr.left.name)
			title += lHull.name + " #" + vcr.left.objectid + " &quot;" + vcr.left.name + "&quot;";
		else {
			title += lHull.name + " #" + vcr.left.objectid; 
		}
	// vs
		title += "&nbsp; &nbsp; vs &nbsp; &nbsp;";
	// right ship
		if (this.vsPlanet)
			title += vcr.right.name;
		else {
			if (rHull.name != vcr.right.name)
				title += "&quot;" + vcr.right.name + "&quot; " + "#" + vcr.right.objectid + " " + rHull.name;
		}
	// combat masses
		title += "<br>" + vcr.left.mass + " kt vs " + vcr.right.mass + " kt<br>";

        if (vcr.leftownerid != vgap.player.id && vcr.rightownerid != vgap.player.id)
            title += "<span class='GreatText'>ALLY VCR</span>";

		title += "</div>";

/////////////////////////////////////////////////////////////////////
		this.battleTitle.html(title);

		//set up the combat objects
        this.left = new combatObject();
        this.right = new combatObject();
        this.left.setObject(vcr.left);
        this.right.setObject(vcr.right);

        this.runVisual();
	};

console.log("VCR+ plugin has loaded");