fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Battle screen, dialog windows don't stop idle timer for troops

Open Branikolog opened this issue 2 years ago • 2 comments

Preliminary checks

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

Branikolog avatar Jul 24 '23 10:07 Branikolog

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.

ihhub avatar Jul 26 '23 14:07 ihhub

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.

Districh-ru avatar Jul 28 '24 18:07 Districh-ru