File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ private async Task ProcessMainButtons()
319319 // Cancel / Go Back
320320 else if (
321321#if FIVEM
322- Game . IsDisabledControlJustReleased ( 0 , Control . PhoneCancel )
322+ Game . IsDisabledControlJustReleased ( 0 , Control . PhoneCancel )
323323#endif
324324#if REDM
325325 Call < bool > ( IS_DISABLED_CONTROL_JUST_RELEASED , 0 , Control . FrontendCancel )
@@ -332,7 +332,7 @@ private async Task ProcessMainButtons()
332332 }
333333 else if (
334334#if FIVEM
335- Game . IsDisabledControlJustReleased ( 0 , Control . PhoneCancel )
335+ Game . IsDisabledControlJustReleased ( 0 , Control . PhoneCancel )
336336#endif
337337#if REDM
338338 Call < bool > ( IS_DISABLED_CONTROL_JUST_RELEASED , 0 , Control . CellphoneCancel )
@@ -1051,5 +1051,19 @@ private static void DisposeInstructionalButtonsScaleform()
10511051 }
10521052 }
10531053#endif
1054+
1055+ /// <summary>
1056+ /// Prevent the UI prompts getting stuck on screen if this resource is ever to be restarted while someone has any menu's open.
1057+ /// </summary>
1058+ /// <param name="name"></param>
1059+ [ EventHandler ( "onResourceStop" ) ]
1060+ private static void OnResourceStop ( string name )
1061+ {
1062+ if ( name == GetCurrentResourceName ( ) )
1063+ {
1064+ Debug . WriteLine ( $ "^3[WARNING] [{ name } ] Closing all menus because this resource is being stopped, to prevent the UI Prompts getting stuck.^7") ;
1065+ CloseAllMenus ( ) ;
1066+ }
1067+ }
10541068 }
10551069}
You can’t perform that action at this time.
0 commit comments