Navigation Sticking

I have a docked window with several buttons that I'm using to navigate between my main screens using a simple script.

system.nav.swapTo('Maps/Area_2')
print("Mini Map 2-2")

Most of the time, this navigation works seamlessly. About 5% of the time, my client will refuse to open a specific window, and it's a different window every time.

I know the button's script is executing (I added that console print statement to check this). I know that it is an issue with the screen that I'm attempting to navigate to (I have several buttons that all navigate to the same screen, and they all pass/fail together).

The issue resolves itself when I navigate to a different screen and then to the screen I originally wanted to go to. Even reloading the current main screen resolves this sticking issue.

In that sense, it isn't halting production, but I hate to leave a nuisance bug like this in the program, especially one that comes up as often as this one does. Does anyone have any ideas about what could be going wrong?

Are you sure all of your navigation is using system.nav.swapTo()? If any main window is opened with system.nav.openWindow(), it breaks the system tag that the navigation components depend on to know what is happening. When you get into this situation, check the menubar's "Window" section to see what is currently open. It should only show your docked windows and the one main window under normal conditions. If there are two main windows shown, the standard nav components will get confused.

7 Likes

And make sure the windows you think are main windows really are setup to be that way:


otherwise the windows can open up behind another window.

1 Like

I found one window that was scripted with openWindow() instead of swapWindow().

Watching the open windows menu showed there there was an extra Main Window open, and this caused the issues I was experiencing.

Thank you!

1 Like