mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Fix custom controller bindings blocking unused vanilla actions
This commit is contained in:
1 parent
51efa74811
commit
2748c64db2
2 files changed
+5
-5
No files matched your search
@@ -89,8 +89,7 @@ public static class KeybindUtils
|
||||
|
||||
internal static bool IsControllerActionActive(int actionId)
|
||||
{
|
||||
var buttons = CustomButtonManager.Buttons.Where(x => x.Keybind?.RewiredInputAction?.id == actionId).ToArray();
|
||||
return buttons.Length == 0 || buttons.Any(x => x.Button != null && x.Button.isActiveAndEnabled && x.Enabled(PlayerControl.LocalPlayer?.Data?.Role));
|
||||
return CustomButtonManager.Buttons.Any(x => x.Keybind?.RewiredInputAction?.id == actionId && x.Button != null && x.Button.isActiveAndEnabled && x.Enabled(PlayerControl.LocalPlayer?.Data?.Role));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace MiraAPI.Keybinds;
|
||||
/// <summary>
|
||||
/// Class containing all default <see cref="MiraKeybind"/>s.
|
||||
/// Recommended for cross-mod compatibility.
|
||||
/// Controller bindings are unassigned by default.
|
||||
/// </summary>
|
||||
[RegisterCustomKeybinds]
|
||||
public static class MiraGlobalKeybinds
|
||||
@@ -12,12 +13,12 @@ public static class MiraGlobalKeybinds
|
||||
/// <summary>
|
||||
/// Gets the keybind for primary abilities.
|
||||
/// </summary>
|
||||
public static MiraKeybind PrimaryAbility { get; } = new("Primary Ability", KeyboardKeyCode.T, ControllerButton.RightTrigger);
|
||||
public static MiraKeybind PrimaryAbility { get; } = new("Primary Ability", KeyboardKeyCode.T);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keybind for secondary abilities.
|
||||
/// </summary>
|
||||
public static MiraKeybind SecondaryAbility { get; } = new("Secondary Ability", KeyboardKeyCode.Y, ControllerButton.RightBumper);
|
||||
public static MiraKeybind SecondaryAbility { get; } = new("Secondary Ability", KeyboardKeyCode.Y);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keybind for Tertiary abilities.
|
||||
@@ -27,7 +28,7 @@ public static class MiraGlobalKeybinds
|
||||
/// <summary>
|
||||
/// Gets the keybind for primary modifier abilities.
|
||||
/// </summary>
|
||||
public static MiraKeybind ModifierPrimaryAbility { get; } = new("Modifier Primary Ability", KeyboardKeyCode.I, ControllerButton.LeftTrigger);
|
||||
public static MiraKeybind ModifierPrimaryAbility { get; } = new("Modifier Primary Ability", KeyboardKeyCode.I);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keybind for secondary modifier abilities.
|
||||
|
||||
Reference in new issue
Block a user