TfT Map Tweak

For Transformania Time multplayer edition. Starts the enchantment map view closer to the center of town. Starts the standard map centered on the player's location.

  1. // ==UserScript==
  2. // @name TfT Map Tweak
  3. // @namespace http://steamcommunity.com/id/siggo/
  4. // @version 1.0.2
  5. // @description For Transformania Time multplayer edition. Starts the enchantment map view closer to the center of town. Starts the standard map centered on the player's location.
  6. // @author Prios
  7. // @match https://www.transformaniatime.com/pvp/worldmap?showEnchant=*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. var thisURL = window.location.href;
  16. var enchantmentMapOffset = 0;
  17.  
  18. if ( thisURL === 'https://www.transformaniatime.com/pvp/worldmap?showEnchant=true' ) {
  19. $( '.mapcell' )
  20. [enchantmentMapOffset].scrollIntoView({behavior:'smooth', block:'center', inline:'center'})
  21. ;
  22. }
  23. else if ( thisURL === 'https://www.transformaniatime.com/pvp/worldmap?showEnchant=false' ) {
  24. $( '[style*="lightpink"]' )
  25. [0].scrollIntoView({behavior:'smooth', block:'center', inline:'center'})
  26. ;
  27. }
  28.  
  29. })();