Created
July 7, 2015 03:48
-
-
Save KableM/c28b10e11f7d97789222 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name TagPro Fix Gate Splats | |
// @version 1.0.0 | |
// @description Show splats on gates | |
// @include http://tagpro-*.koalabeast.com:* | |
// @include http://tangent.jukejuice.com:* | |
// @include http://*.newcompte.fr:* | |
// @author Browncoat | |
// ==/UserScript== | |
tagpro.ready(function () { | |
var tr = tagpro.renderer; | |
if (!tr.layers.midground) { | |
var createMidground = tr.createMidground; | |
tr.createMidground = new function (container) { | |
createMidground(container); | |
moveSplatsLayer(); | |
}; | |
} else { | |
moveSplatsLayer(); | |
} | |
// need to hook into here to make sure the Texture Refresh script doesn't undo the move | |
var drawStartingSplats = tr.drawStartingSplats; | |
tr.drawStartingSplats = function() { | |
drawStartingSplats(); | |
moveSplatsLayer(); | |
}; | |
function moveSplatsLayer() { | |
if (tr.layers.midground.children.indexOf(tr.layers.splats) >= 0) { | |
tr.layers.midground.removeChild(tr.layers.splats); | |
tr.gameContainer.addChildAt(tr.layers.splats, tr.gameContainer.getChildIndex(tr.layers.midground) + 1); | |
console.log("Moved the splats layer"); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment