ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.73k stars 377 forks source link

Adventure map, animation and hero centering on adventure map with interaction of object that displays a window #6965

Open LeHerosInconnu opened 1 year ago

LeHerosInconnu commented 1 year ago

Preliminary checks

Platform

Windows

Describe the bug

In fheroes2, when the hero interacts with objects that open a message window, the window is opened just before the hero is centered on the adventure map. The hero should finish his movement animation and be centered on the adventure map before the message window is displayed.

In fheroes2: In the example, with Faerie Ring:

https://user-images.githubusercontent.com/43583994/230735422-32f052c5-ac38-49e0-94de-9aa9873e8f9b.mp4

Open the two images in different tabs in your browser, and switch between the two tabs alternately. Shotcut_00_00_05_960 Shotcut_00_00_06_000

Save file

Here is the save file: Before faerie ring 01.zip

Additional info

No response

oleg-derevenetz commented 1 year ago

the window is opened just before the hero is centered on the adventure map.

In fact, the window is opened AFTER the new hero's position is centered on the adventure map (that's what these screenshots demonstrate). But the hero's movement animation is not indeed finished at that time.

LeHerosInconnu commented 1 year ago

Hello @oleg-derevenetz,

the window is opened just before the hero is centered on the adventure map.

In fact, the window is opened AFTER the new hero's position is centered on the adventure map (that's what these screenshots demonstrate). But the hero's movement animation is not indeed finished at that time.

I don't know what exactly is happening on the programming side, but visually that's the impression you get. :)

oleg-derevenetz commented 1 year ago

I don't know what exactly is happening on the programming side, but visually that's the impression you get. :)

I mean that at the moment when dialog window appears, adventure map is already centered at the new hero position, that's why the adventure map content is shifted to the right (in the direction opposite to the direction of the hero's movement) on your second screenshot. So the window is opened AFTER the new position of a hero is centered on the adventure map, not BEFORE :)