mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Fix Residence support in updated UI
This commit is contained in:
parent
08192df906
commit
d483eb1e6f
@ -405,7 +405,6 @@ DynMap.prototype = {
|
||||
me.servertime = update.servertime;
|
||||
var newserverday = (me.servertime > 23100 || me.servertime < 12900);
|
||||
if(me.serverday != newserverday) {
|
||||
console.log('serverday changed', newserverday)
|
||||
me.serverday = newserverday;
|
||||
|
||||
me.updateBackground();
|
||||
|
@ -69,6 +69,7 @@ componentconstructors['regions'] = function(dynmap, configuration) {
|
||||
}
|
||||
|
||||
function createPopupContent(name, region) {
|
||||
var members = region.members || {};
|
||||
return $('<div/>').addClass('regioninfo')
|
||||
.append($('<span/>').addClass('regionname').text(name))
|
||||
.append($('<span/>').addClass('owners')
|
||||
@ -76,8 +77,8 @@ componentconstructors['regions'] = function(dynmap, configuration) {
|
||||
.append(region.owners.groups && $('<span/>').addClass('groupowners').text(region.owners.groups.concat()))
|
||||
)
|
||||
.append($('<span/>').addClass('members')
|
||||
.append(region.members.players && $('<span/>').addClass('playermembers').text(region.members.players.concat()))
|
||||
.append(region.members.groups && $('<span/>').addClass('groupmembers').text(region.members.groups.concat()))
|
||||
.append(members.players && $('<span/>').addClass('playermembers').text(members.players.concat()))
|
||||
.append(members.groups && $('<span/>').addClass('groupmembers').text(members.groups.concat()))
|
||||
)
|
||||
.append(region.parent && $('<span/>').addClass('regionparent').text(region.parent))
|
||||
.append(region.flags && function() {
|
||||
|
@ -4,16 +4,16 @@ regionConstructors['Residence'] = function(dynmap, configuration) {
|
||||
return boxCreator(area.X1, area.X2, area.Y1, area.Y2, area.Z1, area.Z2);
|
||||
}
|
||||
|
||||
$.getJSON('standalone/res_' + worldName + '.json', function(data) {
|
||||
$.getJSON('standalone/res_' + configuration.worldName + '.json', function(data) {
|
||||
var boxLayers = [];
|
||||
$.each(data, function(name, residence) {
|
||||
if(worldName == residence.Permissions.World) {
|
||||
if(configuration.worldName == residence.Permissions.World) {
|
||||
$.each(residence.Areas, function(name, area) {
|
||||
var boxLayer = configuration.createBoxLayer(area.X1, area.X2, area.Y1, area.Y2, area.Z1, area.Z2);
|
||||
|
||||
boxLayer.bindPopup(configuration.createPopupContent(name, $.extend(residence, {
|
||||
owners: { players: [residence.Permissions.Owner] },
|
||||
flags: region.Permissions.AreaFlags
|
||||
flags: residence.Permissions.AreaFlags
|
||||
})));
|
||||
|
||||
boxLayers.push(boxLayer);
|
||||
|
Loading…
Reference in New Issue
Block a user