iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

cross_links requires draw_tools alert in setup() #1215

Closed pleasantone closed 1 year ago

pleasantone commented 7 years ago

This alert box breaks the case where cross_links is initialized before draw_tools is loaded. It's a corner case but does happen. There is nothing else in setup() that requires draw_tools to be loaded, and in fact cross_links goes to quite a bit of trouble to do the right thing in that case.

The alert should be removed.

@dingram

McBen commented 7 years ago

This alert box breaks the case where cross_links is initialized before draw_tools is loaded.

It is called after all plugins are loaded.

There is nothing else in setup() that requires draw_tools to be loaded,

yeah, sure. But the rest of the code uses draw-tools data structure.

in fact cross_links goes to quite a bit of trouble to do the right thing in that case.

in fact: cross-links quit processing after that message and so does nothing.

so. plz an example

pleasantone commented 7 years ago

You are miss reading or misinterpreting what I am saying. If that alert is removed, cross-links works as expected, doing nothing until draw tools is eventually loaded. It is a mistake to have the alert and return in there. Look at the code that immediately follows the alert.

On May 30, 2017, at 1:28 PM, McBen notifications@github.com wrote:

This alert box breaks the case where cross_links is initialized before draw_tools is loaded. It is called after all plugins are loaded.

There is nothing else in setup() that requires draw_tools to be loaded, yeah, sure. But the rest of the code uses draw-tools data structure.

in fact cross_links goes to quite a bit of trouble to do the right thing in that case. in fact: cross-links quit processing after that message and so does nothing.

so. plz an example

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

McBen commented 7 years ago

IMHO it's better to inform the user that he installed useless peace of code.

BTW the code in 'testLink' is bound to DrawTools which is called in reaction of any new or delete link (for example).

Look at the code that immediately follows the alert.

I did: many stuff that will (indirectly) lead to 'function testLink' calls.

nhamer commented 7 years ago

OP was unclear - he's talking about a case where drawtools is disabled (and never loaded), not a start dependency. testLink() could simply test whether drawtools is loaded before rummaging around in its data structures.