fpw / avitab

X-Plane plugin that displays a tablet to aid VR usage
GNU Affero General Public License v3.0
299 stars 58 forks source link

Remove OpenTopo button; use first online map in mapconfig as default #176

Closed cyberang3l closed 9 months ago

cyberang3l commented 10 months ago

Removing the OpenTopo button was a bit more challenging that we thought, as when the map config is broken AviTab will fail to load any map. I came up with a solution that uses a hardcoded fallback map (OpenTopoMap) to get around this issue. The hardcoded fallback map will only be used when the config is broken. When the config is correct, the first enabled map that is found in the config is used as the default map. As a bonus, we now also support letting users choose their favorite default map by modifying the config. The feature in this commit commit work as follow:

This is what the user now will see when they start AviTab with a broken mapconfig.json config: Broken-mapconfig-AviTab-Start

Once they explicitly acknowledge the error by clicking on the X button of the error window, they can still use AviTab and when they go to the MapApp the default hardcoded fallback (OpenTopoMap) is used: When broken conf, the fallback map is used

fpw commented 10 months ago

I understand the issue, but I'm not sure if I like the solution:

I'll think about this some more.

cyberang3l commented 10 months ago

from my understanding, there is no way to reload the JSON config at runtime

There is - every time one make changes to the mapconfig.json, closes the menu and goes back to the menu that selects an online map, the mapconfig.json is reloaded. So you don't need to exit X-Plane (or restart AviTab) every time. Just alt-tab to move between X-Plane and the notepad, and reload the menu.