From ef158a366f561bcd933ec9797b6ac8c0b8132f5a Mon Sep 17 00:00:00 2001 From: Xelio Date: Mon, 18 Feb 2013 03:23:06 +0800 Subject: [PATCH] New Plugin: Resonator Display Zoom Level Decrease Resonators start showing up in lower zoom level. --- plugins/README.md | 2 + ...onator-display-zoom-level-decrease.user.js | 46 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 plugins/resonator-display-zoom-level-decrease.user.js diff --git a/plugins/README.md b/plugins/README.md index 614a611b..81eaa887 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -13,6 +13,8 @@ Available Plugins - [**Highlight Weakened Portals**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js) fill portals with red to indicate portal's state of disrepair. The brighter the color the more attention needed (recharge, shields, resonators). A dashed portal means a resonator is missing. - [**Draw Tools**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js) allows to draw circles and lines on the map to aid you with planning your next big field. - [**Render Limit Increase**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/render-limit-increase.user.js) increases render limits. Good for high density areas (e.g. London, UK) and faster PCs. +- [**Resonator Display Zoom Level Decrease**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js) Resonators start showing up in lower zoom level. + Hacking ------- diff --git a/plugins/resonator-display-zoom-level-decrease.user.js b/plugins/resonator-display-zoom-level-decrease.user.js new file mode 100644 index 00000000..12f266c7 --- /dev/null +++ b/plugins/resonator-display-zoom-level-decrease.user.js @@ -0,0 +1,46 @@ +// ==UserScript== +// @id iitc-plugin-resonator-display-zoom-level-decrease@xelio +// @name iitc: resonator display zoom level decrease +// @version 1.0 +// @namespace https://github.com/breunigs/ingress-intel-total-conversion +// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js +// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js +// @description Let resonator display in lower zoom level +// @include http://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.resonatorDisplayZoomLevelDecrease = function() {}; + +window.plugin.resonatorDisplayZoomLevelDecrease.changeConstant = function() { + +// Minimum zoom level resonator will display +window.RESONATOR_DISPLAY_ZOOM_LEVEL = 16; +}; + +var setup = window.plugin.resonatorDisplayZoomLevelDecrease.changeConstant; + +// PLUGIN END ////////////////////////////////////////////////////////// + +if(window.iitcLoaded && typeof setup === 'function') { + setup(); +} else { + if(window.bootPlugins) + window.bootPlugins.push(setup); + else + window.bootPlugins = [setup]; +} +} // wrapper end +// inject code into site context +var script = document.createElement('script'); +script.appendChild(document.createTextNode('('+ wrapper +')();')); +(document.body || document.head || document.documentElement).appendChild(script);