public static string UsedKeys(this ModHotKey hotkey) { if (Main.dedServ || hotkey == null) { return(""); } List <string> assinedKeys = hotkey.GetAssignedKeys(); if (assinedKeys.Count == 0) //there are none { return("[NONE]"); } string keys = assinedKeys[0]; for (int i = 1; i < assinedKeys.Count; i++) { keys += " | " + assinedKeys[i]; } return(keys); }
public static string GetHotkeyBinding(this ModHotKey hotkey, string fallback = "") { List <string> boundKeys = hotkey.GetAssignedKeys(); return(boundKeys.Count > 0 ? boundKeys[0] : fallback); }