@@ -318,7 +318,7 @@ private async Task HandleMainNavigationButtons(Menu currentMenu)
318
318
Game . IsDisabledControlJustReleased ( 0 , Control . PhoneCancel )
319
319
#endif
320
320
#if REDM
321
- Call < bool > ( IS_DISABLED_CONTROL_JUST_RELEASED , 0 , Control . CellphoneCancel )
321
+ IsDisabledControlJustReleased ( 0 , ( uint ) Control . CellphoneCancel )
322
322
#endif
323
323
)
324
324
{
@@ -533,30 +533,33 @@ private async Task ProcessDirectionalButtons()
533
533
534
534
// Check if the Go Left controls are pressed.
535
535
else if (
536
+ AreMenuButtonsEnabled && (
536
537
#if FIVEM
537
- Game . IsDisabledControlJustPressed ( 0 , Control . PhoneLeft ) ||
538
- Game . IsControlJustPressed ( 0 , Control . PhoneLeft )
538
+ Game . IsDisabledControlJustPressed ( 0 , Control . PhoneLeft ) ||
539
+ Game . IsControlJustPressed ( 0 , Control . PhoneLeft )
539
540
#endif
540
541
#if REDM
541
- IsDisabledControlJustPressed( 0 , ( uint ) Control . FrontendLeft ) ||
542
- IsControlJustPressed ( 0 , ( uint ) Control . FrontendLeft )
542
+ IsDisabledControlJustPressed( 0 , ( uint ) Control . FrontendLeft ) ||
543
+ IsControlJustPressed ( 0 , ( uint ) Control . FrontendLeft )
543
544
#endif
545
+ )
544
546
)
545
547
{
546
548
await HandleLeftNavigation ( currentMenu ) ;
547
549
}
548
550
549
551
// Check if the Go Right controls are pressed.
550
552
else if (
553
+ AreMenuButtonsEnabled && (
551
554
#if FIVEM
552
- Game . IsDisabledControlJustPressed ( 0 , Control . PhoneRight ) ||
553
- Game . IsControlJustPressed ( 0 , Control . PhoneRight )
555
+ Game . IsDisabledControlJustPressed ( 0 , Control . PhoneRight ) ||
556
+ Game . IsControlJustPressed ( 0 , Control . PhoneRight )
554
557
#endif
555
558
#if REDM
556
- AreMenuButtonsEnabled &&
557
- Call < bool > ( IS_DISABLED_CONTROL_JUST_PRESSED , 0 , Control . FrontendRight ) ||
558
- Call < bool > ( IS_CONTROL_JUST_PRESSED , 0 , Control . FrontendRight )
559
+ IsDisabledControlJustPressed( 0 , ( uint ) Control . FrontendRight ) ||
560
+ IsControlJustPressed ( 0 , ( uint ) Control . FrontendRight )
559
561
#endif
562
+ )
560
563
)
561
564
{
562
565
await HandleRightNavigation ( currentMenu ) ;
@@ -576,7 +579,13 @@ private async Task HandleRightNavigation(Menu currentMenu)
576
579
while ( ( Game . IsDisabledControlPressed ( 0 , Control . PhoneRight ) || Game . IsControlPressed ( 0 , Control . PhoneRight ) ) && GetCurrentMenu ( ) != null && AreMenuButtonsEnabled )
577
580
#endif
578
581
#if REDM
579
- while ( ( Call < bool > ( IS_DISABLED_CONTROL_PRESSED , 0 , Control . FrontendRight ) || Call < bool > ( IS_CONTROL_PRESSED , 0 , Control . FrontendRight ) ) && GetCurrentMenu ( ) != null && AreMenuButtonsEnabled )
582
+ while (
583
+ GetCurrentMenu ( ) != null &&
584
+ AreMenuButtonsEnabled && (
585
+ IsDisabledControlPressed ( 0 , ( uint ) Control . FrontendRight ) ||
586
+ IsControlPressed ( 0 , ( uint ) Control . FrontendRight )
587
+ )
588
+ )
580
589
#endif
581
590
{
582
591
currentMenu = GetCurrentMenu ( ) ;
@@ -616,16 +625,17 @@ private async Task HandleLeftNavigation(Menu currentMenu)
616
625
var times = 0 ;
617
626
var delay = 200 ;
618
627
while (
619
- #if FIVEM
620
- ( Game . IsDisabledControlPressed ( 0 , Control . PhoneLeft ) || Game . IsControlPressed ( 0 , Control . PhoneLeft ) ) &&
621
628
GetCurrentMenu ( ) != null &&
622
- AreMenuButtonsEnabled
629
+ AreMenuButtonsEnabled && (
630
+ #if FIVEM
631
+ Game . IsDisabledControlPressed ( 0 , Control . PhoneLeft ) ||
632
+ Game . IsControlPressed ( 0 , Control . PhoneLeft )
623
633
#endif
624
634
#if REDM
625
- ( Call < bool > ( IS_DISABLED_CONTROL_PRESSED , 0 , Control . FrontendLeft ) || Call < bool > ( IS_CONTROL_PRESSED , 0 , Control . FrontendLeft ) ) &&
626
- GetCurrentMenu ( ) != null &&
627
- AreMenuButtonsEnabled
635
+ IsDisabledControlPressed( 0 , ( uint ) Control . FrontendLeft ) ||
636
+ IsControlPressed ( 0 , ( uint ) Control . FrontendLeft )
628
637
#endif
638
+ )
629
639
)
630
640
{
631
641
currentMenu = GetCurrentMenu ( ) ;
@@ -856,10 +866,10 @@ private static void DisableControls()
856
866
return ;
857
867
if (
858
868
#if FIVEM
859
- Game . PlayerPed . IsDead
869
+ Game . PlayerPed . IsDead
860
870
#endif
861
871
#if REDM
862
- Call < bool > ( IS_ENTITY_DEAD , PlayerPedId ( ) )
872
+ IsEntityDead ( PlayerPedId ( ) )
863
873
#endif
864
874
)
865
875
{
@@ -888,38 +898,38 @@ private static void DisableControls()
888
898
#if REDM
889
899
private static void DisableControlsRedM ( )
890
900
{
891
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . Attack , true ) ;
892
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . Attack2 , true ) ;
893
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . HorseAim , true ) ;
894
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . HorseAttack , true ) ;
895
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . HorseAttack2 , true ) ;
896
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . HorseMelee , true ) ;
897
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeAttack , true ) ;
898
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeBlock , true ) ;
899
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeGrapple , true ) ;
900
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeGrappleAttack , true ) ;
901
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeGrappleBreakout , true ) ;
902
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeGrappleChoke , true ) ;
903
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeGrappleMountSwitch , true ) ;
904
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeGrappleReversal , true ) ;
905
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeGrappleStandSwitch , true ) ;
906
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeHorseAttackPrimary , true ) ;
907
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeHorseAttackSecondary , true ) ;
908
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . MeleeModifier , true ) ;
909
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehAttack , true ) ;
910
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehAttack2 , true ) ;
911
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehBoatAttack , true ) ;
912
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehBoatAttack2 , true ) ;
913
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehCarAttack , true ) ;
914
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehCarAttack2 , true ) ;
915
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehDraftAttack , true ) ;
916
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehDraftAttack2 , true ) ;
917
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehFlyAttack , true ) ;
918
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehFlyAttack2 , true ) ;
919
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . VehPassengerAttack , true ) ;
920
- if ( Call < bool > ( _IS_INPUT_DISABLED , 2 ) )
901
+ DisableControlAction ( 0 , ( uint ) Control . Attack , true ) ;
902
+ DisableControlAction ( 0 , ( uint ) Control . Attack2 , true ) ;
903
+ DisableControlAction ( 0 , ( uint ) Control . HorseAim , true ) ;
904
+ DisableControlAction ( 0 , ( uint ) Control . HorseAttack , true ) ;
905
+ DisableControlAction ( 0 , ( uint ) Control . HorseAttack2 , true ) ;
906
+ DisableControlAction ( 0 , ( uint ) Control . HorseMelee , true ) ;
907
+ DisableControlAction ( 0 , ( uint ) Control . MeleeAttack , true ) ;
908
+ DisableControlAction ( 0 , ( uint ) Control . MeleeBlock , true ) ;
909
+ DisableControlAction ( 0 , ( uint ) Control . MeleeGrapple , true ) ;
910
+ DisableControlAction ( 0 , ( uint ) Control . MeleeGrappleAttack , true ) ;
911
+ DisableControlAction ( 0 , ( uint ) Control . MeleeGrappleBreakout , true ) ;
912
+ DisableControlAction ( 0 , ( uint ) Control . MeleeGrappleChoke , true ) ;
913
+ DisableControlAction ( 0 , ( uint ) Control . MeleeGrappleMountSwitch , true ) ;
914
+ DisableControlAction ( 0 , ( uint ) Control . MeleeGrappleReversal , true ) ;
915
+ DisableControlAction ( 0 , ( uint ) Control . MeleeGrappleStandSwitch , true ) ;
916
+ DisableControlAction ( 0 , ( uint ) Control . MeleeHorseAttackPrimary , true ) ;
917
+ DisableControlAction ( 0 , ( uint ) Control . MeleeHorseAttackSecondary , true ) ;
918
+ DisableControlAction ( 0 , ( uint ) Control . MeleeModifier , true ) ;
919
+ DisableControlAction ( 0 , ( uint ) Control . VehAttack , true ) ;
920
+ DisableControlAction ( 0 , ( uint ) Control . VehAttack2 , true ) ;
921
+ DisableControlAction ( 0 , ( uint ) Control . VehBoatAttack , true ) ;
922
+ DisableControlAction ( 0 , ( uint ) Control . VehBoatAttack2 , true ) ;
923
+ DisableControlAction ( 0 , ( uint ) Control . VehCarAttack , true ) ;
924
+ DisableControlAction ( 0 , ( uint ) Control . VehCarAttack2 , true ) ;
925
+ DisableControlAction ( 0 , ( uint ) Control . VehDraftAttack , true ) ;
926
+ DisableControlAction ( 0 , ( uint ) Control . VehDraftAttack2 , true ) ;
927
+ DisableControlAction ( 0 , ( uint ) Control . VehFlyAttack , true ) ;
928
+ DisableControlAction ( 0 , ( uint ) Control . VehFlyAttack2 , true ) ;
929
+ DisableControlAction ( 0 , ( uint ) Control . VehPassengerAttack , true ) ;
930
+ if ( IsInputDisabled ( 2 ) )
921
931
{
922
- Call ( DISABLE_CONTROL_ACTION , 0 , Control . FrontendPauseAlternate , true ) ;
932
+ DisableControlAction ( 0 , ( uint ) Control . FrontendPauseAlternate , true ) ;
923
933
}
924
934
}
925
935
#endif
@@ -1024,20 +1034,15 @@ private static async Task ProcessMenus()
1024
1034
if ( ! (
1025
1035
Menus . Any ( ) &&
1026
1036
IsAnyMenuOpen ( ) &&
1027
- #if FIVEM
1028
1037
IsScreenFadedIn ( ) &&
1029
- ! Game . IsPaused &&
1030
- ! Game . Player . IsDead &&
1031
- ! IsPlayerSwitchInProgress ( )
1032
- #endif
1033
- #if REDM
1034
- Call < bool > ( IS_SCREEN_FADED_IN ) &&
1035
- ! Call < bool > ( IS_PAUSE_MENU_ACTIVE ) &&
1036
- ! Call < bool > ( IS_ENTITY_DEAD , PlayerPedId ( ) )
1038
+ ! IsPauseMenuActive ( ) &&
1039
+ ! IsEntityDead ( PlayerPedId ( ) )
1040
+ #if FIVEM
1041
+ & & ! IsPlayerSwitchInProgress ( )
1037
1042
#endif
1038
- ) )
1043
+ )
1044
+ )
1039
1045
{
1040
-
1041
1046
UnloadAssets ( ) ;
1042
1047
return ;
1043
1048
}
0 commit comments