public bool CommandActivated(string command, Cv_Player player) { //Determine if the Keyboard input was pressed if (m_BindedKeys[player - 1].ContainsKey(command) && KeyPressed(m_BindedKeys[player - 1][command])) { //Return true (no need to check game pad) return(true); } if (m_BindedMouseActions[player - 1].ContainsKey(command) && MouseButtonPressed(m_BindedMouseActions[player - 1][command])) { return(true); } //Determine if the passed player's game pad input was pressed if (m_BindedButtons[player - 1].ContainsKey(command) && ButtonPressed(m_BindedButtons[player - 1][command], player)) { return(true); } //Othwerwise return false return(false); }
public Cv_GamepadValues GetGamepadValues(Cv_Player player) { var gamepadVals = new Cv_GamepadValues(); var gamepadState = m_GamePadStates[player - 1]; gamepadVals.LeftThumbstick = gamepadState.ThumbSticks.Left; gamepadVals.RightThumbstick = gamepadState.ThumbSticks.Right; gamepadVals.LeftTrigger = gamepadState.Triggers.Left; gamepadVals.RightTrigger = gamepadState.Triggers.Right; return(gamepadVals); }
public bool IsCommandBound(Cv_Player player, string command) { if (m_BindedKeys[player - 1].ContainsKey(command) || m_BindedMouseActions[player - 1].ContainsKey(command) || m_BindedButtons[player - 1].ContainsKey(command)) { return(true); } return(false); }
public Cv_PlayerView GetPlayerView(Cv_Player player) { foreach (var gv in Logic.GameViews) { if (gv.Type == Cv_GameViewType.Player) { var pView = (Cv_PlayerView)gv; if (pView.PlayerIdx == player) { return(pView); } } } return(null); }
public bool CommandActive(string command, Cv_Player player) { //Determine if the Keyboard input is held down if (m_BindedKeys[player - 1].ContainsKey(command) && KeyDown(m_BindedKeys[player - 1][command])) { //return true (no need to check game pad) return(true); } if (m_BindedMouseActions[player - 1].ContainsKey(command) && m_BindedMouseActions[player - 1][command] == Cv_MouseAction.MouseWheelDown && MouseWheelDown()) { return(true); } if (m_BindedMouseActions[player - 1].ContainsKey(command) && m_BindedMouseActions[player - 1][command] == Cv_MouseAction.MouseWheelUp && MouseWheelUp()) { return(true); } if (m_BindedMouseActions[player - 1].ContainsKey(command) && m_BindedMouseActions[player - 1][command] == Cv_MouseAction.MouseMove && MouseMoved()) { return(true); } if (m_BindedMouseActions[player - 1].ContainsKey(command) && MouseButtonDown(m_BindedMouseActions[player - 1][command])) { return(true); } //Determine if the active player's game pad input is held down if (m_BindedButtons[player - 1].ContainsKey(command) && ButtonDown(m_BindedButtons[player - 1][command], player)) { return(true); } //otherwise return false return(false); }
public void BindCommand(Cv_Player player, string command, Keys key) { m_BindedKeys[player - 1][command] = key; }
private bool ButtonDown(Buttons button, Cv_Player index) { //Determine whether the button is down return(m_GamePadStates[index - 1].IsButtonDown(button)); }
private bool ButtonPressed(Buttons button, Cv_Player index) { //Determine whether the button has been pressed return(m_GamePadStates[index - 1].IsButtonDown(button) && m_LastGamePadStates[index - 1].IsButtonUp(button)); }
public void UnbindCommand(Cv_Player player, string command) { m_BindedKeys[player - 1].Remove(command); m_BindedButtons[player - 1].Remove(command); m_BindedMouseActions[player - 1].Remove(command); }
public void BindCommand(Cv_Player player, string command, Cv_MouseAction button) { m_BindedMouseActions[player - 1][command] = button; }
public void BindCommand(Cv_Player player, string command, Buttons button) { m_BindedButtons[player - 1][command] = button; }
public EditorView(Cv_Player player, SpriteBatch sb) : base(player, new Vector2(1, 1), Vector2.Zero, sb) { DebugDrawPhysicsShapes = true; DebugDrawCameras = true; DebugDrawClickableAreas = true; }