mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-27 23:44:35 +00:00
Controller Support
This commit is contained in:
1 parent
bfee7d44a2
commit
041c39d7ff
18 files changed
+516
-476
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using MiraAPI.Hud;
|
||||
using MiraAPI.Keybinds;
|
||||
using MiraAPI.Translation;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using UnityEngine;
|
||||
@@ -13,6 +14,8 @@ public class ThinkButton : CustomActionButton
|
||||
public override int MaxUses => 1;
|
||||
public override ButtonUsesMode UsesMode => ButtonUsesMode.PerRound;
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
|
||||
public override MiraKeybind Keybind => MiraGlobalKeybinds.SecondaryAbility;
|
||||
|
||||
protected override void OnClick()
|
||||
{
|
||||
Button!.OverrideText("button.think.thinking".Translate());
|
||||
@@ -32,4 +35,4 @@ public class ThinkButton : CustomActionButton
|
||||
{
|
||||
return role != null && role.IsImpostor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using MiraAPI.Keybinds;
|
||||
using MiraAPI.Keybinds;
|
||||
using Rewired;
|
||||
|
||||
namespace MiraAPI.Example;
|
||||
@@ -6,5 +6,5 @@ namespace MiraAPI.Example;
|
||||
[RegisterCustomKeybinds]
|
||||
public static class ExampleKeybinds
|
||||
{
|
||||
public static MiraKeybind NeutralWinKeybind { get; } = new("Neutral Win", KeyboardKeyCode.C, [ModifierKey.Shift]);
|
||||
}
|
||||
public static MiraKeybind NeutralWinKeybind { get; } = new("Neutral Win", KeyboardKeyCode.C, ControllerButton.RightStick, [ModifierKey.Shift]);
|
||||
}
|
||||
Reference in new issue
Block a user