Fix Residence support in updated UI

This commit is contained in:
Mike Primm 2011-07-27 22:42:55 -05:00
parent 08192df906
commit d483eb1e6f
3 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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() {

View File

@ -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);