Remove windowDialogs for empty zones after rollback
Fixes #6856 #8686
Additionally, empty graveyard, sideboard, and exile windowDialogs will automatically close on updateGame
Test by experimenting with various combinations of graveyard, sideboard, and exile windowDialogs after performing rollbacks.
BTW wrong exile zones after rollback smells bad, there are possible problems with miss/wrong code in reset/copy methods (e.g. it use ref instead deep copy). I’ll look at it.
Windows clean up code from that PR can be useful too anyway.
With exileZone.isEmpty() conditional breakpoint set on !exileZone.isEmpty():
An empty exiles.add is triggered whenever a new GameView is called. Although I am not super familiar with this code, this seems reasonable and the check I added seems like a reasonable solution.
Fyi, adding missing exile windows after a rollback is handled by code unrelated to this PR earlier in updateGame.
As a player, I would prefer they remained open, just had their contents correctly cleared. (For example, when I have something that cares about the opponents graveyard, I will open their graveyard, resize it, and position it where I want on the screen (whether or not the graveyard happens to be empty at that point in time)).
I would rather not have to go through that process again after a rollback.
Agree that empty graveyard should not be closed. But empty specific exile zones should be.
Potential enhancement for future: allow to "pin" windows to prevent closing when empty