1using System.Collections.Generic;
2using Terraria.GameInput;
13 internal readonly
Mod mod;
14 internal readonly
string name;
15 internal readonly
string uniqueName;
16 internal readonly
string defaultKey;
18 internal ModHotKey(
Mod mod,
string name,
string defaultKey) {
21 this.defaultKey = defaultKey;
22 this.uniqueName = mod.Name +
": " + name;
31 return PlayerInput.CurrentProfile.InputModes[mode].KeyStatus[uniqueName];
36 if (Main.drawingPlayerChat || Main.player[Main.myPlayer].talkNPC != -1 || Main.player[Main.myPlayer].sign != -1)
return false;
44 public bool Current => PlayerInput.Triggers.Current.KeyStatus[uniqueName];
49 public bool JustPressed => PlayerInput.Triggers.JustPressed.KeyStatus[uniqueName];
54 public bool JustReleased => PlayerInput.Triggers.JustReleased.KeyStatus[uniqueName];
59 public bool Old => PlayerInput.Triggers.Old.KeyStatus[uniqueName];
Represents a loaded hotkey. It is suggested to access the hotkey status only in ModPlayer....
bool JustReleased
Returns true if this hotkey was just released this update.
bool JustPressed
Returns true if this hotkey was just released this update. This is a fire-once-per-press behavior.
bool Current
Returns true if this hotkey is pressed currently. Useful for createing a behavior that relies on the ...
bool Old
Returns true if this hotkey was pressed the previous update.
List< string > GetAssignedKeys(InputMode mode=InputMode.Keyboard)
Gets the currently assigned keybindings. Useful for prompts, tooltips, informing users.
Mod is an abstract class that you will override. It serves as a central place from which the mod's co...