ddnet/src
Robert Müller 92567ced7b Fix issues when closing multiple editor popups at the same time
When using `UiClosePopupMenus` in a popup handler, the number of popups was first set to `0` and then decremented to `-1` due to the popup itself being closed, which causes the next popup to not open correctly and may also cause a crash due to an out-of-bounds access.

The `UiClosePopupMenus` function is adjusted so the number of open popups never goes below `0`.

Another check is added to ensure that `UI()->SetActiveItem(nullptr)` is only called when a popup is open, so the currently active item is not reset if no popup is open.

Duplicate code in `UiDoPopupMenu` is reduced by calling the `UiClosePopupMenus` function to only close the top-most popup.

This also fixes the same issue when a popup is closed by the popup handler and the escape key in the same frame, by only handling the escape key for closing the top-most popup when the popup was not already closed by the handler.

Lastly, the explicit escape key handling is removed from the event popup, as this also caused the above issue and is not necessary, as the escape key is already handled implicitly for all popups.
2022-12-24 11:57:06 +01:00
..
android Add tests for overloaded hash operators, use operator instead 2022-11-12 20:36:38 +01:00
antibot Merge pull request #3961 from fokkonaut/pr-antibot 2021-12-19 19:33:56 +01:00
base Merge #6035 2022-12-05 20:00:07 +00:00
engine Pass SDL event structure directly to handler functions 2022-12-18 12:41:54 +01:00
game Fix issues when closing multiple editor popups at the same time 2022-12-24 11:57:06 +01:00
macos Huge variable naming format 2022-07-08 18:01:29 +02:00
mastersrv Add README.md for the mastersrv, briefly explaining the setup 2022-12-21 13:11:57 +01:00
rust-bridge Fix being run from rust-analyzer with a clean environment 2022-11-09 15:09:42 +01:00
steam Huge variable naming format 2022-07-08 18:01:29 +02:00
test Merge #6035 2022-12-05 20:00:07 +00:00
tools Fix optional arguments of map_create_pixelart tool 2022-11-29 23:32:26 +01:00