mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-13 05:54:40 +01:00
Add 'followmap' and 'followzoom' to allow setting of map and zoom when starting to follow a player
This commit is contained in:
parent
204b54155a
commit
a5bc33e1e9
@ -55,6 +55,10 @@ public class ClientConfigurationComponent extends Component {
|
||||
}
|
||||
s(t, "defaultworld", c.getString("defaultworld", defaultWorld == null ? "world" : defaultWorld.world.getName()));
|
||||
s(t, "defaultmap", c.getString("defaultmap", defmap == null ? "surface" : defmap));
|
||||
if(c.getString("followmap", null) != null)
|
||||
s(t, "followmap", c.getString("followmap"));
|
||||
if(c.getInteger("followzoom",-1) >= 0)
|
||||
s(t, "followzoom", c.getInteger("followzoom", 0));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -277,6 +277,9 @@ check-banned-ips: true
|
||||
defaultzoom: 0
|
||||
defaultworld: world
|
||||
defaultmap: flat
|
||||
# (optional) Zoom level and map to switch to when following a player, if possible
|
||||
#followzoom: 3
|
||||
#followmap: surface
|
||||
|
||||
# Option to enable workaround for incorrectly encoded unicode in Cyrillic MC/Bukkit (not good for other code pages)
|
||||
cyrillic-support: false
|
||||
|
@ -719,7 +719,15 @@ DynMap.prototype = {
|
||||
|
||||
if(player) {
|
||||
$(player.menuitem).addClass('following');
|
||||
me.panToLocation(player.location);
|
||||
me.panToLocation(player.location, function() {
|
||||
if(me.options.followmap && me.world) {
|
||||
var pmap = me.world.maps[me.options.followmap];
|
||||
if(pmap)
|
||||
me.selectMapAndPan(pmap);
|
||||
}
|
||||
if(me.options.followzoom)
|
||||
me.map.setZoom(me.options.followzoom);
|
||||
});
|
||||
}
|
||||
this.followingPlayer = player;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user