From 5200e886d766703217f83d47b87d329a10ff2abb Mon Sep 17 00:00:00 2001 From: OM Date: Tue, 16 May 2023 19:01:44 +0200 Subject: [PATCH] Fixed menus locking up, and menus not hiding --- code/uilib/uimenu.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/code/uilib/uimenu.cpp b/code/uilib/uimenu.cpp index 90c3d09b..86b8f61a 100644 --- a/code/uilib/uimenu.cpp +++ b/code/uilib/uimenu.cpp @@ -205,7 +205,7 @@ void Menu::HideMenu if( !force ) { Event *event = new Event( "hide" ); - PostEvent( event, maxtime ); + wid->PostEvent( event, maxtime ); } } else @@ -584,6 +584,9 @@ void Menu::CheckRestart CLASS_DECLARATION( Listener, MenuManager, NULL ) { + { &EV_PushMenu, &MenuManager::PushMenu }, + { &EV_LockMenus, &MenuManager::Lock }, + { &EV_UnlockMenus, &MenuManager::Unlock }, { NULL, NULL } }; @@ -765,7 +768,7 @@ void MenuManager::PopMenu { Menu *top; Menu *head; - float maxtime; + float maxtime = 0.0; if( m_lock ) { @@ -799,10 +802,10 @@ void MenuManager::PopMenu { head->PostEvent( Event( "showmenu" ), maxtime ); } - - Lock( NULL ); - PostEvent( EV_UnlockMenus, maxtime ); } + + Lock(NULL); + PostEvent(EV_UnlockMenus, maxtime); } }