Skip to content

Commit

Permalink
MC: Add option to disable controller menu toggle key.
Browse files Browse the repository at this point in the history
bool EnableMenuToggleKeyOnController (true (enabled) by default)
  • Loading branch information
TomGrobbe committed Jan 27, 2019
1 parent 71965c6 commit 0e97905
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MenuAPI/MenuController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class MenuController : BaseScript
public static bool PreventExitingMenu { get; set; } = false;
public static bool DisableBackButton { get; set; } = false;
public static Control MenuToggleKey { get; set; } = Control.InteractionMenu;
public static bool EnableMenuToggleKeyOnController { get; set; } = true;

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

Expand Down Expand Up @@ -328,6 +329,9 @@ private async Task ProcessToggleMenuButton()
{
if (Game.CurrentInputMode == InputMode.GamePad)
{
if (!EnableMenuToggleKeyOnController)
return;

int tmpTimer = GetGameTimer();
while ((Game.IsControlPressed(0, Control.InteractionMenu) || Game.IsDisabledControlPressed(0, Control.InteractionMenu)) && !Game.IsPaused && IsScreenFadedIn() && !Game.Player.IsDead && !IsPlayerSwitchInProgress() && !DontOpenAnyMenu)
{
Expand Down

0 comments on commit 0e97905

Please sign in to comment.