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.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         TfT Map Tweak
// @namespace	 http://steamcommunity.com/id/siggo/
// @version      1.0.2
// @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.
// @author       Prios
// @match        https://www.transformaniatime.com/pvp/worldmap?showEnchant=*
// @grant        none
// @license		 MIT
// ==/UserScript==

(function() {
    'use strict';

	var thisURL = window.location.href;
	var enchantmentMapOffset = 0;

	if ( thisURL === 'https://www.transformaniatime.com/pvp/worldmap?showEnchant=true' ) {
        $( '.mapcell' )
			[enchantmentMapOffset].scrollIntoView({behavior:'smooth', block:'center', inline:'center'})
		;
	}
	else if ( thisURL === 'https://www.transformaniatime.com/pvp/worldmap?showEnchant=false' ) {
		$( '[style*="lightpink"]' )
			[0].scrollIntoView({behavior:'smooth', block:'center', inline:'center'})
		;
	}

})();