don’t remove & re-render portals if nothing changed for them.

This commit is contained in:
Stefan Breunig
2013-02-10 20:50:31 +01:00
parent 2dc8714a63
commit 8c7e63a7f8
2 changed files with 34 additions and 19 deletions

View File

@ -46,3 +46,18 @@ window.resolvePlayerNames = function() {
window.setPlayerName = function(guid, nick) {
localStorage[guid] = nick;
}
window.loadPlayerNamesForPortal = function(portal_details) {
if(map.getZoom() < PRECACHE_PLAYER_NAMES_ZOOM) return;
var e = portal_details;
if(e.captured && e.captured.capturingPlayerId)
getPlayerName(e.captured.capturingPlayerId);
if(!e.resonatorArray || !e.resonatorArray.resonators) return;
$.each(e.resonatorArray.resonators, function(ind, reso) {
if(reso) getPlayerName(reso.ownerGuid);
});
}