s/Highligher/Highlighter/

This commit is contained in:
nexushoratio
2014-01-05 22:30:54 -08:00
parent f038693403
commit cefbf95c85
15 changed files with 107 additions and 107 deletions

View File

@ -19,31 +19,31 @@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.portalHighligherPortalAPRelative = function() {};
window.plugin.portalHighlighterPortalAPRelative = function() {};
window.plugin.portalHighligherPortalAPRelative.minAP = null;
window.plugin.portalHighligherPortalAPRelative.maxAP = null;
window.plugin.portalHighlighterPortalAPRelative.minAP = null;
window.plugin.portalHighlighterPortalAPRelative.maxAP = null;
//This is the AP for a run of the mill takedown/putback
window.plugin.portalHighligherPortalAPRelative.baseSwapAP = 2350;
window.plugin.portalHighlighterPortalAPRelative.baseSwapAP = 2350;
window.plugin.portalHighligherPortalAPRelative.highlight = function(data) {
window.plugin.portalHighlighterPortalAPRelative.highlight = function(data) {
var d = data.portal.options.details;
var color = 'red';
if(window.plugin.portalHighligherPortalAPRelative.minAP == null ||
window.plugin.portalHighligherPortalAPRelative.maxAP == null) {
window.plugin.portalHighligherPortalAPRelative.calculateAPLevels();
if(window.plugin.portalHighlighterPortalAPRelative.minAP == null ||
window.plugin.portalHighlighterPortalAPRelative.maxAP == null) {
window.plugin.portalHighlighterPortalAPRelative.calculateAPLevels();
}
var minAp = window.plugin.portalHighligherPortalAPRelative.minAP;
var maxAp = window.plugin.portalHighligherPortalAPRelative.maxAP;
var minAp = window.plugin.portalHighlighterPortalAPRelative.minAP;
var maxAp = window.plugin.portalHighlighterPortalAPRelative.maxAP;
var ap = getAttackApGain(d);
var portal_ap = ap.friendlyAp;
if(PLAYER.team !== d.controllingTeam.team) {
portal_ap = ap.enemyAp;
if(portal_ap === window.plugin.portalHighligherPortalAPRelative.baseSwapAP) {
if(portal_ap === window.plugin.portalHighlighterPortalAPRelative.baseSwapAP) {
color = 'orange';
}
}
@ -62,12 +62,12 @@ window.plugin.portalHighligherPortalAPRelative.highlight = function(data) {
data.portal.setStyle({fillColor: color, fillOpacity: opacity});
}
window.plugin.portalHighligherPortalAPRelative.resetAPLevels = function() {
window.plugin.portalHighligherPortalAPRelative.minAP = null;
window.plugin.portalHighligherPortalAPRelative.maxAP = null;
window.plugin.portalHighlighterPortalAPRelative.resetAPLevels = function() {
window.plugin.portalHighlighterPortalAPRelative.minAP = null;
window.plugin.portalHighlighterPortalAPRelative.maxAP = null;
}
window.plugin.portalHighligherPortalAPRelative.calculateAPLevels = function() {
window.plugin.portalHighlighterPortalAPRelative.calculateAPLevels = function() {
var displayBounds = map.getBounds();
$.each(window.portals, function(qk, portal) {
if(displayBounds.contains(portal.getLatLng())) {
@ -76,21 +76,21 @@ window.plugin.portalHighligherPortalAPRelative.calculateAPLevels = function() {
if(PLAYER.team !== portal.options.details.controllingTeam.team) {
portal_ap = ap.enemyAp;
}
if(window.plugin.portalHighligherPortalAPRelative.minAP === null ||
portal_ap < window.plugin.portalHighligherPortalAPRelative.minAP) {
window.plugin.portalHighligherPortalAPRelative.minAP = portal_ap;
if(window.plugin.portalHighlighterPortalAPRelative.minAP === null ||
portal_ap < window.plugin.portalHighlighterPortalAPRelative.minAP) {
window.plugin.portalHighlighterPortalAPRelative.minAP = portal_ap;
}
if(window.plugin.portalHighligherPortalAPRelative.maxAP === null ||
portal_ap > window.plugin.portalHighligherPortalAPRelative.maxAP) {
window.plugin.portalHighligherPortalAPRelative.maxAP = portal_ap;
if(window.plugin.portalHighlighterPortalAPRelative.maxAP === null ||
portal_ap > window.plugin.portalHighlighterPortalAPRelative.maxAP) {
window.plugin.portalHighlighterPortalAPRelative.maxAP = portal_ap;
}
}
});
}
var setup = function() {
window.addPortalHighlighter('AP (Relative)', window.plugin.portalHighligherPortalAPRelative.highlight);
window.addHook('requestFinished', window.plugin.portalHighligherPortalAPRelative.resetAPLevels);
window.addPortalHighlighter('AP (Relative)', window.plugin.portalHighlighterPortalAPRelative.highlight);
window.addHook('requestFinished', window.plugin.portalHighlighterPortalAPRelative.resetAPLevels);
}