open-rmf / rmf_site

Experimental visualizer for dense buildings in RMF
32 stars 13 forks source link

Make georeference menus only show in site editor state #189

Closed luca-della-vedova closed 10 months ago

luca-della-vedova commented 10 months ago

Bug fix

Fixed bug

Simple fix for a part of #188 (targeting specifically the georeference menus). If it looks good I'll port it to the rest of UI (i.e. View menu).

Fix applied

This PR changes the georeference systems to only run when the app is in the SiteEditor state, as well as adds systems that are triggered when entering / exiting the state that spawn / despawn the submenus and insert / delete the tracking resource. Happy to achieve a similar effect another way but we should have ways to only show menus in specific states.

luca-della-vedova commented 10 months ago

Rewrote it in using a component that holds a closure that can be used to specify whatever state the app should be in for the menu to be visualized https://github.com/open-rmf/rmf_site/pull/189/commits/bf97aa50552aaa74ae658a9b65f9585b993b1aea

luca-della-vedova commented 10 months ago

Awesome, I'll make a followup refactor next, where this component is added to all the menus that only need to be displayed in certain states.