Fixed the issue where pop-ups left after logging out of the server could not be closed. (#12111)

* Fixed the issue where pop-ups left after logging out of the server could not be closed.

* Apply suggestion from @Anuken

---------

Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
IYanHua
2026-05-24 11:49:55 +08:00
committed by GitHub
parent ed54566a14
commit 9ad195b68b

View File

@@ -717,7 +717,12 @@ public class UI implements ApplicationListener, Loadable{
/** Shows a menu that hides when another followUp-menu is shown or when nothing is selected.
* @see UI#showMenu(String, String, String[][], Intc) */
public void showFollowUpMenu(int menuId, String title, String message, String[][] options, Intc callback) {
Dialog dialog = newMenuDialog(title, message, options, (option, myself) -> callback.get(option));
Dialog dialog = newMenuDialog(title, message, options, (option, myself) -> {
callback.get(option);
if(!state.isGame()){
myself.hide();
}
});
dialog.closeOnBack(() -> {
followUpMenus.remove(menuId);
callback.get(-1);