Battle screen, dialog windows don't stop idle timer for troops
Preliminary checks
- [X] I've checked that there aren't other open issues on the same topic.
- [X] I've checked that this issue is reproducible on the latest snapshot build.
Platform
Windows
Describe the bug
https://github.com/ihhub/fheroes2/assets/55348946/5600d7e8-e536-4c57-82e7-4759368a0a6f
Once any dialog is opened, idle animation timer is still on. So, after waiting a couple of moments and closing the dialog, all creatures perform idle animation all together.
Save file
None.
Additional info
No response
The problem is that the animation is based on timers which obviously reached the required timing to render the next image in idle animation. An easy solution is to reset these times upon closing a window.
We can also reset the idle timer without doing the animation if more than, in example, 1.5 of its delay time has passed - it means that the battlefield was paused by something and we missed this idle animation and let's try to wait for the next one, starting from this time.