Add support in web UI for automatic day/night cycle when night-and-day
set for a given map.
This commit is contained in:
parent
544283a650
commit
c00bd077cb
8 changed files with 64 additions and 6 deletions
|
|
@ -42,18 +42,22 @@ KzedMapType.prototype = $.extend(new DynMapType(), {
|
|||
|
||||
var debugred;
|
||||
var debugblue;
|
||||
|
||||
|
||||
var dnprefix = '';
|
||||
if(this.dynmap.map.mapTypes[this.dynmap.map.mapTypeId].nightandday && this.dynmap.serverday)
|
||||
dnprefix = '_day';
|
||||
|
||||
if (zoom == 0) {
|
||||
// Most zoomed out tiles.
|
||||
tileSize = 128;
|
||||
imgSize = tileSize;
|
||||
tileName = 'z' + this.prefix + '_' + (-coord.x * tileSize*2) + '_' + (coord.y * tileSize*2) + '.png';
|
||||
tileName = 'z' + this.prefix + dnprefix + '_' + (-coord.x * tileSize*2) + '_' + (coord.y * tileSize*2) + '.png';
|
||||
} else {
|
||||
// Other zoom levels.
|
||||
tileSize = 128;
|
||||
|
||||
imgSize = Math.pow(2, 6+zoom);
|
||||
tileName = this.prefix + '_' + (-coord.x*tileSize) + '_' + (coord.y*tileSize) + '.png';
|
||||
tileName = this.prefix + dnprefix + '_' + (-coord.x*tileSize) + '_' + (coord.y*tileSize) + '.png';
|
||||
}
|
||||
var img;
|
||||
var tile = $('<div/>')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue