public static void CreateButton() { if (Button != null) { return; } Button = new GameplayButton(PopeyesRolesModPlugin.Assets.Heart, new HudPosition(GameplayButton.OffsetX, 0, HudAlignment.BottomRight)); Button.OnClick += Button_OnClick; Button.OnUpdate += Button_OnUpdate; }
public static void CreateButton() { if (Button != null) { return; } Button = new GameplayButton(PopeyesRolesModPlugin.Assets.Settings, new HudPosition(GameplayButton.OffsetX, 0, HudAlignment.BottomRight)); Button.OnClick += Button_OnClick;; Button.OnUpdate += Button_OnUpdate; lastQ = Input.GetKeyUp(KeyCode.Q); if (Input.GetKeyDown(KeyCode.Q) && !lastQ && Button.IsUsable) { Button.PerformClick(); } }