Skip to content

Commit 0e97905

Browse files
committed
MC: Add option to disable controller menu toggle key.
bool EnableMenuToggleKeyOnController (true (enabled) by default)
1 parent 71965c6 commit 0e97905

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

MenuAPI/MenuController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class MenuController : BaseScript
3030
public static bool PreventExitingMenu { get; set; } = false;
3131
public static bool DisableBackButton { get; set; } = false;
3232
public static Control MenuToggleKey { get; set; } = Control.InteractionMenu;
33+
public static bool EnableMenuToggleKeyOnController { get; set; } = true;
3334

3435
internal static Dictionary<MenuItem, Menu> MenuButtons { get; private set; } = new Dictionary<MenuItem, Menu>();
3536

@@ -328,6 +329,9 @@ private async Task ProcessToggleMenuButton()
328329
{
329330
if (Game.CurrentInputMode == InputMode.GamePad)
330331
{
332+
if (!EnableMenuToggleKeyOnController)
333+
return;
334+
331335
int tmpTimer = GetGameTimer();
332336
while ((Game.IsControlPressed(0, Control.InteractionMenu) || Game.IsDisabledControlPressed(0, Control.InteractionMenu)) && !Game.IsPaused && IsScreenFadedIn() && !Game.Player.IsDead && !IsPlayerSwitchInProgress() && !DontOpenAnyMenu)
333337
{

0 commit comments

Comments
 (0)