private string GetPrompt(Bind bind, SteamControllerButton steamControllerButton) { if (m_state.Game.Screen.InputMethod == InputMethod.SteamController) { var controller = m_state.Game.ActiveSteamController; return(steamControllerButton.GetPrompt(controller)); } else if (m_state.Game.Screen.InputMethod == InputMethod.Gamepad) { var padType = m_state.Game.ActiveGamepad.Type; return(m_state.Game.User.Settings.GetPadBind(bind).GetPrompt(padType)); } else { var button = m_state.Game.User.Settings.GetMouseBind(bind); if (button != MouseButton.None) { return(button.GetPrompt()); } else { return(m_state.Game.User.Settings.GetKeyBind(bind).GetPrompt()); } } }
private static string GetPromptImagePath(this SteamControllerButton button, ISteamController controller) { if (controller is SteamworksSteamController) { return(((SteamworksSteamController)controller).GetButtonPromptPath(button.GetID(), button.GetActionSet().GetID())); } return(null); }
public static string GetPrompt(this SteamControllerButton button, ISteamController controller) { var path = button.GetPromptImagePath(controller); if (path != null) { return('[' + path + ']'); } else { return("?"); } }
public static SteamControllerActionSet GetActionSet(this SteamControllerButton button) { if (button <= SteamControllerButton.MenuToGame) { return(SteamControllerActionSet.Menu); } else if (button <= SteamControllerButton.InGameToMenu) { return(SteamControllerActionSet.InGame); } else { return(SteamControllerActionSet.Arcade); } }
public static string GetID(this SteamControllerButton button) { return(button.ToString().ToLowerUnderscored()); }