Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     window.plugin.uniquesextra.highlighterJasperUnvisited2 = {
  2.         highlight: function(data) {
  3.             var guid = data.portal.options.ent[0];
  4.             var uniqueInfo = window.plugin.uniques.uniques[guid];
  5.             var ownteam = 0;
  6.             if (PLAYER.team == 'RESISTANCE') ownteam = 1; else ownteam = 2;
  7.  
  8.             var style = {};
  9.  
  10.             if (uniqueInfo) {
  11.                 if (uniqueInfo.captured) {
  12.                     // captured (and, implied, visited too) - no highlights
  13.                     style.opacity = 0.1;
  14.                     style.fillOpacity = 0.1;
  15.                 } else if (uniqueInfo.visited){
  16.                     if (data.portal.options.team == ownteam){
  17.                         style.fillColor = 'gold';
  18.                         style.opacity = 0.3;
  19.                         style.fillOpacity = 0.3;
  20.                     } else {
  21.                         style.fillColor = 'yellow';
  22.                         style.opacity = 0.8;
  23.                         style.fillOpacity = 0.8;
  24.                     }
  25.                 } else {
  26.                     // we have an 'uniqueInfo' entry for the portal, but it's not set visited or captured?
  27.                     // could be used to flag a portal you don't plan to visit, so use a less opaque red
  28.                     style.fillColor = 'red';
  29.                     style.fillOpacity = 0.6;
  30.                 }
  31.             } else {
  32.                 // no visit data at all
  33.                 if (data.portal.options.team == ownteam){
  34.                     style.fillColor = 'purple';
  35.                     style.fillOpacity = 0.5;
  36.                 } else { // own team
  37.                     style.fillColor = 'red';
  38.                     style.fillOpacity = 0.8;
  39.                 }
  40.             }
  41.  
  42.             data.portal.setStyle(style);
  43.         },
  44.  
  45.         setSelected: function(active) {
  46.             window.plugin.uniques.isHighlightActive = active;
  47.         }
  48.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement