From a595c2f11d4f75d69e13bf9c7a7372235f2035aa Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 8 Nov 2013 06:09:24 +0000 Subject: [PATCH] artifacts: - like the selected portal, are not removed when off screen/below min level - shard/target details shown on portal details for jarvis shards --- code/artifact.js | 15 +++++++++------ code/map_data_render.js | 10 ++++++---- code/portal_detail_display.js | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/code/artifact.js b/code/artifact.js index 88b899b7..341d2a42 100644 --- a/code/artifact.js +++ b/code/artifact.js @@ -136,16 +136,19 @@ window.artifact.getArtifactEntities = function() { return entities; } +// quick test for portal being relevant to artifacts - of any type +window.artifact.isInterestingPortal = function(guid) { + return guid in artifact.portalInfo; +} + +// get the artifact data for a specified artifact id (e.g. 'jarvis'), if it exists - otherwise returns something 'false'y +window.artifact.getPortalData = function(guid,artifactId) { + return artifact.portalInfo[guid] && artifact.portalInfo[guid][artifactId]; +} window.artifact.updateLayer = function() { artifact._layer.clearLayers(); -// TODO: icons -// //commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard.png -// //commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard_target_0.png -// (replace '0' with count of shards at the target portal) - - $.each(artifact.portalInfo, function(guid,data) { var latlng = L.latLng ([data._entityData.locationE6.latE6/1E6, data._entityData.locationE6.lngE6/1E6]); diff --git a/code/map_data_render.js b/code/map_data_render.js index 85b89b9c..33e2dd3c 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -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'+(jarvisArtifact.target==TEAM_RES?'Resistance':'Enlightened')+'']; + } + if (jarvisArtifact.fragments) { + shards = [jarvisArtifact.fragments.length>1?'shards':'shard', '#'+jarvisArtifact.fragments.join(', #')]; + } + + randDetails.push (target, shards); + } + + randDetails = '' + genFourColumnTable(randDetails) + '
'; var resoDetails = '' + getResonatorDetails(d) + '
';