From 6da6cd22591c03127190f4de1fc0512648e38310 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 28 Sep 2014 04:51:26 +0100 Subject: [PATCH] plugin: highlight 'ornament' portals. makes them easier to see in cluttered areas --- plugins/portal-highlighter-ornaments.user.js | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 plugins/portal-highlighter-ornaments.user.js diff --git a/plugins/portal-highlighter-ornaments.user.js b/plugins/portal-highlighter-ornaments.user.js new file mode 100644 index 00000000..041a09af --- /dev/null +++ b/plugins/portal-highlighter-ornaments.user.js @@ -0,0 +1,43 @@ +// ==UserScript== +// @id iitc-plugin-highlight-ornaments@jonatkins +// @name IITC plugin: hightlight portals with ornaments +// @category Highlighter +// @version 0.0.1.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Use the portal fill color to denote portals with additional 'ornament' markers. e.g. Anomaly portals +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +// use own namespace for plugin +window.plugin.portalHighlightOrnaments = function() {}; + +window.plugin.portalHighlightOrnaments.highlight = function(data) { + var d = data.portal.options.data; + if(d.ornaments && d.ornaments.length > 0) { + var fill_opacity = 0.75; + var color = 'red'; + + // TODO? match specific cases of ornament name and/or portals with multiple ornaments, and highlight in different colours? + + var params = {fillColor: color, fillOpacity: fill_opacity}; + data.portal.setStyle(params); + } +} + +var setup = function() { + window.addPortalHighlighter('Ornaments (anomaly portals)', window.plugin.portalHighlightOrnaments.highlight); +} + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@