Skip to content

Instantly share code, notes, and snippets.

@KableM
Created July 7, 2015 03:48
Show Gist options
  • Save KableM/c28b10e11f7d97789222 to your computer and use it in GitHub Desktop.
Save KableM/c28b10e11f7d97789222 to your computer and use it in GitHub Desktop.
// ==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