From ea3c331296d67d1589bfe732e1f8674f12693ef2 Mon Sep 17 00:00:00 2001 From: vita10gy Date: Sat, 30 Mar 2013 21:18:37 -0500 Subject: [PATCH] Player Tracker: Use the portal name from chat Uses the portal name function from the chat listing, which, for now, renames the US Post Office portals so it doesn't look like. 20m ago US Post Office 25m ago Some portal 35m ago US Post Office 55m ago US Post Office --- plugins/player-tracker.user.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index aa83b204..253e9261 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -112,7 +112,7 @@ window.plugin.playerTracker.processNewData = function(data) { if(json[1] < limit) return true; // find player and portal information - var pguid, lat, lng, guid, name; + var pguid, lat, lng, guid, name, address; var skipThisMessage = false; $.each(json[2].plext.markup, function(ind, markup) { switch(markup[0]) { @@ -137,6 +137,7 @@ window.plugin.playerTracker.processNewData = function(data) { lng = lng ? lng : markup[1].lngE6/1E6; guid = guid ? guid : markup[1].guid; name = name ? name : markup[1].name; + address = address ? address : markup[1].address; break; } }); @@ -148,7 +149,8 @@ window.plugin.playerTracker.processNewData = function(data) { latlngs: [[lat, lng]], guids: [guid], time: json[1], - name: name + name: name, + address: address }; var playerData = window.plugin.playerTracker.stored[pguid]; @@ -272,14 +274,14 @@ window.plugin.playerTracker.drawData = function() { title += '\n' + ago(last.time, now) + ' ago\n' - + last.name; + + window.chat.getChatPortalName(last); // show previous data in tooltip var minsAgo = '\t ago\t'; if(evtsLength >= 2) title += '\n \nprevious locations:\n'; for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) { var ev = playerData.events[i]; - title += ago(ev.time, now) + minsAgo + ev.name + '\n'; + title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '\n'; } // calculate the closest portal to the player