Renamed plugin, and and only highlights where effective deployment distance is less than 36m.

This commit is contained in:
Catherine
2013-08-13 18:44:18 +01:00
parent a574a1fa75
commit 11dec6aeab

View File

@ -0,0 +1,48 @@
// ==UserScript==
// @id iitc-plugin-highlight-bad-deployment-distance@cathesaurus
// @name IITC plugin: highlight badly-deployed portals
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to show the effective resonator deployment range, where that average is less than 36 metres
// @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.portalHighlighterBadDeploymentDistance = function() {};
window.plugin.portalHighlighterBadDeploymentDistance.highlight = function(data) {
var d = data.portal.options.details;
var portal_deployment = 0;
var acceptable_deployment_average = 36;
if(getTeam(d) !== 0) {
if(window.getAvgResoDist(d) > 0 && window.getAvgResoDist(d) < acceptable_deployment_average) {
portal_deployment = (window.HACK_RANGE - window.getAvgResoDist(d))/window.HACK_RANGE;
}
if(portal_deployment > 0) {
var fill_opacity = portal_deployment*.85 + .15;
color = 'red';
var params = {fillColor: color, fillOpacity: fill_opacity};
data.portal.setStyle(params);
}
}
window.COLOR_SELECTED_PORTAL = '#f0f';
}
var setup = function() {
window.addPortalHighlighter('Bad Deployment Distance', window.plugin.portalHighlighterBadDeploymentDistance.highlight);
}
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@