Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name My Texture Pack Loader
- // @namespace http://www.reddit.com/u/snaps_/
- // @description Used for texture pack loading.
- // @include http://tagpro-*.koalabeast.com:*
- // @include http://tangent.jukejuice.com:*
- // @include http://*.newcompte.fr:*
- // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
- // @author snaps
- // @version 0.1.0
- // @resource tiles http://i.imgur.com/YnJ9THs.png
- // @resource speedpad http://i.imgur.com/Lgiwb5Q.png
- // @resource speedpadRed http://i.imgur.com/XuN3NbB.png
- // @resource speedpadBlue http://i.imgur.com/5JKeYSQ.png
- // @resource portal http://i.imgur.com/xJe0hBy.png?1
- // @resource splats http://i.imgur.com/RZYNTYs.png
- // ==/UserScript==
- // Wait until the tagpro object exists, and add the function to tagpro.ready
- function waitForTagpro(fn) {
- // Make sure the tagpro object exists.
- if (typeof tagpro !== "undefined") {
- fn();
- } else {
- // If not ready, try again after a short delay.
- setTimeout(function() {
- waitForTagpro(fn);
- }, 0);
- }
- }
- var loadTexture = function() {
- var assetTypes = ["tiles", "speedpad", "speedpadRed", "speedpadBlue", "portal", "splats"];
- var assets = {};
- assetTypes.forEach(function(assetType) {
- assets[assetType] = GM_getResourceURL(assetType);
- });
- tagpro.loadAssets(assets);
- };
- waitForTagpro(loadTexture);
Add Comment
Please, Sign In to add comment