solarus-games / zelda-xd2-mercuris-chess

This repository was moved to GitLab: https://gitlab.com/solarus-games/zelda-xd2-mercuris-chess
http://www.solarus-games.org
Other
12 stars 6 forks source link

Duplicate menus after game-over #2

Closed christopho closed 7 years ago

christopho commented 7 years ago

The pause menu and the dialog box are buggy on some systems: https://www.youtube.com/watch?v=FZyHgcAOEzw It looks like the dialog box appears twice, as well as the pause menu. Maybe there is the same problem with the game-over menu. I did not reproduce the bug so far

Diarandor commented 7 years ago

I had 3 different errors with menus or dialog box (open new issues for the ones that are not the same): -Dialog box duplicated above and below -Dialog box not cleared (or something like that), so text appears over previous text -Inventory menus with images in the wrong menu (maybe some index is not updated correclty?)

MetalES commented 7 years ago

I did have this issue as well, mostly happen after a game over

christopho commented 7 years ago

This is all the same bug, for the 3 menus. I still cannot reproduce it.

christopho commented 7 years ago

Could be a bug of the multi_events script, because this is the first game with menus using it. Or a bug in the engine that we did not encounter before multi_events.

christopho commented 7 years ago

I can reproduce the same symptoms by opening the pause menu twice instead of once:

game:register_event("on_paused", function(game)
  pause_menu:open()
  pause_menu:open()
end)
christopho commented 7 years ago

Can anyone test if this commit solves the problem: https://github.com/solarus-games/zelda-xd2-mercuris-chess/commit/ec636e9af4846c5bc0553ff8f76f88a0236ec938 @Diarandor @MetalES

MetalES commented 7 years ago

There is still the bug, you can do it easily.

The menu is opened a lot of time, it depend the number of time you've died. This might be due to the multiple event, being recalled because the game restarts, and so, declare once again the event on_started ?

I don't know, i didn't looked at the entire Mercuris Chess code yet

MetalES commented 7 years ago

Replacing

game:register_event("on_paused", function(game) blablabla

by

function game:on_paused() pause_menu:open() end

fixed the issue ... yet I don't know if you use something else in on_paused with the pause menu

christopho commented 7 years ago

Ohhhhhhhhh that's right! After game-over we register the event again on the same game!