PDA

View Full Version : FGU API, imagecontrol.hasGrid() .... doesn't work as expected?



celestian
September 15th, 2021, 03:07
The response from imagecontrol.hasGrid() is true if you have the "visible" selected.

https://i.imgur.com/HBilYYp.png


It returns false if that is not set visible, even if you have a grid that is just invisible.


https://i.imgur.com/2EKtSU8.png

I don't recall this being a issue in FGC. If you had a grid configured it would return TRUE, if you did not, FALSE.

Is this intended? If so can we get an API call that returns TRUE if a grid is set, false if not? If not, how do you suggest this be detected?

jharp
September 15th, 2021, 05:00
Curiosity makes me ask what decision you are making dependent on it. How does it affect you?

celestian
September 15th, 2021, 05:27
Curiosity makes me ask what decision you are making dependent on it. How does it affect you?

In FGC if this was "false" it wouldn't give you distances. I've not tested it in FGU but assumed it did the same. Without a grid size you dont know distance. I need distance calculations to be able to implement auras.

Moon Wizard
September 15th, 2021, 05:29
All maps in FGU always have an implied grid (50x50 by default, or whatever is defined by user). In FGC, when a grid was not defined, it was essentially a nil/unknown value (thus no measurements).

So, your code should be updated such that FGU specific code should not use hasGrid.

Regards,
JPG

celestian
September 15th, 2021, 05:47
So, your code should be updated such that FGU specific code should not use hasGrid.


Acknowledged.