new highlighter: highlight just L6/7/8 portals, on orange/red/purple
better than proper level colours for easily spotting the higher level portals
This commit is contained in:
parent
9f3869fff8
commit
f69038cd06
46
plugins/portal-highlighter-high-level.user.js
Normal file
46
plugins/portal-highlighter-high-level.user.js
Normal file
@ -0,0 +1,46 @@
|
||||
// ==UserScript==
|
||||
// @id iitc-plugin-highlight-portals-high-level
|
||||
// @name IITC plugin: highlight high level portals
|
||||
// @category Highlighter
|
||||
// @version 0.1.0.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Use the portal fill color to denote high level portals: Purple L8, Red L7, Orange L6
|
||||
// @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.portalHighligherPortalsHighLevel = function() {};
|
||||
|
||||
window.plugin.portalHighligherPortalsHighLevel.colorLevel = function(data) {
|
||||
var portal_level = data.portal.options.data.level;
|
||||
var opacity = 0.7;
|
||||
var color = undefined;
|
||||
|
||||
switch (portal_level) {
|
||||
case 6: color='orange'; break;
|
||||
case 7: color='red'; break;
|
||||
case 8: color='magenta'; break;
|
||||
}
|
||||
|
||||
if (color) {
|
||||
data.portal.setStyle({fillColor: color, fillOpacity: opacity});
|
||||
}
|
||||
}
|
||||
|
||||
var setup = function() {
|
||||
window.addPortalHighlighter('Higher Level Portals', window.plugin.portalHighligherPortalsHighLevel.colorLevel);
|
||||
}
|
||||
|
||||
// PLUGIN END //////////////////////////////////////////////////////////
|
||||
|
||||
@@PLUGINEND@@
|
Loading…
x
Reference in New Issue
Block a user