artifacts:

- like the selected portal, are not removed when off screen/below min level
- shard/target details shown on portal details for jarvis shards
This commit is contained in:
Jon Atkins
2013-11-08 06:09:24 +00:00
parent 15537e4e95
commit a595c2f11d
3 changed files with 35 additions and 10 deletions

View File

@ -33,7 +33,8 @@ window.Render.prototype.clearPortalsBelowLevel = function(level) {
var count = 0;
for (var guid in window.portals) {
var p = portals[guid];
if (parseInt(p.options.level) < level && guid !== selectedPortal) {
// clear portals below specified level - unless it's the selected portal, or it's relevant to artifacts
if (parseInt(p.options.level) < level && guid !== selectedPortal && !artifact.isInterestingPortal(guid)) {
this.deletePortalEntity(guid);
count++;
}
@ -46,7 +47,7 @@ window.Render.prototype.clearEntitiesOutsideBounds = function(bounds) {
for (var guid in window.portals) {
var p = portals[guid];
if (!bounds.contains (p.getLatLng()) && guid !== selectedPortal) {
if (!bounds.contains (p.getLatLng()) && guid !== selectedPortal && !artifact.isInterestingPortal(guid)) {
this.deletePortalEntity(guid);
pcount++;
}
@ -128,6 +129,7 @@ window.Render.prototype.endRenderPass = function() {
// check to see if there's eny entities we haven't seen. if so, delete them
for (var guid in window.portals) {
// special case for selected portal - it's kept even if not seen
if (!(guid in this.seenPortalsGuid) && guid !== selectedPortal) {
this.deletePortalEntity(guid);
}
@ -544,7 +546,7 @@ window.Render.prototype.resetPortalClusters = function() {
var guid = c[i];
var p = window.portals[guid];
var layerGroup = portalsFactionLayers[parseInt(p.options.level)][p.options.team];
if (i<this.CLUSTER_PORTAL_LIMIT || p.options.guid == selectedPortal) {
if (i<this.CLUSTER_PORTAL_LIMIT || p.options.guid == selectedPortal || artifact.isInterestingPortal(p.options.guid)) {
if (!layerGroup.hasLayer(p)) {
layerGroup.addLayer(p);
}
@ -570,7 +572,7 @@ window.Render.prototype.addPortalToMapLayer = function(portal) {
// now, at this point, we could match the above re-clustr code - sorting, and adding/removing as necessary
// however, it won't make a lot of visible difference compared to just pushing to the end of the list, then
// adding to the visible layer if the list is below the limit
if (this.portalClusters[cid].length < this.CLUSTER_PORTAL_LIMIT || portal.options.guid == selectedPortal) {
if (this.portalClusters[cid].length < this.CLUSTER_PORTAL_LIMIT || portal.options.guid == selectedPortal || artifact.isInterestingPortal(portal.options.guid)) {
portalsFactionLayers[parseInt(portal.options.level)][portal.options.team].addLayer(portal);
}
}