Guest User

Untitled

a guest
Jan 19th, 2016
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 79.54 KB | None | 0 0
  1. // ==UserScript==
  2. // @name TagPro Texture Pack Manager
  3. // @description Drag and drop textures (tiles, boosts, splats, etc) & background wallpapers
  4. // - Double-click the main TagPro logo to open the menu!
  5. // - Drag and drop your custom textures (or URL's) from anywhere (web or local).
  6. // - Mix & match from pre-made texture packs (including balls!).
  7. // - Optional: Ball Spin, Ball Transparency, Ball Overlays & Centre Flair.
  8. // - Optional: Different In-Game Wallpaper
  9. // - Optional: Different Ball Textures
  10. // - Optional: Fading Splats
  11. // @include http://tagpro-*.koalabeast.com*
  12. // @include http://tangent.jukejuice.com*
  13. // @include http://*.newcompte.fr*
  14. // @updateURL https://gist.github.com/nabbynz/474bfbfb841d9a328418/raw/TagPro_Texture_Pack_Manager.user.js
  15. // @downloadURL https://gist.github.com/nabbynz/474bfbfb841d9a328418/raw/TagPro_Texture_Pack_Manager.user.js
  16. // @author Dr.Holmes & ballparts & nabby
  17. // @version 1.7.2
  18. // @grant GM_getValue
  19. // @grant GM_setValue
  20. // @grant GM_deleteValue
  21. // @grant GM_addStyle
  22. // @run-at document-end
  23. // ==/UserScript==
  24.  
  25. console.log('START: ' + GM_info.script.name + ' (v' + GM_info.script.version + ' by ' + GM_info.script.author + ')');
  26.  
  27. var TPTPR_Overlays = {};
  28. var TPTPR_Packs = {};
  29. setObjects();
  30.  
  31. var getTexture = function() {
  32. var textureDefault = {
  33. "balls": "/images/tiles.png",
  34. "tiles": "/images/tiles.png",
  35. "speedpad": "/images/speedpad.png",
  36. "speedpadred": "/images/speedpadred.png",
  37. "speedpadblue": "/images/speedpadblue.png",
  38. "portal": "/images/portal.png",
  39. "splats": "/images/splats.png",
  40. "wallpaper": "/images/background.jpg",
  41. "wallpaperingame": "/images/background.jpg"
  42. };
  43. return $.extend(true, {}, textureDefault, GM_getValue('texturePack', textureDefault));
  44. };
  45. var Texture_Pack = getTexture();
  46.  
  47. //Set the game tiles/textures...
  48. if (tagpro.loadAssets) {
  49. tagpro.loadAssets({
  50. "tiles": Texture_Pack.tiles || '/images/tiles.png',
  51. "speedpad": Texture_Pack.speedpad || '/images/speedpad.png',
  52. "speedpadRed": Texture_Pack.speedpadred || '/images/speedpadred.png',
  53. "speedpadBlue": Texture_Pack.speedpadblue || '/images/speedpadblue.png',
  54. "portal": Texture_Pack.portal || '/images/portal.png',
  55. "splats": Texture_Pack.splats || '/images/splats.png'
  56. });
  57. }
  58.  
  59.  
  60. tagpro.ready(function() {
  61. if (window.location.port) { //we're in a game...
  62. var tr = tagpro.renderer;
  63. var spinBall = !!(GM_getValue('TPTPR_Spin', false));
  64. var spinOverlay = !!(GM_getValue('TPTPR_ShowBallOverlaysMenu', false) && GM_getValue('TPTPR_SpinOverlay', false) && GM_getValue('TPTPR_Overlay', false));
  65. var differentBalls = !!(GM_getValue('TPTPR_DifferentBallTexture', false) && Texture_Pack.balls);
  66.  
  67. //Set the wallpaper...
  68. var wallpaperType = 'wallpaper';
  69. if (GM_getValue('TPTPR_UseInGameWallpaper', false)) wallpaperType = 'wallpaperingame';
  70. if (Texture_Pack[wallpaperType].indexOf('#') === 0) { //just a color
  71. $('html').css('background', Texture_Pack[wallpaperType]);
  72. } else {
  73. $('html').css('background', '#000 url("'+Texture_Pack[wallpaperType]+'") no-repeat fixed center').css('background-size', (GM_getValue('TPTPR_StretchWallpaper', true) ? 'cover' : 'contain'));
  74. }
  75.  
  76. //Game Background Transparency...
  77. if (GM_getValue('TPTPR_TransparentBackground', false)) {
  78. var oldCanvas = $(tr.canvas);
  79. var newCanvas = $('<canvas id="viewport" width="1280" height="800"></canvas>');
  80. oldCanvas.after(newCanvas);
  81. oldCanvas.remove();
  82. tr.canvas = newCanvas.get(0);
  83. tr.options.transparent = true;
  84. tr.renderer = tr.createRenderer();
  85. tr.resizeAndCenterView();
  86. newCanvas.show();
  87. }
  88.  
  89. //Faded Splats...
  90. if (GM_getValue('TPTPR_FadingSplats', false)) {
  91. tr.drawSplat = function (x, y, team, showDeath, fadeAway) {
  92. console.log('drawSplat()');
  93. /* Draws a splat onto the splat layer.
  94. * @param x {Number} The x-coordinate
  95. * @param y {Number} The y-coordinate
  96. * @param team {Number} The team number
  97. * @param showDeath {boolean} Whether to show the death animation. */
  98. var startColor, stopColor;
  99. if (team === 1) {
  100. startColor = "ff0000";
  101. } else {
  102. startColor = "0000ff";
  103. }
  104. stopColor = "ffffff";
  105.  
  106. if (showDeath) {
  107. if (tr.options.disableParticles) {
  108. tr.drawBallPop(x + 19, y + 19, team);
  109. } else {
  110. tr.startDeathEmitter(startColor, stopColor, x + 19, y + 19);
  111. }
  112. }
  113.  
  114. fadeAway = true;
  115. tr.addSplat(team, x, y, fadeAway);
  116. };
  117. }
  118.  
  119. //Ball Overlay...
  120. if (GM_getValue('TPTPR_ShowBallOverlaysMenu', false) && GM_getValue('TPTPR_Overlay', false) && TPTPR_Overlays.hasOwnProperty(GM_getValue('TPTPR_Overlay')) ) {
  121. var overlay = GM_getValue('TPTPR_Overlay');
  122. var overlayTexture = PIXI.Texture.fromImage(TPTPR_Overlays[overlay].url);
  123. tr.TPTPR_CreateOverlay = function(player) {
  124. if (!player.sprites.overlay) {
  125. player.sprites.overlay = new PIXI.Sprite(overlayTexture);
  126. player.sprites.overlay.anchor.x = 0.5;
  127. player.sprites.overlay.anchor.y = 0.5;
  128. player.sprites.overlay.x = 20;
  129. player.sprites.overlay.y = 20;
  130. if (overlay === 'sombrero') { //this one just looks better a bit bigger...
  131. player.sprites.overlay.width = 50;
  132. player.sprites.overlay.height = 50;
  133. }
  134. player.sprites.ball.addChild(player.sprites.overlay);
  135. }
  136. };
  137. }
  138.  
  139. //Different Balls, Ball Transparency & Overlay...
  140. if (GM_getValue('TPTPR_TransparentBall', 1) < 1 || spinBall || spinOverlay || differentBalls) {
  141. if (differentBalls) {
  142. var loadDifferentBalls = new PIXI.AssetLoader([Texture_Pack.balls]);
  143.  
  144. var setupDifferentBalls = function() {
  145. var texture = PIXI.Texture.fromImage([Texture_Pack.balls]); //will be taken from cache if available
  146. var redTexture = new PIXI.Texture(texture, new PIXI.Rectangle(texture.width-80, 0, 40, 40));
  147. var blueTexture = new PIXI.Texture(texture, new PIXI.Rectangle(texture.width-40, 0, 40, 40));
  148.  
  149. tr.updatePlayerColor = function(player) {
  150. var color = player.team == 1 ? "red" : "blue";
  151. var tileId = color + "ball";
  152. if (player.sprites.actualBall.tileId !== tileId) {
  153. var teamTexture = player.team === 1 ? redTexture : blueTexture;
  154. var baseTexture = tagpro.tiles.getTexture(tileId);
  155. var texture = new PIXI.Texture(baseTexture);
  156. player.sprites.actualBall.setTexture(texture);
  157. player.sprites.actualBall.tileId = tileId;
  158. player.sprites.newBall.setTexture(teamTexture);
  159. }
  160. };
  161.  
  162. tr.createNewBall = function(player) {
  163. if (!player.sprites.newBall) {
  164. var teamTexture = player.team === 1 ? redTexture : blueTexture;
  165. player.sprites.newBall = new PIXI.Sprite(teamTexture);
  166. player.sprites.newBall.anchor.x = 0.5;
  167. player.sprites.newBall.anchor.y = 0.5;
  168. player.sprites.newBall.x = 20;
  169. player.sprites.newBall.y = 20;
  170. player.sprites.ball.addChild(player.sprites.newBall);
  171. }
  172. };
  173.  
  174. tr.createBallSprite = function(player) {
  175. var texture = player.team == 1 ? "redball" : "blueball";
  176. player.sprites.actualBall = tagpro.tiles.draw(player.sprites.ball, texture, {x: 0, y: 0}, null, null, 0.01);
  177. player.sprites.actualBall.tileId = texture;
  178.  
  179. tr.createNewBall(player);
  180.  
  181. player.sprites.newBall.alpha = GM_getValue('TPTPR_TransparentBall', 1);
  182.  
  183. player.sprites.newBall.anchor.x = 0.5;
  184. player.sprites.newBall.anchor.y = 0.5;
  185. player.sprites.newBall.x = 20;
  186. player.sprites.newBall.y = 20;
  187.  
  188. if (GM_getValue('TPTPR_ShowBallOverlaysMenu', false) && GM_getValue('TPTPR_Overlay', false) && TPTPR_Overlays.hasOwnProperty(GM_getValue('TPTPR_Overlay')) ) tr.TPTPR_CreateOverlay(player);
  189. };
  190. };
  191.  
  192. loadDifferentBalls.onComplete = setupDifferentBalls;
  193. loadDifferentBalls.load();
  194.  
  195.  
  196. } else {
  197. tr.createBallSprite = function(player) {
  198. var texture = player.team == 1 ? "redball" : "blueball";
  199. player.sprites.actualBall = tagpro.tiles.draw(player.sprites.ball, texture, {x: 0, y: 0}, null, null, 0.01);
  200. player.sprites.actualBall.tileId = texture;
  201.  
  202. player.sprites.actualBall.alpha = GM_getValue('TPTPR_TransparentBall', 1);
  203.  
  204. player.sprites.actualBall.anchor.x = 0.5;
  205. player.sprites.actualBall.anchor.y = 0.5;
  206. player.sprites.actualBall.x = 20;
  207. player.sprites.actualBall.y = 20;
  208.  
  209. if (GM_getValue('TPTPR_ShowBallOverlaysMenu', false) && GM_getValue('TPTPR_Overlay', false) && TPTPR_Overlays.hasOwnProperty(GM_getValue('TPTPR_Overlay')) ) tr.TPTPR_CreateOverlay(player);
  210. };
  211. }
  212. }
  213.  
  214. //Center/Spin Flair (from Browncoat's Mod)...
  215. if (GM_getValue('TPTPR_ShowBallOverlaysMenu', false) && GM_getValue('TPTPR_CenterFlair', false)) {
  216. tr.drawFlair = function (player) {
  217. if (player.flair) {
  218. if (!player.sprites.flair) {
  219. var cacheKey = "flair-" + player.flair.x + "," + player.flair.y;
  220. var flairTexture = tr.getFlairTexture(cacheKey, player.flair);
  221. player.sprites.flair = new PIXI.Sprite(flairTexture);
  222. player.sprites.flair.x = 20;
  223. player.sprites.flair.y = 20;
  224. //player.sprites.flair.width = 20; //normal size is 16x16
  225. //player.sprites.flair.height = 20;
  226. player.sprites.flair.anchor.x = 0.5;
  227. player.sprites.flair.anchor.y = 0.5;
  228. player.sprites.info.addChild(player.sprites.flair);
  229. }
  230. if (GM_getValue('TPTPR_SpinFlair', false)) {
  231. player.sprites.flair.rotation = player.angle;
  232. }
  233. }
  234. if (!player.flair && player.sprites.flair) {
  235. player.sprites.info.removeChild(player.sprites.flair);
  236. }
  237. };
  238. }
  239.  
  240. //Spin...
  241. if ( spinBall || spinOverlay ) {
  242. var uPSP = tr.updatePlayerSpritePosition;
  243. tr.updatePlayerSpritePosition = function(player) {
  244. var whichBall = 'actualBall';
  245. if (GM_getValue('TPTPR_DifferentBallTexture', false) && player.sprites.newBall) whichBall = 'newBall';
  246. if (spinBall) player.sprites[whichBall].rotation = player.angle;
  247. if (spinOverlay && player.sprites.overlay) player.sprites.overlay.rotation = player.angle;
  248. uPSP(player);
  249. };
  250. }
  251.  
  252. if (GM_getValue('TPTPR_MoveChatToLeft', false)) {
  253. setTimeout(function() {
  254. $('#chatHistory').css('left', '10px');
  255. $('#chat').css('left', '10px');
  256. }, 1200);
  257. } else {
  258. setTimeout(function() {
  259. $('#chatHistory').css('left', $('#viewport').position().left + 10);
  260. $('#chat').css('left', $('#viewport').position().left + 10);
  261. }, 1200);
  262. }
  263.  
  264.  
  265. } else if ($('a#play').length) { //we're on the server homepage
  266. var texturePack = getTexture();
  267. var customTexturePack = GM_getValue('customTexturePack', TPTPR_Packs.mydnd.url);
  268. var savedTextures = JSON.parse(GM_getValue('savedTextures','{}'));
  269. var image = 'tiles', imageFriendly = 'Tiles';
  270. var randomPup = Math.floor(Math.random()*3);
  271.  
  272. /*-------------------------------------------------------------------------------*/
  273. // Functions...
  274. /*-------------------------------------------------------------------------------*/
  275. var handleDrop = function(e) {
  276. var data = e.originalEvent.dataTransfer;
  277. var URL;
  278.  
  279. if (data.files[0]){ // Handle as a file...
  280. var file = data.files[0];
  281. var reader = new FileReader();
  282. reader.onload = function(f){
  283. URL = f.target.result;
  284. setTexture(image, URL);
  285. saveToCustomTexturePack(image, URL);
  286. setTimeout(confirmText('Success - File Saved!', imageFriendly), 100);
  287. };
  288. reader.readAsDataURL(file);
  289.  
  290. } else { // Handle as a URL...
  291. data.items[0].getAsString(function(u){
  292. if (u.indexOf('http') !== 0) u = 'http://' + u;
  293. setTexture(image, u);
  294. saveToCustomTexturePack(image, u);
  295. URL = u;
  296. setTimeout(confirmText('Success - URL Saved!', imageFriendly), 100);
  297. });
  298. }
  299. };
  300.  
  301. /*-------------------------------------------------------------------------------*/
  302. var saveToCustomTexturePack = function(image, url) {
  303. customTexturePack[image] = url;
  304. GM_setValue('customTexturePack', customTexturePack);
  305. };
  306.  
  307. /*-------------------------------------------------------------------------------*/
  308. var setTexture = function(image, url) {
  309. texturePack[image] = url;
  310. GM_setValue('texturePack', texturePack);
  311.  
  312. if (image === 'wallpaper') {
  313. if (url.indexOf('#') === 0) { //color
  314. $('html').css('background', url);
  315. } else {
  316. $('html').css('background', '#000 url("'+texturePack[image]+'") no-repeat fixed center').css('background-size', (GM_getValue('TPTPR_StretchWallpaper', true) ? 'cover' : 'contain'));
  317. }
  318. }
  319. };
  320.  
  321. /*-------------------------------------------------------------------------------*/
  322. var img = new Image(); //we're using this to get .width & .height of texture
  323. var confirmText = function(header, message) {
  324. if (header === undefined) header = 'Done!';
  325. if (message === undefined) message = '';
  326.  
  327. $('#TPTPR_Messages').stop().animate({"opacity":0}, 0);
  328. if (header || message) {
  329. $('#TPTPR_Messages').html('<span style="font-size:12px; color:yellow">'+header+'</span><br><span style="font-size:11px; color:white">'+message+'</span>');
  330. $('#TPTPR_Messages').stop().animate({"opacity":1}, 200, "swing", function(){
  331. $('#TPTPR_Messages').stop().animate({"null":1}, 3000, function(){
  332. $('#TPTPR_Messages').stop().animate({"opacity":0}, 2000, "swing", function(){
  333. });
  334. });
  335. });
  336. }
  337.  
  338. if (texturePack[image]) {
  339. var dropZoneWidth = '100%';
  340. var dropZoneHeight = '40px';
  341. if ((image === 'tiles') || (image === 'splats') || (image === 'wallpaper') || (image === 'wallpaperingame')) dropZoneHeight = '220px';
  342. if (image === 'balls') dropZoneWidth = '80px';
  343.  
  344. if (texturePack[image].indexOf('#') === 0) { //color
  345. $('#TPTPR_DropZone').html('').css({ 'background':texturePack[image], 'height':dropZoneHeight });
  346. } else { //image
  347. if (image === 'balls') {
  348. img.src = texturePack[image];
  349. var texturePosition = (img.width || 640) - 80;
  350. $('#TPTPR_DropZone').html('').css({ 'margin':"0 auto", 'background':"url('"+texturePack[image]+"') center no-repeat", 'background-position':"-"+texturePosition+"px 0px", 'width':dropZoneWidth, 'height':dropZoneHeight });
  351. } else {
  352. $('#TPTPR_DropZone').html('').css({ 'margin':"0 auto", 'background':"url('"+texturePack[image]+"') center no-repeat", 'background-size':"contain", 'width':dropZoneWidth, 'height':dropZoneHeight });
  353. }
  354. }
  355. } else {
  356. if (image === 'balls') {
  357. $('#TPTPR_DropZone').css({'height':'220px', 'width':'100%', 'background':'#a00'}).html('<div style="margin:40px">No File Loaded!<br>(Balls from "Tiles" will be used)</div>');
  358. } else {
  359. $('#TPTPR_DropZone').css({'height':'220px', 'width':'100%', 'background':'#a00'}).html('<div style="margin:40px">No File Loaded!<br>(Vanilla defaults will be used)</div>');
  360. }
  361. }
  362. };
  363.  
  364. /*-------------------------------------------------------------------------------*/
  365. var createPreview = function(name, type, elementToAppendTo, addNamePlate) {
  366. if (type === undefined) type = 'saved';
  367. if (elementToAppendTo === undefined) elementToAppendTo = $('#TPTPR_SavedPacks');
  368. if (addNamePlate === undefined) addNamePlate = true;
  369.  
  370. var textureUrl;
  371. var boostTextureUrl;
  372. if (type === 'saved') {
  373. textureUrl = savedTextures[name].tiles;
  374. boostTextureUrl = savedTextures[name].speedpad;
  375. } else if (type === 'author') {
  376. if (name === 'mydnd') {
  377. textureUrl = customTexturePack.tiles;
  378. boostTextureUrl = customTexturePack.speedpad;
  379. } else {
  380. textureUrl = TPTPR_Packs[name].url.tiles;
  381. boostTextureUrl = TPTPR_Packs[name].url.speedpad;
  382. }
  383. } else {
  384. textureUrl = texturePack.tiles;
  385. boostTextureUrl = texturePack.speedpad;
  386. }
  387.  
  388. var $preview = $('<div class="preview" value="'+name+'" title="Load This Texture Pack...">').css({
  389. 'position': 'relative',
  390. 'display': 'inline-block',
  391. 'margin': '0px',
  392. 'transform': 'scale(0.8, 0.8)',
  393. 'border-spacing': '0',
  394. 'cursor': 'pointer'
  395. });
  396.  
  397. // Create actual preview
  398. var previewOutline = {
  399. 1: {
  400. 1:'',
  401. 2:'',
  402. 3:'',
  403. 4:''
  404. },
  405. 2: {
  406. 1:'wall1',
  407. 2:'',
  408. 3:'',
  409. 4:''
  410. },
  411. 3: {
  412. 1:'wall2',
  413. 2:'wallA',
  414. 3:'pup',
  415. 4:''
  416. }
  417. };
  418.  
  419. var tile = {x:-520, y:-160},
  420. wall1 = {x:-280, y:-120},
  421. wallA = {x:-80, y:-360},
  422. wall2 = {x:-280, y:-400},
  423. spad = {x:'0px', y:'0px'},
  424. pup = (function(){
  425. var yPosition = -160 - 40 * randomPup;
  426. return {x:-480, y: yPosition};
  427. })(),
  428. fc = {x:'-560px', y:'0px'},
  429. flag = {x:'-600px', y:'-40px'};
  430.  
  431. for (var i in previewOutline){
  432. var row = $('<div/>');
  433. if (i == 1 || i == 3) row.css('height','30px');
  434. else row.css('height','40px');
  435.  
  436. for (var j in previewOutline[i]){
  437. var tilePos = JSON.parse(JSON.stringify(tile));
  438. if (i == 1) tilePos.y += -10;
  439. if (j == 1) tilePos.x += -10;
  440.  
  441. tilePos = tilePos.x+'px '+tilePos.y+'px';
  442. var $tile = $('<div></div>').css({
  443. 'backgroundImage': 'url('+textureUrl+')',
  444. 'backgroundPosition': tilePos,
  445. 'height': 'inherit',
  446. 'width': '40px',
  447. 'display': 'table-cell'
  448. });
  449.  
  450. if (i == 1 || i == 3) row.find('.tile').css('backgroundPosition',tilePos.x +' '+ tilePos.y);
  451.  
  452. var $tileImage = $('<div/>').css({
  453. 'backgroundImage': 'url('+textureUrl+')',
  454. 'height': 'inherit',
  455. 'width': 'inherit'
  456. });
  457. var position;
  458. switch(previewOutline[i][j]){
  459. case 'wall1':
  460. position = JSON.parse(JSON.stringify(wall1));
  461. break;
  462. case 'wall2':
  463. position = JSON.parse(JSON.stringify(wall2));
  464. break;
  465. case 'wallA':
  466. position = JSON.parse(JSON.stringify(wallA));
  467. break;
  468. case 'pup':
  469. position = JSON.parse(JSON.stringify(pup));
  470. break;
  471. default:
  472. position = {x:40, y:40};
  473. break;
  474. }
  475.  
  476. if (j == 1) {
  477. position.x += -10;
  478. $tile.css('width','30px');
  479. }
  480. else if (j == 4) {
  481. $tile.css('width','40px');
  482. }
  483. position = position.x+'px '+position.y+'px';
  484. $tileImage.css('backgroundPosition', position);
  485. if (((i == 2) && (j == 1)) || ((i == 3) && (j == 1)) || ((i == 3) && (j == 2)) || ((i == 3) && (j == 3))) {
  486. $tile.append($tileImage);
  487. }
  488. row.append($tile);
  489. }
  490. $preview.append(row);
  491. }
  492. $preview.append($('<div class="flag-carrier"></div>').css({
  493. 'backgroundPosition': fc.x +' '+ fc.y,
  494. 'backgroundImage': 'url('+textureUrl+')',
  495. top: '37px',
  496. left: '35px'
  497. }));
  498. $preview.find('.flag-carrier').append($('<div class="flag-carrier"></div>').css({
  499. 'backgroundPosition': flag.x +' '+ flag.y,
  500. 'backgroundImage': 'url('+textureUrl+')',
  501. top: '-33px'
  502. }));
  503. $preview.append($('<div id="TPTR_Preview_Boost"></div>').css({
  504. 'backgroundPosition': spad.x +' '+ spad.y,
  505. 'backgroundImage': 'url('+boostTextureUrl+')',
  506. position: 'absolute',
  507. top: '30px',
  508. left: '110px',
  509. width: '40px',
  510. height: '40px'
  511. }));
  512.  
  513. // Create name plate
  514. if (addNamePlate) {
  515. var nameplateCSS = {
  516. position: 'absolute',
  517. width: '100%',
  518. zIndex: '3',
  519. backgroundColor: '#000000',
  520. bottom: '-14px',
  521. fontSize: '11px',
  522. padding: '1px 0px'
  523. };
  524. var $nameplate = $('<div class="nameplate"></div>').css(nameplateCSS);
  525.  
  526. $nameplate.append($('<span/>').css('margin','0px 10px').text(name));
  527. $preview.append($nameplate);
  528. }
  529.  
  530. // Delete button
  531. var deleteCSS = {
  532. position: 'absolute',
  533. color: '#ffffff',
  534. top: '4px',
  535. right: '4px',
  536. fontWeight: 'bold',
  537. fontSize: '12px',
  538. opacity: '0.3',
  539. cursor: 'pointer',
  540. textDecoration: 'none',
  541. zIndex: '2',
  542. backgroundColor:'red',
  543. borderRadius: '50%',
  544. textAlign: 'center',
  545. width: '15px',
  546. height: '15px'
  547. };
  548. var $delete = $('<div class="delete-preview" title="Delete This Saved Pack"></div>').css(deleteCSS).text('x');
  549. $delete.hover(function(){
  550. $(this).css('opacity', '1');
  551. }, function(){
  552. $(this).css('opacity', '0.3');
  553. });
  554. $preview.prepend($delete);
  555.  
  556. // Append
  557. $(elementToAppendTo).prepend($preview);
  558. };
  559.  
  560.  
  561. /*-------------------------------------------------------------------------------*/
  562. // Build the menu...
  563. /*-------------------------------------------------------------------------------*/
  564. // Append components
  565. $('h1').after('<div id="TPTPR_Container" style="display:flex; flex-flow: row wrap; position:relative; margin:15px auto; padding:3px; text-align:center; width:540px; line-height:1.1; background-color:#DADFE1; border-radius:5px; -webkit-user-select:none; z-index:100"></div>');
  566. var $TPTPR_Container = $('#TPTPR_Container');
  567. $TPTPR_Container.append('<div id="TPTPR_Heading" style="width:100%; color:goldenrod; background:rebeccapurple; font-size:16px; padding:3px; margin:-3px -3px 3px -3px; border-radius:5px 5px 0 0; font-weight:bold; text-shadow:1px 1px 1px #000;">' + GM_info.script.name + ' <span style="color:#ccc; font-size:10px; font-style:italic; font-weight:normal;">v'+GM_info.script.version+'</span></div>');
  568. $TPTPR_Container.append('<div id="TPTPR_Left" style="width:200px"></div>');
  569. $TPTPR_Container.append('<div id="TPTPR_Right" style="margin:0px 10px 10px; width:320px"></div>');
  570. var $TPTPR_Right = $('#TPTPR_Right');
  571. $TPTPR_Container.append('<div id="TPTPR_ExitX" style="position:absolute; top:2px; right:2px; color:black; background:white; font-weight:bold; font-size:16px; width:19px; border:1px solid black; opacity:0.4; cursor:pointer; z-index:2">x</div>');
  572.  
  573. $('#TPTPR_Left').append('<table id="TPTPR_Left_Inner" style="width:100%; background:#444; font-size:13px; border:1px solid black; border-spacing:1px; border-radius:7px"></table>');
  574. var $TPTPR_Left_Inner = $('#TPTPR_Left_Inner');
  575. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_tiles" class="TPTPR_TextureButton" value="tiles"><span>Tiles</span></th></tr>');
  576. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_speedpad" class="TPTPR_TextureButton" value="speedpad"><span>Speedpad</span></th></tr>');
  577. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_speedpadred" class="TPTPR_TextureButton" value="speedpadred"><span>Speedpad Red</span></th></tr>');
  578. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_speedpadblue" class="TPTPR_TextureButton" value="speedpadblue"><span>Speedpad Blue</span></th></tr>');
  579. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_portal" class="TPTPR_TextureButton" value="portal"><span>Portal</span></th></tr>');
  580. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_splats" class="TPTPR_TextureButton" value="splats"><span>Splats</span></th></tr>');
  581. $TPTPR_Left_Inner.append('<tr><td class="TPTPR_Spacer" style="background:#fff"></td></tr>');
  582. $TPTPR_Left_Inner.append('<tr><td style="background:#666"><div id="TPTPR_HideShowPacks" class="TPTPR_MenuSliderButton" title="Show/Hide">⇩ Texture Packs ⇩</div><div id="TPTPR_TexturePacks" style="display:flex; flex-wrap:wrap; justify-content:center; font-size:11px; overflow:hidden"></div></td></tr>');
  583. var $TPTPR_TexturePacks = $('#TPTPR_TexturePacks');
  584. $TPTPR_Left_Inner.append('<tr><td class="TPTPR_Spacer" style="background:#fff"></td></tr>');
  585. $TPTPR_Left_Inner.append('<tr><td id="TPTPR_Options" style="background:#888; font-size:11px">' +
  586. '<label><input type="checkbox"'+(GM_getValue('TPTPR_Spin', false) ? ' checked' : '')+' id="TPTPR_Spin">Ball Spin</label><br>' +
  587. '<label><input type="range" id="TPTPR_TransparentBall" value="'+(GM_getValue('TPTPR_TransparentBall', 1)*100)+'" min="0" max="100"></label><div style="color:#ddd">Ball Transparency: <span id="TPTPR_TransparentBallValue">'+(GM_getValue('TPTPR_TransparentBall', 1))+'</span></div>' +
  588. '<label><input type="checkbox"'+(GM_getValue('TPTPR_DifferentBallTexture', false) ? ' checked' : '')+' id="TPTPR_DifferentBallTexture">Use Different Ball Texture</label><br>' +
  589. '<label><input type="checkbox"'+(GM_getValue('TPTPR_FadingSplats', false) ? ' checked' : '')+' id="TPTPR_FadingSplats">Use Fading Splats</label><br>' +
  590. '<label><input type="checkbox"'+(GM_getValue('TPTPR_TransparentBackground', false) ? ' checked' : '')+' id="TPTPR_TransparentBackground">Transparent Game Background</label><br>' +
  591. '<label><input type="checkbox"'+(GM_getValue('TPTPR_UseInGameWallpaper', false) ? ' checked' : '')+' id="TPTPR_UseInGameWallpaper">Use Different In-Game Wallpaper</label><br>' +
  592. '<label><input type="checkbox"'+(GM_getValue('TPTPR_StretchWallpaper', true) ? ' checked' : '')+' id="TPTPR_StretchWallpaper">Stretch Wallpaper to Fit</label><br>' +
  593. '<label title="Default position is inside game window"><input type="checkbox"'+(GM_getValue('TPTPR_MoveChatToLeft', false) ? ' checked' : '')+' id="TPTPR_MoveChatToLeft">Force Chat to Left of Screen</label><br>' +
  594. '<label><input type="checkbox"'+(GM_getValue('TPTPR_ShowBallOverlaysMenu', false) ? ' checked' : '')+' id="TPTPR_ShowBallOverlaysMenu">Enable Ball Overlays</label><br>' +
  595. '</td></tr>');
  596. GM_addStyle('#TPTPR_Options label:hover { color:chartreuse; }');
  597. $TPTPR_Left_Inner.append('<tr class="TPTPR_BallOverlaysMenu" style="display:none"><td class="TPTPR_Spacer" style="background:#fff"></td></tr>');
  598. $TPTPR_Left_Inner.append('<tr class="TPTPR_BallOverlaysMenu" style="display:none"><td style="background:#aaa"><div id="TPTPR_HideShowBallOverlays" class="TPTPR_MenuSliderButton" title="Show/Hide">⇩ Ball Overlays ⇩</div><div id="TPTPR_BallOverlays" style="display:flex; flex-wrap:wrap; justify-content:center; font-size:11px; color:#444; overflow:hidden"></div></td></tr>');
  599. $TPTPR_Left_Inner.append('<tr><td class="TPTPR_Spacer" style="background:#fff"></td></tr>');
  600. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_balls" class="TPTPR_TextureButton" value="balls" style="cursor:pointer'+(GM_getValue('TPTPR_DifferentBallTexture', false) ? '' : '; display:none')+'"><span>Balls</span></th></tr>');
  601. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_wallpaper" value="wallpaper"><span>Wallpaper</span></th></tr>');
  602. $TPTPR_Left_Inner.append('<tr><th id="TPTPR_TextureButton_wallpaperingame" value="wallpaperingame" style="cursor:pointer'+(GM_getValue('TPTPR_UseInGameWallpaper', false) ? '' : '; display:none')+'"><span>Game Wallpaper</span></th></tr>');
  603. GM_addStyle('#TPTPR_Container th { cursor:pointer; background:#444 }');
  604. GM_addStyle('#TPTPR_Container th:hover { cursor:pointer; background:#999 }');
  605.  
  606. $TPTPR_Right.append('<div style="font-size:13px; color:black; font-weight:bold">In-Game Texture</div><div style="font-size:10px; color:black; font-style:italic">(this texture will always be used for games)</div>');
  607. $TPTPR_Right.append('<div id="TPTPR_DropZone_Outer" style="display:flex; align-items:center; height:220px; border:2px dotted silver;"><div id="TPTPR_DropZone" style="width:100%"></div></div>');
  608. $TPTPR_Right.append('<div id="TPTPR_Messages" style="display:inline-block; margin:5px auto; padding:0 10px; font-weight:bold; background:#c00; border-radius:8px;">&nbsp;</div>');
  609. $TPTPR_Right.append('<div><div id="TPTPR_PacksHeading" class="TPTPR_MenuSliderButton" title="Show/Hide">⇩ My Saved Texture Packs ⇩</div></div>');
  610. $('#TPTPR_PacksHeading').after('<div id="TPTPR_SavedPacks" style="position:relative; display:'+(Object.keys(savedTextures).length <= 2 ? 'inline-block' : 'none')+'; background-color:#ccc; height:auto; width:320px; border-bottom:3px solid gray; border-radius:0px 0px 5px 5px"></div>');
  611. $('#TPTPR_SavedPacks').append('<div id="TPTR_addNewPack" title="Save Current Texture Set" style="margin:10px auto; width:80px; opacity:0.5; font-size:40px; color:#7f8c8d; background:#ccc; border: 1px dashed black; border-radius:10px; cursor:pointer">+</div>');
  612. GM_addStyle('.TPTPR_MenuSliderButton { font-size:12px; color:lightgrey; background:rebeccapurple; padding:1px 5px; border-radius:5px; cursor:pointer; }');
  613. GM_addStyle('.TPTPR_MenuSliderButton:hover { color:chartreuse }');
  614.  
  615. $('#TPTPR_Container').hide(0);
  616.  
  617. //Pre-made texture packs...
  618. $.each(TPTPR_Packs, function(key, value) {
  619. $TPTPR_TexturePacks.append('<span id="'+key+'" class="TPTPR_TexturePacksItem" title="By '+value.author+'">'+value.displayname+'</span>');
  620. if (key === 'vanilla') {
  621. $('#'+key).addClass('TPTPR_SpecialPack');
  622. } else if (key === 'mydnd') {
  623. $('#'+key).addClass('TPTPR_SpecialPack');
  624. $TPTPR_TexturePacks.append('<div style="width:100%"></div>');
  625. }
  626. });
  627. $TPTPR_TexturePacks.append('<div style="width:100%"></div>');
  628. $TPTPR_TexturePacks.append('<label title="Uncheck to only load individual textures (like speedpad, splats, etc)" style="color:chartreuse"><input type="checkbox"'+(GM_getValue('TPTPR_CompletePack', true) ? ' checked' : '') + ' id="TPTPR_CompletePack">Load Complete Pack?</label>');
  629. GM_addStyle('.TPTPR_TexturePacksItem { margin:1px 4px; padding:0 3px; background:#fff; color:#777; border-radius:6px; cursor:default }');
  630. GM_addStyle('.TPTPR_TexturePacksItem:hover { background:firebrick; color:#eee }');
  631. GM_addStyle('.TPTPR_SpecialPack { font-style:italic; }');
  632.  
  633. //Ball Overlays...
  634. $.each(TPTPR_Overlays, function(key, value) {
  635. $('#TPTPR_BallOverlays').append('<label class="TPTPR_BallOverlaysItem" id="'+key+'"><input type="radio" class="TPTPR_BallOverlaysItem" name="TPTPR_BallOverlaysItem"'+(key===GM_getValue('TPTPR_Overlay', false)?' checked':'')+'>'+value.displayname+'</input></label>');
  636. });
  637. $('#TPTPR_BallOverlays').append('<br><label style="width:100%; color:darkslategray"><input type="checkbox"' + (GM_getValue('TPTPR_SpinOverlay', false) ? ' checked' : '') + ' id="TPTPR_SpinOverlay">Spin Overlay</label>');
  638. $('#TPTPR_BallOverlays').append('<br><label style="width:100%; color:darkslategray"><input type="checkbox"' + (GM_getValue('TPTPR_CenterFlair', false) ? ' checked' : '') + ' id="TPTPR_CenterFlair">Center Flair in Ball</label>');
  639. $('#TPTPR_BallOverlays').append('<br><label style="width:100%; color:darkslategray"><input type="checkbox"' + (GM_getValue('TPTPR_SpinFlair', false) ? ' checked' : '') + (GM_getValue('TPTPR_CenterFlair', false) ? '' : ' disabled') + ' id="TPTPR_SpinFlair">Spin Flair with Ball</label>');
  640. $('#TPTPR_BallOverlays').hide(0);
  641. if (GM_getValue('TPTPR_ShowBallOverlaysMenu', false)) $('.TPTPR_BallOverlaysMenu').show(0);
  642. GM_addStyle('input.TPTPR_BallOverlaysItem { margin:0 0 0 4px }');
  643.  
  644. // Add saved texture previews...
  645. $.each(savedTextures, function(key, value) {
  646. createPreview(key);
  647. });
  648.  
  649. //Set the wallpaper...
  650. if (Texture_Pack.wallpaper.indexOf('#') === 0) { //just a color
  651. $('html').css('background', Texture_Pack.wallpaper);
  652. } else {
  653. $('html').css('background', '#000 url("'+Texture_Pack.wallpaper+'") no-repeat fixed center').css('background-size', (GM_getValue('TPTPR_StretchWallpaper', true) ? 'cover' : 'contain'));
  654. }
  655.  
  656.  
  657. /*-------------------------------------------------------------------------------*/
  658. // Bind events...
  659. /*-------------------------------------------------------------------------------*/
  660. $('h1').on('dblclick', function() {
  661. $('#TPTPR_Container').slideToggle(400);
  662. });
  663.  
  664. $('#TPTPR_Container').find('table th').click(function(){
  665. $('#TPTPR_Left_Inner th').css('color', '#fff');
  666. $(this).css('color', '#7e0');
  667. image = $(this).attr('value');
  668. imageFriendly = $(this).text();
  669. if ((image === 'wallpaper') || (image === 'wallpaperingame')) $('#TPTPR_DropZone').prop('title', 'Double-click to reset');
  670. else $('#TPTPR_DropZone').prop('title', '');
  671. setTimeout(confirmText(imageFriendly), 50);
  672. });
  673.  
  674. //Exit 'X'...
  675. $('#TPTPR_ExitX').hover(function(){
  676. $(this).css('opacity', '0.8');
  677. }, function(){
  678. $(this).css('opacity', '0.4');
  679. }).click(function(){
  680. $(this).parent().slideUp();
  681. });
  682.  
  683.  
  684. //My Saved Packs...
  685. $('#TPTPR_PacksHeading').click(function(){
  686. if ($('#TPTPR_SavedPacks').is(':visible')) {
  687. $('#TPTPR_SavedPacks').slideUp(400, function() {
  688. $('#TPTPR_PacksHeading').text('⇩ My Saved Texture Packs ⇩');
  689. });
  690.  
  691. } else {
  692. if ((image === 'wallpaper') || (image === 'wallpaperingame')) {
  693. image = 'tiles';
  694. $('#TPTPR_Left_Inner').find('th').css('color', '#fff');
  695. $('#TPTPR_Container').find('table th:eq(0)').css('color', '#7e0');
  696. confirmText('');
  697. }
  698. $('#TPTPR_SavedPacks').slideDown(400, function() {
  699. $('#TPTPR_PacksHeading').text('⇧ My Saved Texture Packs ⇧');
  700. });
  701. }
  702. });
  703.  
  704. $('#TPTPR_SavedPacks').on('click', '.preview', function(){
  705. var textureName = $(this).attr('value');
  706. var pack = savedTextures[textureName];
  707. for (var i in pack){
  708. texturePack[i] = pack[i];
  709. setTexture(i, pack[i]);
  710. $('#TPTPR_TextureButton_'+i).children('span').fadeOut(200).fadeIn(600);
  711. }
  712. confirmText('Saved Texture Pack Loaded', '"'+textureName+'"');
  713. });
  714. $('#TPTPR_SavedPacks').on('mouseenter', '.preview', function(){
  715. $(this).css('opacity', '0.7');
  716. }).on('mouseleave', '.preview', function(){
  717. $(this).css('opacity', '1');
  718. });
  719.  
  720. $('#TPTPR_SavedPacks').on('click', '.delete-preview', function(e){
  721. e.stopPropagation();
  722. e.preventDefault();
  723. var confirmDelete = confirm('Delete saved texture pack?');
  724. if (confirmDelete) {
  725. var preview = $(this).parent();
  726. preview.fadeOut(function(){
  727. delete savedTextures[preview.attr('value')];
  728. preview.remove();
  729. GM_setValue('savedTextures', JSON.stringify(savedTextures));
  730. });
  731. }
  732. });
  733.  
  734. $('#TPTR_addNewPack').click(function(){
  735. var name = prompt('Texture pack name:');
  736. if (name){
  737. var texturePackTemp = JSON.parse(JSON.stringify(texturePack));
  738. delete texturePackTemp.wallpaper;
  739. delete texturePackTemp.wallpaperingame;
  740. savedTextures[name] = texturePackTemp;
  741. if ((JSON.stringify(savedTextures)*2/1024)/1024 > 30) {
  742. alert('Storage limit exceeded.');
  743. delete savedTextures[name];
  744. }
  745. else {
  746. GM_setValue('savedTextures', JSON.stringify(savedTextures));
  747. createPreview(name);
  748. }
  749. }
  750. }).hover(function(){
  751. $(this).css('opacity', '0.8');
  752. }, function(){
  753. $(this).css('opacity', '0.5');
  754. });
  755.  
  756.  
  757. //Options...
  758. $('#TPTPR_Spin').on('click', function() {
  759. GM_setValue('TPTPR_Spin', $(this).is(':checked'));
  760. confirmText('Ball Spin: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  761. });
  762. $('#TPTPR_TransparentBall').on('input', function() {
  763. $('#TPTPR_TransparentBallValue').text( (this.value / 100).toFixed(2) );
  764. });
  765. $('#TPTPR_TransparentBall').on('change', function() {
  766. GM_setValue('TPTPR_TransparentBall', (this.value / 100).toFixed(2));
  767. });
  768. $('#TPTPR_DifferentBallTexture').on('click', function() {
  769. GM_setValue('TPTPR_DifferentBallTexture', $(this).is(':checked'));
  770. if ($(this).is(':checked')) {
  771. $('#TPTPR_TextureButton_balls').fadeIn(400);
  772. $('#TPTPR_TextureButton_balls').trigger('click');
  773. } else {
  774. $('#TPTPR_TextureButton_balls').fadeOut(400);
  775. if (image === 'balls') $('#TPTPR_TextureButton_tiles').trigger('click');
  776. }
  777. });
  778. $('#TPTPR_FadingSplats').on('click', function() {
  779. GM_setValue('TPTPR_FadingSplats', $(this).is(':checked'));
  780. confirmText('Fading Splats: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  781. });
  782. $('#TPTPR_TransparentBackground').on('click', function() {
  783. GM_setValue('TPTPR_TransparentBackground', $(this).is(':checked'));
  784. confirmText('Game Background Transparency: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  785. });
  786. $('#TPTPR_UseInGameWallpaper').on('click', function() {
  787. GM_setValue('TPTPR_UseInGameWallpaper', $(this).is(':checked'));
  788. $('#TPTPR_TextureButton_wallpaperingame').fadeToggle(400);
  789. confirmText('Different Wallpaper In Game: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  790. });
  791. $('#TPTPR_StretchWallpaper').on('click', function() {
  792. GM_setValue('TPTPR_StretchWallpaper', $(this).is(':checked'));
  793. $('html').css('background', '#000 url("'+texturePack.wallpaper+'") no-repeat fixed center').css('background-size', (GM_getValue('TPTPR_StretchWallpaper') ? 'cover' : 'contain'));
  794. confirmText('Stretch Wallpaper: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  795. });
  796. $('#TPTPR_MoveChatToLeft').on('click', function() {
  797. GM_setValue('TPTPR_MoveChatToLeft', $(this).is(':checked'));
  798. confirmText('Move Chat to Left: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  799. });
  800. $('#TPTPR_ShowBallOverlaysMenu').on('click', function() {
  801. GM_setValue('TPTPR_ShowBallOverlaysMenu', $(this).is(':checked'));
  802. $('.TPTPR_BallOverlaysMenu').fadeToggle(600);
  803. confirmText('Ball Overlays: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  804. });
  805. $('#TPTPR_CenterFlair').on('click', function() {
  806. GM_setValue('TPTPR_CenterFlair', $(this).is(':checked'));
  807. if ($(this).is(':checked')) {
  808. $('#TPTPR_SpinFlair').prop('disabled', false);
  809. } else {
  810. $('#TPTPR_SpinFlair').prop('disabled', true);
  811. }
  812. confirmText('Center Flair: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  813. });
  814. $('#TPTPR_SpinFlair').on('click', function() {
  815. GM_setValue('TPTPR_SpinFlair', $(this).is(':checked'));
  816. confirmText('Spin Flair: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  817. });
  818.  
  819.  
  820.  
  821. // Get Texture Packs...
  822. $TPTPR_TexturePacks.hide(0);
  823. $('#TPTPR_HideShowPacks').on('click', function() {
  824. if ($TPTPR_TexturePacks.is(':visible')) {
  825. $TPTPR_TexturePacks.slideUp(400, function() {
  826. $('#TPTPR_HideShowPacks').text('⇩ Texture Packs ⇩');
  827. });
  828. } else {
  829. $TPTPR_TexturePacks.slideDown(400, function() {
  830. $('#TPTPR_HideShowPacks').text('⇧ Texture Packs ⇧');
  831. });
  832. if ((image === 'wallpaper') || (image === 'wallpaperingame')) {
  833. image = 'tiles';
  834. $('#TPTPR_Container table th').css('color', '#fff');
  835. $('#TPTPR_Container').find('table th:eq(0)').css('color', '#7e0');
  836. confirmText('');
  837. }
  838. }
  839. });
  840.  
  841. $('#TPTPR_TexturePacks').find('.TPTPR_TexturePacksItem').hover(function() {
  842. $('#TPTPR_PackPreview').remove();
  843.  
  844. if ((image !== 'wallpaper') && (image !== 'wallpaperingame')) {
  845. var width = '300px', height = '40px';
  846. if ((image === 'tiles') || (image === 'splats')) height = '200px';
  847. if (image === 'balls') width = '80px';
  848.  
  849. if (GM_getValue('TPTPR_CompletePack', true)) {
  850. $('#'+this.id).after('<div id="TPTPR_PackPreview" style="position:absolute; padding:5px 10px; background:white; border:2px dashed purple; border-radius:5px; z-index:9999;"></div>');
  851. createPreview(this.id, 'author', '#TPTPR_PackPreview', false);
  852. } else {
  853. if (this.id === 'mydnd') {
  854. if (image === 'balls') {
  855. img.src = customTexturePack.balls;
  856. var texturePosition = (img.width || 640) - 80;
  857. $('#'+this.id).after('<div id="TPTPR_PackPreview" style="position:absolute; width:300px; z-index:9999; width:'+width+'; height:'+height+'; border:2px solid black; border-radius:5px; background:#fff url(\''+customTexturePack.balls+'\') center no-repeat; background-position:-'+texturePosition+'px 0;"></div>');
  858. } else {
  859. $('#'+this.id).after('<div id="TPTPR_PackPreview" style="position:absolute; width:300px; z-index:9999; width:'+width+'; height:'+height+'; border:2px solid black; border-radius:5px; background:#fff url(\''+customTexturePack[image]+'\') center no-repeat; background-size:contain;"></div>');
  860. }
  861. } else {
  862. if (image === 'balls') {
  863. img.src = TPTPR_Packs[this.id].url.tiles;
  864. var texturePosition = (img.width || 640) - 80;
  865. $('#'+this.id).after('<div id="TPTPR_PackPreview" style="position:absolute; width:300px; z-index:9999; width:'+width+'; height:'+height+'; border:2px solid black; border-radius:5px; background:#fff url(\''+TPTPR_Packs[this.id].url.tiles+'\') center no-repeat; background-position:-'+texturePosition+'px 0;"></div>');
  866. } else {
  867. $('#'+this.id).after('<div id="TPTPR_PackPreview" style="position:absolute; width:300px; z-index:9999; width:'+width+'; height:'+height+'; border:2px solid black; border-radius:5px; background:#fff url(\''+TPTPR_Packs[this.id].url[image]+'\') center no-repeat; background-size:contain;"></div>');
  868. }
  869. }
  870. }
  871. }
  872. }, function() {
  873. $('#TPTPR_PackPreview').remove();
  874. });
  875.  
  876. $('#TPTPR_CompletePack').on('click', function() {
  877. GM_setValue('TPTPR_CompletePack', $(this).is(':checked'));
  878. });
  879.  
  880. $('#TPTPR_TexturePacks').find('.TPTPR_TexturePacksItem').on('click', function() {
  881. $('#TPTPR_PackPreview').remove();
  882. if (this.id === 'vanilla') {
  883. if (GM_getValue('TPTPR_CompletePack', true)) {
  884. $.each(texturePack, function(key, value) {
  885. if ((key !== 'wallpaper') && (image !== 'wallpaperingame')) {
  886. setTexture(key, "/images/"+key+".png");
  887. $('#TPTPR_TextureButton_'+key).children('span').fadeOut(200).fadeIn(600);
  888. }
  889. });
  890. confirmText('Texture Pack Loaded', TPTPR_Packs[this.id].displayname);
  891. } else {
  892. setTexture(image, "/images/"+image+".png");
  893. $('#TPTPR_TextureButton_'+image).children('span').fadeOut(200).fadeIn(600);
  894. confirmText('Single Texture Loaded: ' + imageFriendly, TPTPR_Packs[this.id].displayname);
  895. }
  896.  
  897. } else if (this.id === 'mydnd') { //drag and dropped
  898. if (GM_getValue('TPTPR_CompletePack', true)) {
  899. $.each(texturePack, function(key, value) {
  900. if ((key !== 'wallpaper') && (image !== 'wallpaperingame')) {
  901. setTexture(key, customTexturePack[key]);
  902. $('#TPTPR_TextureButton_'+key).children('span').fadeOut(200).fadeIn(600);
  903. }
  904. });
  905. confirmText('Texture Pack Loaded', TPTPR_Packs[this.id].displayname);
  906. } else {
  907. setTexture(image, customTexturePack[image]);
  908. $('#TPTPR_TextureButton_'+image).children('span').fadeOut(200).fadeIn(600);
  909. confirmText('Single Texture Loaded: ' + imageFriendly, TPTPR_Packs[this.id].displayname);
  910. }
  911.  
  912. } else {
  913. if (GM_getValue('TPTPR_CompletePack', true)) {
  914. var packId = this.id;
  915. $.each(texturePack, function(key, value) {
  916. if ((key !== 'wallpaper') && (image !== 'wallpaperingame')) {
  917. setTexture(key, TPTPR_Packs[packId].url[key]);
  918. $('#TPTPR_TextureButton_'+key).children('span').fadeOut(200).fadeIn(600);
  919. }
  920. });
  921. confirmText('Texture Pack Loaded', TPTPR_Packs[this.id].displayname);
  922. } else {
  923. if (image === 'balls') {
  924. setTexture(image, TPTPR_Packs[this.id].url.tiles);
  925. } else {
  926. setTexture(image, TPTPR_Packs[this.id].url[image]);
  927. }
  928. $('#TPTPR_TextureButton_'+image).children('span').fadeOut(200).fadeIn(600);
  929. setTimeout(confirmText('Single Texture Loaded: ' + imageFriendly, TPTPR_Packs[this.id].displayname), 50);
  930. }
  931. }
  932. });
  933.  
  934.  
  935. //Overlays...
  936. $('#TPTPR_HideShowBallOverlays').on('click', function() {
  937. if ($('#TPTPR_BallOverlays').is(':visible')) {
  938. $('#TPTPR_BallOverlays').slideUp(400, function() {
  939. $('#TPTPR_HideShowBallOverlays').text('⇩ Ball Overlays ⇩');
  940. });
  941. } else {
  942. $('#TPTPR_BallOverlays').slideDown(400, function() {
  943. $('#TPTPR_HideShowBallOverlays').text('⇧ Ball Overlays ⇧');
  944. });
  945. }
  946. });
  947.  
  948. $('#TPTPR_BallOverlays').find('label.TPTPR_BallOverlaysItem').on('click', function() {
  949. if (this.id === 'none') {
  950. GM_setValue('TPTPR_Overlay', false);
  951. } else {
  952. GM_setValue('TPTPR_Overlay', this.id);
  953. }
  954. });
  955.  
  956. $('#TPTPR_BallOverlays').find('label.TPTPR_BallOverlaysItem').hover(function() {
  957. $('#TPTPR_OverlayPreview').remove();
  958. if (GM_getValue('TPTPR_DifferentBallTexture', false) && texturePack.balls) {
  959. img.src = texturePack.balls;
  960. var texturePosition = (img.width || 640) - 80;
  961. $('#'+this.id).children('input').after('<div id="TPTPR_OverlayPreview" style="position:absolute; margin-top:2px; width:80px; height:40px; z-index:9999; border:2px solid black; border-radius:10px; background-color:white; background-image:url(\''+TPTPR_Overlays[this.id].url+'\'), url(\''+texturePack.balls+'\'); background-position:0px 0px, -'+texturePosition+'px 0"></div>');
  962. } else {
  963. $('#'+this.id).children('input').after('<div id="TPTPR_OverlayPreview" style="position:absolute; margin-top:2px; width:80px; height:40px; z-index:9999; border:2px solid black; border-radius:10px; background-color:white; background-image:url(\''+TPTPR_Overlays[this.id].url+'\'), url(\''+texturePack.tiles+'\'); background-position:0px 0px, -560px 0"></div>');
  964. }
  965. $('#'+this.id).css('color', 'firebrick');
  966. }, function() {
  967. $('#TPTPR_OverlayPreview').remove();
  968. $('#'+this.id).css('color', '');
  969. });
  970.  
  971. $('#TPTPR_SpinOverlay').on('click', function() {
  972. GM_setValue('TPTPR_SpinOverlay', $(this).is(':checked'));
  973. confirmText('Spin Overlay: ' + ($(this).is(':checked') ? 'Enabled' : 'Disabled'));
  974. });
  975.  
  976.  
  977. // Drag/Drop events...
  978. $(document).on('dragover', function(e) {
  979. e.stopPropagation();
  980. e.preventDefault();
  981. $('#TPTPR_DropZone_Outer').css({border:'2px dotted red'});
  982. }).on('dragleave', function(e) {
  983. e.stopPropagation();
  984. e.preventDefault();
  985. $('#TPTPR_DropZone_Outer').css({border:'2px dotted silver'});
  986. });
  987.  
  988. var timeoutHandle=0, lastEnter;
  989. $('#TPTPR_Left_Inner .TPTPR_TextureButton, #TPTPR_TextureButton_wallpaper, #TPTPR_TextureButton_wallpaperingame').on('dragover', function(e) {
  990. e.stopPropagation();
  991. e.preventDefault();
  992. $(this).css({background:'darkolivegreen'});
  993. $('#TPTPR_DropZone_Outer').css({border:'2px dotted red'});
  994. var that = this;
  995. if (lastEnter !== e.target) {
  996. lastEnter = e.target;
  997. clearTimeout(timeoutHandle);
  998. timeoutHandle = setTimeout(function() {
  999. $(that).trigger('click');
  1000. }, 600);
  1001. }
  1002. }).on('dragleave', function(e) {
  1003. e.stopPropagation();
  1004. e.preventDefault();
  1005. $(this).css({background:'#444'});
  1006. }).on('drop', function(e) {
  1007. e.stopPropagation();
  1008. e.preventDefault();
  1009. $(this).css({background:'#444'});
  1010. $('#TPTPR_DropZone_Outer').css({border:'2px dotted silver'});
  1011. $(this).trigger('click');
  1012. handleDrop(e);
  1013. });
  1014.  
  1015. $('#TPTPR_DropZone_Outer').on('dragover', function(e) {
  1016. e.stopPropagation();
  1017. e.preventDefault();
  1018. if (lastEnter !== e.target) {
  1019. lastEnter = e.target;
  1020. clearTimeout(timeoutHandle);
  1021. }
  1022. $(this).css({background:'green', opacity:0.3});
  1023. }).on('dragleave', function(e) {
  1024. e.stopPropagation();
  1025. e.preventDefault();
  1026. $(this).css({background:'', opacity:1});
  1027. }).on('drop', function(e) {
  1028. e.stopPropagation();
  1029. e.preventDefault();
  1030. $(this).css({border:'2px dotted silver', background:'', opacity:1});
  1031. handleDrop(e);
  1032. }).on('dblclick', function(e) {
  1033. e.stopPropagation();
  1034. e.preventDefault();
  1035. var confirmVanilla = confirm('Reset ' + imageFriendly + ' to Vanilla/Defaults?');
  1036. if (confirmVanilla) {
  1037. if ((image === 'wallpaper') || (image === 'wallpaperingame')) {
  1038. var confirmImageOrGray = confirm("OK - Tagpro Image Background\n\nCancel - Black");
  1039. if (confirmImageOrGray) {
  1040. setTexture(image, "/images/background.jpg");
  1041. //$('html').css('background', "url('/images/background.jpg') no-repeat fixed center").css('background-size', (GM_getValue('TPTPR_StretchWallpaper', true) ? 'cover' : 'contain'));
  1042. confirmText(imageFriendly + ' Set To Default');
  1043. } else {
  1044. setTexture(image, "#000000");
  1045. //$('html').css('background', "#000000");
  1046. confirmText(imageFriendly + ' Set To Black');
  1047. }
  1048. } else {
  1049. setTexture(image, "/images/"+image+".png");
  1050. confirmText('Texture Set To Default', imageFriendly);
  1051. }
  1052. }
  1053. });
  1054.  
  1055. // Select the tiles button...
  1056. $('#TPTPR_TextureButton_tiles').trigger('click');
  1057. }
  1058. });
  1059.  
  1060.  
  1061. /*==================================================================================================================================================================*/
  1062. function setObjects() {
  1063. TPTPR_Packs = {
  1064. 'vanilla': { displayname:'Vanilla', author:'TagPro Defaults', url:{tiles:'/images/tiles.png',
  1065. speedpad:'/images/speedpad.png',
  1066. speedpadred:'/images/speedpadred.png',
  1067. speedpadblue:'/images/speedpadblue.png',
  1068. splats:'/images/splats.png',
  1069. portal:'/images/portal.png'} },
  1070. 'mydnd': { displayname:'My Drag and Dropped', author:'Me!', url:{tiles:'',
  1071. speedpad:'',
  1072. speedpadred:'',
  1073. speedpadblue:'',
  1074. splats:'',
  1075. portal:''} },
  1076.  
  1077. 'aaron215': { displayname:'Aaron215', author:'Aaron215', url:{tiles:'http://i.imgur.com/pHTyBeO.png',
  1078. speedpad:'http://i.imgur.com/p7yauSo.png',
  1079. speedpadred:'http://i.imgur.com/1pq6LLP.png',
  1080. speedpadblue:'http://i.imgur.com/KbRQdOb.png',
  1081. splats:'http://i.imgur.com/tDsbgPv.png',
  1082. portal:'http://i.imgur.com/K0PQHJ6.png'} },
  1083. 'briochelight': { displayname:'Brioche Light', author:'brioche', url:{tiles:'http://i.imgur.com/WDLyCrr.png',
  1084. speedpad:'http://i.imgur.com/wtpkZWw.png',
  1085. speedpadred:'http://i.imgur.com/l6OMel5.png',
  1086. speedpadblue:'http://i.imgur.com/IAAOkQz.png',
  1087. splats:'http://i.imgur.com/kbkOC6x.png',
  1088. portal:'http://i.imgur.com/CXgNNTs.png'} },
  1089. 'camspp_lh': { displayname:'Cam\'sPP Light', author:'StrayCam', url:{tiles:'http://i.imgur.com/22NGRaG.png',
  1090. speedpad:'http://i.imgur.com/4N7Moqk.png',
  1091. speedpadred:'http://i.imgur.com/z4H9yVL.png',
  1092. speedpadblue:'http://i.imgur.com/L9AvmXe.png',
  1093. splats:'http://i.imgur.com/pJ3HlcS.png',
  1094. portal:'http://i.imgur.com/a0JUw8q.png'} },
  1095. 'camspp_dsh': { displayname:'Cam\'sPP Dark Sniper Horizontal', author:'StrayCam', url:{tiles:'http://i.imgur.com/2B8Vaux.png',
  1096. speedpad:'http://i.imgur.com/lVixtut.png',
  1097. speedpadred:'http://i.imgur.com/7Fe8iFB.png',
  1098. speedpadblue:'http://i.imgur.com/kU7LnOW.png',
  1099. splats:'http://i.imgur.com/pJ3HlcS.png',
  1100. portal:'http://i.imgur.com/mp79U9E.png'} },
  1101. 'camspp_lsd': { displayname:'Cam\'sPP Light Sniper Diagonal', author:'StrayCam', url:{tiles:'http://i.imgur.com/bhFWbNW.png',
  1102. speedpad:'http://i.imgur.com/22eydBT.png',
  1103. speedpadred:'http://i.imgur.com/mdS1Ex7.png',
  1104. speedpadblue:'http://i.imgur.com/oWxNfsx.png',
  1105. splats:'http://i.imgur.com/pJ3HlcS.png',
  1106. portal:'http://i.imgur.com/mp79U9E.png'} },
  1107. 'cmyk': { displayname:'cMYK', author:'MagicPigeon', url:{tiles:'http://i.imgur.com/v9VK5Oq.png',
  1108. speedpad:'http://i.imgur.com/5SFGnrT.png',
  1109. speedpadred:'http://i.imgur.com/qcgBVls.png',
  1110. speedpadblue:'http://i.imgur.com/nKExBLD.png',
  1111. splats:'http://i.imgur.com/7yhZMNT.png',
  1112. portal:'http://i.imgur.com/DTGpCj1.png'} },
  1113. 'crystal': { displayname:'Crystal', author:'MagicPigeon', url:{tiles:'http://i.imgur.com/ixFW9oE.png',
  1114. speedpad:'http://i.imgur.com/VZKNMH1.png',
  1115. speedpadred:'http://i.imgur.com/VsGp8i1.png',
  1116. speedpadblue:'http://i.imgur.com/EQn1E5s.png',
  1117. splats:'http://i.imgur.com/mtH38yR.png',
  1118. portal:'http://i.imgur.com/70X2UY4.png'} },
  1119. 'derezzed': { displayname:'Derezzed', author:'-salt-', url:{tiles:'http://i.imgur.com/H9qQUAW.png',
  1120. speedpad:'http://i.imgur.com/BXtUHQG.png',
  1121. speedpadred:'http://i.imgur.com/G92Af0J.png',
  1122. speedpadblue:'http://i.imgur.com/R9FAvpp.png',
  1123. splats:'http://i.imgur.com/WXHAA3I.png',
  1124. portal:'http://i.imgur.com/vJDZam9.png'} },
  1125. 'electric': { displayname:'Electric', author:'Bug', url:{tiles:'http://i.imgur.com/iFeKuuV.png',
  1126. speedpad:'http://i.imgur.com/XrVvThx.png',
  1127. speedpadred:'http://i.imgur.com/GLHA3R8.png',
  1128. speedpadblue:'http://i.imgur.com/UcFhoVC.png',
  1129. splats:'http://i.imgur.com/wxJ2ImS.png',
  1130. portal:'http://i.imgur.com/GqZyi5s.png'} },
  1131. 'elementplus': { displayname:'Element+', author:'MagicPigeon', url:{tiles:'http://i.imgur.com/GAGacLn.png',
  1132. speedpad:'http://i.imgur.com/KkQKHLo.png',
  1133. speedpadred:'http://i.imgur.com/we2eBpa.png',
  1134. speedpadblue:'http://i.imgur.com/TKaRnU8.png',
  1135. splats:'http://i.imgur.com/Lzg8j80.png',
  1136. portal:'http://i.imgur.com/FlPW49l.png'} },
  1137. 'flat': { displayname:'Flat', author:'Bug', url:{tiles:'http://i.imgur.com/YC4vQM4.png',
  1138. speedpad:'http://i.imgur.com/UoHGwMS.png',
  1139. speedpadred:'http://i.imgur.com/CWrsplK.png',
  1140. speedpadblue:'http://i.imgur.com/8WrsT4f.png',
  1141. splats:'http://i.imgur.com/AYO8rbQ.png',
  1142. portal:'http://i.imgur.com/TYWr2Pu.png'} },
  1143. 'funhouse': { displayname:'Funhouse', author:'Sunna', url:{tiles:'http://i.imgur.com/eJebHd6.png',
  1144. speedpad:'http://i.imgur.com/pv0jGMF.png',
  1145. speedpadred:'http://i.imgur.com/7DibrCL.png',
  1146. speedpadblue:'http://i.imgur.com/syjTZuf.png',
  1147. splats:'http://i.imgur.com/KJ8hdEc.png',
  1148. portal:'http://i.imgur.com/4lmhtGF.png'} },
  1149. 'kindergarten': { displayname:'Kindergarten', author:'Clydas', url:{tiles:'http://i.imgur.com/y3tbmOS.png',
  1150. speedpad:'http://i.imgur.com/UEpX1wb.png',
  1151. speedpadred:'http://i.imgur.com/tUC9CMG.png',
  1152. speedpadblue:'http://i.imgur.com/5yA3IOx.png',
  1153. splats:'http://i.imgur.com/ZGSTp2s.png',
  1154. portal:'http://i.imgur.com/6Lbd9Aw.png'} },
  1155. 'minima': { displayname:'Minima', author:'Canvas', url:{tiles:'http://i.imgur.com/jGAtqcr.png',
  1156. speedpad:'http://i.imgur.com/pJEZKnh.png',
  1157. speedpadred:'http://i.imgur.com/OlDPpdM.png',
  1158. speedpadblue:'http://i.imgur.com/HgmJ9yg.png',
  1159. splats:'http://i.imgur.com/ytIIuQS.png',
  1160. portal:'http://i.imgur.com/DeevRGe.png'} },
  1161. 'modern': { displayname:'Modern', author:'Mitzimoto', url:{tiles:'http://i.imgur.com/stGySx9.png',
  1162. speedpad:'http://i.imgur.com/aCHBxVO.png',
  1163. speedpadred:'http://i.imgur.com/xKupyqI.png',
  1164. speedpadblue:'http://i.imgur.com/4dybmaE.png',
  1165. splats:'http://i.imgur.com/gXpvWEE.png',
  1166. portal:'http://i.imgur.com/KAo7jkl.png'} },
  1167. 'mtbad': { displayname:'MTBad', author:'mtbkr24', url:{tiles:'http://i.imgur.com/YnJ9THs.png',
  1168. speedpad:'http://i.imgur.com/Lgiwb5Q.png',
  1169. speedpadred:'http://i.imgur.com/XuN3NbB.png',
  1170. speedpadblue:'http://i.imgur.com/5JKeYSQ.png',
  1171. splats:'http://i.imgur.com/yL2TZJS.png',
  1172. portal:'http://i.imgur.com/xJe0hBy.png'} },
  1173. 'musclecups': { displayname:'Muscle\'s Cup', author:'Muscle Cups', url:{tiles:'http://i.imgur.com/Px8cdyU.png',
  1174. speedpad:'http://i.imgur.com/FjdVdQG.png',
  1175. speedpadred:'http://i.imgur.com/MtTupDg.png',
  1176. speedpadblue:'http://i.imgur.com/FZNnJZf.png',
  1177. splats:'http://i.imgur.com/3m8yX7z.png',
  1178. portal:'http://i.imgur.com/RQXDv00.png'} },
  1179. 'nilla': { displayname:'Nilla', author:'Dotsarecool', url:{tiles:'http://i.imgur.com/Tdwjnkn.png',
  1180. speedpad:'http://i.imgur.com/bawbyQm.png',
  1181. speedpadred:'http://i.imgur.com/tDxnPWm.png',
  1182. speedpadblue:'http://i.imgur.com/NQaEKB0.png',
  1183. splats:'http://i.imgur.com/kHUlTwP.png',
  1184. portal:'http://i.imgur.com/v8aO03S.png'} },
  1185. 'pastelpro': { displayname:'Pastel Pro', author:'BMO', url:{tiles:'http://i.imgur.com/22ehddn.png',
  1186. speedpad:'http://i.imgur.com/r7beMZp.png',
  1187. speedpadred:'http://i.imgur.com/xAHMOOV.png',
  1188. speedpadblue:'http://i.imgur.com/R1TGL5x.png',
  1189. splats:'http://i.imgur.com/NKBd7nE.png',
  1190. portal:'http://i.imgur.com/GbdQNJJ.png'} },
  1191. 'seaweedrb': { displayname:'Seaweed Red/Blue', author:'Borgen', url:{tiles:'http://i.imgur.com/e4UjsQs.png',
  1192. speedpad:'http://i.imgur.com/ONxlcFL.png',
  1193. speedpadred:'http://i.imgur.com/DwUHM2I.png',
  1194. speedpadblue:'http://i.imgur.com/DpJS96w.png',
  1195. splats:'http://i.imgur.com/ZrimG2x.png',
  1196. portal:'http://i.imgur.com/44fPSBq.png'} },
  1197. 'sleek': { displayname:'Sleek', author:'DaEvil1', url:{tiles:'http://i.imgur.com/1zgobTs.png',
  1198. speedpad:'http://i.imgur.com/zI4SzAE.png',
  1199. speedpadred:'http://i.imgur.com/8Ucws0m.png',
  1200. speedpadblue:'http://i.imgur.com/VDIrsng.png',
  1201. splats:'http://i.imgur.com/AlkZRug.png',
  1202. portal:'http://i.imgur.com/1RRAMHe.png'} },
  1203. 'starwars': { displayname:'Star Wars', author:'Moosen', url:{tiles:'http://i.imgur.com/lxV0cnH.png',
  1204. speedpad:'http://i.imgur.com/WgeuDEz.png',
  1205. speedpadred:'http://i.imgur.com/cqY1LTe.png',
  1206. speedpadblue:'http://i.imgur.com/bCUoqXq.png',
  1207. splats:'http://i.imgur.com/XIndyGS.png',
  1208. portal:'http://i.imgur.com/FtLHfuz.png'} },
  1209. 'suave': { displayname:'Suave', author:'fxu', url:{tiles:'http://i.imgur.com/Lz0Kbua.png',
  1210. speedpad:'http://i.imgur.com/Hh2PIwl.png',
  1211. speedpadred:'http://i.imgur.com/Ps5E70J.png',
  1212. speedpadblue:'http://i.imgur.com/OsjYgED.png',
  1213. splats:'http://i.imgur.com/BTjNBz3.png',
  1214. portal:'http://i.imgur.com/siMVwoM.png'} },
  1215. 'tranquilitydark': { displayname:'Tranquility Dark', author:'R e t r o', url:{tiles:'http://i.imgur.com/WyfRfld.png',
  1216. speedpad:'http://i.imgur.com/tZE7l6b.png',
  1217. speedpadred:'http://i.imgur.com/AGMgt6S.png',
  1218. speedpadblue:'http://i.imgur.com/nokGBIr.png',
  1219. splats:'http://i.imgur.com/tDsbgPv.png',
  1220. portal:'http://i.imgur.com/gFC1dUu.png'} },
  1221. 'tranquilitylight': { displayname:'Tranquility Light', author:'R e t r o', url:{tiles:'http://i.imgur.com/cM7dUPy.png',
  1222. speedpad:'http://i.imgur.com/qhr6Z6b.png',
  1223. speedpadred:'http://i.imgur.com/cVyjSvA.png',
  1224. speedpadblue:'http://i.imgur.com/ZqlxWI5.png',
  1225. splats:'http://i.imgur.com/ay5FAXS.png',
  1226. portal:'http://i.imgur.com/ZvBGaJF.png'} },
  1227. 'ultrasmooth': { displayname:'Ultra Smooth', author:'Professor Tag', url:{tiles:'http://i.imgur.com/zltfpGb.png',
  1228. speedpad:'http://i.imgur.com/zxubWbQ.png',
  1229. speedpadred:'http://i.imgur.com/yJGhLPt.png',
  1230. speedpadblue:'http://i.imgur.com/K02G9jE.png',
  1231. splats:'http://i.imgur.com/tDsbgPv.png',
  1232. portal:'http://i.imgur.com/hffUZ2J.png'} },
  1233. 'vortex': { displayname:'Vortex', author:'MagicPigeon', url:{tiles:'http://i.imgur.com/jlbr0Gr.png',
  1234. speedpad:'http://i.imgur.com/hL1YlFu.png',
  1235. speedpadred:'http://i.imgur.com/gxQeYTw.png',
  1236. speedpadblue:'http://i.imgur.com/pbXh4b1.png',
  1237. splats:'http://i.imgur.com/36fUJG2.png',
  1238. portal:'http://i.imgur.com/H1cHH5w.png'} },
  1239. };
  1240. /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
  1241. TPTPR_Overlays = {
  1242. 'none': { displayname:'None', url:false },
  1243. 'poker': { displayname:'Poker Chip', url:'http://i.imgur.com/SRTdwMB.png' },
  1244. 'quads': { displayname:'Quads', url:'http://i.imgur.com/Y4VyHp3.png' },
  1245. 'marble': { displayname:'Marble', url:'http://i.imgur.com/yT42PHy.png' }, //Professor Tag
  1246. 'whitedot': { displayname:'White Dot', url:'http://i.imgur.com/YOo6Zkx.png' },
  1247. 'crosshair': { displayname:'Crosshair', url:'http://i.imgur.com/WO4hzVF.png' },
  1248. 'darkring': { displayname:'Dark Ring', url:'http://i.imgur.com/A746foc.png' },
  1249. 'innerstar': { displayname:'Inner Star', url:'http://i.imgur.com/Xs1lsOH.png' },
  1250. 'sombrero': { displayname:'Sombrero', url:'http://i.imgur.com/LqcPOIr.png' },
  1251. 'sunglasses': { displayname:'Shades', url:'http://i.imgur.com/xbGNFU7.png' },
  1252. };
  1253. /*==================================================================================================================================================================*/
  1254. }
Add Comment
Please, Sign In to add comment