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
290 stars 109 forks source link

Portal data mixed up with marker style options #107

Open johnd0e opened 5 years ago

johnd0e commented 5 years ago

Here is portal data: https://github.com/IITC-CE/ingress-intel-total-conversion/blob/d77562b91a5b1e0bf170b4257eb33316a0b9daa3/code/map_data_render.js#L318-L325

And here we see that this data merges into portal marker style options: https://github.com/IITC-CE/ingress-intel-total-conversion/blob/d77562b91a5b1e0bf170b4257eb33316a0b9daa3/code/portal_marker.js#L17-L19

So we have got a mix up of numerous unrelated properties together, which is not good.

But now we cannot fix it that simple, because it's a part of API.

johnd0e commented 4 years ago

But now we cannot fix it that simple, because it's a part of API.

But we can do it in compatible way for now: keep merging in options for compatibility, but iitc core and standard plugins may use new properties.

Currently all data composed as posted above. Mentioned data come from here:

decodeArray.portalSummary() https://github.com/IITC-CE/ingress-intel-total-conversion/blob/36a9b69e55c409a091523401422f532e628c3b1d/core/code/entity_decode.js#L95-L114 (todo: remove usage from `artifacts.js`)

Where resulting value is composed from:

corePortalData() https://github.com/IITC-CE/ingress-intel-total-conversion/blob/36a9b69e55c409a091523401422f532e628c3b1d/core/code/entity_decode.js#L64-L74 P.S.: _as I can see, 'core' details are never received from intel, and only constructed by iitc for placeholders:_
createPlaceholderPortalEntity https://github.com/IITC-CE/ingress-intel-total-conversion/blob/36a9b69e55c409a091523401422f532e628c3b1d/core/code/map_data_render.js#L251-L283
summaryPortalData() https://github.com/IITC-CE/ingress-intel-total-conversion/blob/36a9b69e55c409a091523401422f532e628c3b1d/core/code/entity_decode.js#L76-L90

And more details:

decodeArray.portalDetail() https://github.com/IITC-CE/ingress-intel-total-conversion/blob/36a9b69e55c409a091523401422f532e628c3b1d/core/code/entity_decode.js#L92 https://github.com/IITC-CE/ingress-intel-total-conversion/blob/36a9b69e55c409a091523401422f532e628c3b1d/core/code/entity_decode.js#L116-L139 This come from intel when requested explicitly
Details https://github.com/IITC-CE/ingress-intel-total-conversion/blob/36a9b69e55c409a091523401422f532e628c3b1d/core/code/portal_detail.js#L36

I am not sure yet what structure all this data should have in portal object, but I suppose we should not mix all data together.

And our new structure should be built with following considerations: