diff --git a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs index 4604814..86a7477 100644 --- a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs +++ b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs @@ -142,6 +142,14 @@ public class InputEngine /////////////////////////////////////////////////////////////////////////// public VirtualButton ShowHelpButton { get; private set; } + /////////////////////////////////////////////////////////////////////////// + /// Show Options Button + /// This is the command that brings up the overlay text showing the + /// options to quit or pixelcide. For Gamepad it also displays the + /// options for changing team or changing class. + /////////////////////////////////////////////////////////////////////////// + public VirtualButton ShowOptionsButton { get; private set; } + /////////////////////////////////////////////////////////////////////////// /// Quit Button /// This is the command used in conjunction with the Select Button @@ -273,12 +281,14 @@ public InputEngine() // ChangeTeam = new VirtualButton(); ChangeTeam.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.N)); + ChangeTeam.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.X)); // // Change Class // ChangeClass = new VirtualButton(); ChangeClass.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.M)); + ChangeClass.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.A)); // // Say To Team @@ -299,6 +309,13 @@ public InputEngine() ShowHelpButton.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.F1)); ShowHelpButton.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.Back)); + // + // Show Options Button + // + ShowOptionsButton = new VirtualButton(); + ShowOptionsButton.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.Escape)); + ShowOptionsButton.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.Start)); + // // Quit Button // diff --git a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs index 25d5df6..c4ac83a 100644 --- a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs +++ b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs @@ -402,24 +402,35 @@ public void Render(GraphicsDevice graphicsDevice) spriteBatch.Draw(texRadarForeground, new Vector2(10, 30), Color.White); // Draw escape message. - if (_P.inputEngine.ShowHelpButton.Check()) + if (_P.inputEngine.ShowOptionsButton.Check()) { string quitMessage = string.Empty; string pixelcideMessage = string.Empty; + string changeTeamMessage = string.Empty; + string changeClassMessage = string.Empty; if (_P.inputEngine.ControlType == ControlType.KeyboardMouse) { quitMessage = "PRESS Y TO CONFIRM THAT YOU WANT TO QUIT."; pixelcideMessage = "PRESS K TO COMMIT PIXELCIDE."; + changeClassMessage = "PRESS M TO CHANGE CLASS"; + changeTeamMessage = "PRESS N TO CHANGE TEAMS"; } else { - quitMessage = "PRESS (Y) Button TO CONFIRM THAT YOU WANT TO QUIT."; - pixelcideMessage = "PRESS (B) Button TO COMMIT PIXELCIDE."; + quitMessage = "PRESS (Y) BUTTON TO CONFIRM THAT YOU WANT TO QUIT."; + pixelcideMessage = "PRESS (B) BUTTON TO COMMIT PIXELCIDE."; + changeClassMessage = "PRESS (A) BUTTON TO CHANGE CLASS"; + changeTeamMessage = "PRESS (X) BUTTON TO CHANGE TEAM"; } - RenderMessageCenter(spriteBatch, quitMessage, new Vector2(graphicsDevice.Viewport.Width / 2, graphicsDevice.Viewport.Height / 2 + 30), Color.White, Color.Black); - RenderMessageCenter(spriteBatch, pixelcideMessage, new Vector2(graphicsDevice.Viewport.Width / 2, graphicsDevice.Viewport.Height / 2 + 80), Color.White, Color.Black); + if (_P.inputEngine.ControlType == ControlType.GamePad) + { + RenderMessageCenter(spriteBatch, changeClassMessage, new Vector2(graphicsDevice.Viewport.Width / 2, graphicsDevice.Viewport.Height / 2 - 80), Color.White, Color.Black); + RenderMessageCenter(spriteBatch, changeTeamMessage, new Vector2(graphicsDevice.Viewport.Width / 2, graphicsDevice.Viewport.Height / 2 + 30), Color.White, Color.Black); + } + RenderMessageCenter(spriteBatch, pixelcideMessage, new Vector2(graphicsDevice.Viewport.Width / 2, graphicsDevice.Viewport.Height / 2 - 30), Color.White, Color.Black); + RenderMessageCenter(spriteBatch, quitMessage, new Vector2(graphicsDevice.Viewport.Width / 2, graphicsDevice.Viewport.Height / 2 + +80), Color.White, Color.Black); } diff --git a/source/Infiniminer/Infiniminer.Client.Shared/States/MainGameState.cs b/source/Infiniminer/Infiniminer.Client.Shared/States/MainGameState.cs index 87fa7d8..ad79630 100644 --- a/source/Infiniminer/Infiniminer.Client.Shared/States/MainGameState.cs +++ b/source/Infiniminer/Infiniminer.Client.Shared/States/MainGameState.cs @@ -270,12 +270,22 @@ public override string OnUpdate(GameTime gameTime, KeyboardState keyState, Mouse /////////////////////////////////////////////////////////////////// /// Check if player wants to change class + /// (Keyboard only, gamepad check is during options section below) /////////////////////////////////////////////////////////////////// - if (_P.inputEngine.ChangeClass.Pressed()) + if (_P.inputEngine.ChangeClass.Pressed() && _P.inputEngine.ControlType == ControlType.KeyboardMouse) { nextState = "Infiniminer.States.ClassSelectionState"; } + /////////////////////////////////////////////////////////////////// + /// Check if player wants to change team + /// (Keyboard only, gamepad check is during options section below) + /////////////////////////////////////////////////////////////////// + if (_P.inputEngine.ChangeTeam.Pressed() && _P.inputEngine.ControlType == ControlType.KeyboardMouse) + { + nextState = "Infiniminer.States.TeamSelectionState"; + } + /////////////////////////////////////////////////////////////////// /// Check if player wants to enter a chat mode /////////////////////////////////////////////////////////////////// @@ -292,7 +302,7 @@ public override string OnUpdate(GameTime gameTime, KeyboardState keyState, Mouse /////////////////////////////////////////////////////////////////// /// Check if player want to quit match or commit pixelcide /////////////////////////////////////////////////////////////////// - if (_P.inputEngine.ShowHelpButton.Check()) + if (_P.inputEngine.ShowOptionsButton.Check()) { if (_P.inputEngine.QuitButton.Pressed()) { @@ -304,16 +314,20 @@ public override string OnUpdate(GameTime gameTime, KeyboardState keyState, Mouse { _P.KillPlayer("HAS COMMITTED PIXELCIDE!"); } - } - /////////////////////////////////////////////////////////////////// - /// Check if player wants to change team - /////////////////////////////////////////////////////////////////// - if (_P.inputEngine.ChangeTeam.Pressed()) - { - nextState = "Infiniminer.States.TeamSelectionState"; + if (_P.inputEngine.ChangeTeam.Pressed()) + { + nextState = "Infiniminer.States.TeamSelectionState"; + } + + if (_P.inputEngine.ChangeClass.Pressed()) + { + nextState = "Infiniminer.States.ClassSelectionState"; + } } + + /////////////////////////////////////////////////////////////////// /// Update the players position /////////////////////////////////////////////////////////////////// @@ -369,7 +383,7 @@ public override string OnUpdate(GameTime gameTime, KeyboardState keyState, Mouse /////////////////////////////////////////////////////////////////// /// Player is dead, check for respawn /////////////////////////////////////////////////////////////////// - if(_P.screenEffectCounter > 2 && _P.inputEngine.UseTool.Pressed()) + if (_P.screenEffectCounter > 2 && _P.inputEngine.UseTool.Pressed()) { _P.inputEngine.UseTool.ConsumePress(); _P.RespawnPlayer();