Last active
August 29, 2015 14:13
-
-
Save jadeboy7/e94ced7b16a491651c82 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 Texture Swap | |
// @description Edit the links to add your own textures. | |
// @version 0.1 | |
// @grant none | |
// @require https://gist.githubusercontent.com/SomeBall-1/80320c9db3e1146c0a66/raw/824c0784e78565a727efe5f5277a36b16e4312d3/TagPro%20Texture%20Refresh.js | |
// @include http://tagpro-*.koalabeast.com:* | |
// @include http://tangent.jukejuice.com:* | |
// @include http://*.newcompte.fr:* | |
// @license 2014 | |
// ==/UserScript== | |
tagpro.ready(function() { | |
var textures = [ | |
'http://i.imgur.com/q06mz46.png', // tiles | |
'http://i.imgur.com/CIaoSad.png', // splats | |
'http://i.imgur.com/Q8YNNVp.png', // speedpad | |
'http://i.imgur.com/yFh636b.png', // speedpadred | |
'http://i.imgur.com/CpRwuTJ.png', // speedpadblue | |
'http://i.imgur.com/54FMu7C.png' // portal | |
], | |
assetLoader = new PIXI.AssetLoader(textures, 'Anonymous'); | |
assetLoader.load(); | |
assetLoader.onAssetLoaded(replaceTextures()); | |
function replaceTextures() { | |
$('#tiles')[0].src = textures[0]; | |
$('#splats')[0].src = textures[1]; | |
$('#speedpad')[0].src = textures[2]; | |
$('#speedpadred')[0].src = textures[3]; | |
$('#speedpadblue')[0].src = textures[4]; | |
$('#portal')[0].src = textures[5]; | |
refreshTextures(); | |
} | |
function refreshTextures() { | |
if (!tagpro.renderer.refresh) { | |
return setTimeout(refreshTextures, 100); | |
} | |
window.requestAnimationFrame(tagpro.renderer.refresh); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment