IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
285 stars 110 forks source link

'Portals Missing Resonators' Plugin: Portals with missing resos hardly distinguishable from portals with 8 resos #590

Closed sndirsch closed 1 year ago

sndirsch commented 2 years ago

Unfortunately with this plugin you can hardly distinguish portals with missing resos from portals filled with 8 resos.

image

The 3 portals on the right side have only one reso. The one on the right side is filled with 8 resos.

This was done way better with the old plugin from https://iitc.me/desktop/

image

sndirsch commented 2 years ago

The above is with current Desktop version IITC-CE v0.33.0 and 'Highlight portals missing resonators' plugin version 0.2.0.

Things look fine with Android Version 0.32.1 for some reason.

image

sndirsch commented 2 years ago

Going back to old code fixes it for me.

0001-highlight-missing-resonators.js-fixes-issue-590.patch.txt

sndirsch commented 2 years ago
From 0e07c62a59aa1372f2715a5fa48a54f878e47041 Mon Sep 17 00:00:00 2001
From: Stefan Dirsch <sndirsch@suse.de>
Date: Mon, 17 Oct 2022 17:08:59 +0200
Subject: [PATCH] highlight-missing-resonators.js: fixes issue #590

Going back to old code fixes the issue for me ...
---
 plugins/highlight-missing-resonators.js | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/plugins/highlight-missing-resonators.js b/plugins/highlight-missing-resonators.js
index 4eabbf94..6fd7583e 100644
--- a/plugins/highlight-missing-resonators.js
+++ b/plugins/highlight-missing-resonators.js
@@ -7,14 +7,6 @@
 /* exported setup --eslint */
 /* global L, TEAM_NONE */
 // use own namespace for plugin
-var highlightMissingResonators = {};
-window.plugin.highlightMissingResonators = highlightMissingResonators;
-
-highlightMissingResonators.styles = {
-  common: {
-    fillcolor: 'red'
-  }
-};

 function missingResonators (data) {

@@ -23,13 +15,12 @@ function missingResonators (data) {

     if (res_count !== undefined && res_count < 8) {
       var fill_opacity = ((8-res_count)/8)*.85 + .15;
-      // Hole per missing resonator
-      var dash = new Array((8 - res_count) + 1).join('1,4,') + '100,0';
+      var color = 'red';
+      var params = {fillColor: color, fillOpacity: fill_opacity};

-      var params = L.extend({},
-        highlightMissingResonators.styles.common,
-        {fillOpacity: fill_opacity, dashArray: dash}
-      );
+      // Hole per missing resonator
+      var dash = new Array((8 - res_count) + 1).join("1,4,") + "100,0"
+      params.dashArray = dash;

       data.portal.setStyle(params);
     }
-- 
2.35.3
le-jeu commented 2 years ago

So basically, the issue is about the portal not being red while missing resonators. This is due to a typo in the code fillcolor vs fillColor

sndirsch commented 2 years ago

@le-jeu Thanks a lot! Sorry, I missed your PR. Removed mine. It was incomplete anyway as I see now when looking at yours ...