From f0f621acb6f8e14f996daebe8d7a734aab897fd9 Mon Sep 17 00:00:00 2001 From: vita10gy Date: Fri, 12 Apr 2013 23:57:53 -0500 Subject: [PATCH] Style tweak and new highligher --- code/portal_highlighter.js | 3 +- .../portal-highlighter-can-make-level.user.js | 94 +++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 plugins/portal-highlighter-can-make-level.user.js diff --git a/code/portal_highlighter.js b/code/portal_highlighter.js index 9df7d08b..7d79343e 100644 --- a/code/portal_highlighter.js +++ b/code/portal_highlighter.js @@ -31,7 +31,8 @@ window.portalHighlighterControl = function() { }); $("#portal_highlight_select").val(_current_highlighter); $("#portal_highlight_select").change(function(){ changePortalHighlights($(this).val());}); - $(".leaflet-top.leaflet-left").css('margin-top','25px'); + $(".leaflet-top.leaflet-left").css('padding-top','25px'); + $(".leaflet-control-scale-line").css('margin-top','25px'); } } diff --git a/plugins/portal-highlighter-can-make-level.user.js b/plugins/portal-highlighter-can-make-level.user.js new file mode 100644 index 00000000..465260f0 --- /dev/null +++ b/plugins/portal-highlighter-can-make-level.user.js @@ -0,0 +1,94 @@ +// ==UserScript== +// @id iitc-plugin-highlight-portals-upgrade@vita10gy +// @name IITC plugin: highlight portals you can upgrade to a specific level +// @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 highlight portals you can upgrade to a specific level. +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// ==/UserScript== + +function wrapper() { +// ensure plugin framework is there, even if iitc is not yet loaded +if(typeof window.plugin !== 'function') window.plugin = function() {}; + + +// PLUGIN START //////////////////////////////////////////////////////// + +// use own namespace for plugin +window.plugin.portalHighligherPortalsCanMakeLevel = function() {}; + +window.plugin.portalHighligherPortalsCanMakeLevel.highlight = function(data,highlight_level) { + var d = data.portal.options.details; + var current_level = Math.floor(getPortalLevel(d)); + var potential_level = Math.floor(window.potentialPortalLevel(d)); + var opacity = .7; + console.log(current_level + ' ' + potential_level+ ' ' + highlight_level); + if( potential_level > current_level && potential_level === highlight_level) { + color = 'red'; + data.portal.setStyle({fillColor: color, fillOpacity: opacity}); + } else { + data.portal.setStyle({color: COLORS[getTeam(data.portal.options.details)], + fillOpacity: 0.5}); + } + + window.COLOR_SELECTED_PORTAL = '#f0f'; +} + +//determines the level of poral a user can make all on their own +window.plugin.portalHighligherPortalsCanMakeLevel.playerCanSoloLevel = function(lvl) { + var renators_total = 0; + var renators_placed = 0; + var resonator_level = PLAYER.level + while(renators_placed < 8) { + for(var i = 0; i