Skip to content

Commit

Permalink
Renamed SelectButton to ShowHelp Button
Browse files Browse the repository at this point in the history
  • Loading branch information
AristurtleDev committed Oct 28, 2023
1 parent ba97fd8 commit 0b85ca3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
21 changes: 10 additions & 11 deletions source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,11 @@ public class InputEngine
public VirtualButton SayToAll { get; private set; }

///////////////////////////////////////////////////////////////////////////
/// Select Button (don't know what else to call this)
/// This is the command that was used by the ESC key to bring up
/// the screen asking if the player wanted to pixelcide or quite
/// This is only available for keyboards
/// Show Help Button
/// This is the command that brings up the overlay screen showing the
/// help information and keyboard/controller bindings
///////////////////////////////////////////////////////////////////////////
public VirtualButton SelectButton { get; private set; }
public VirtualButton ShowHelpButton { get; private set; }

///////////////////////////////////////////////////////////////////////////
/// Quit Button
Expand Down Expand Up @@ -294,11 +293,11 @@ public InputEngine()
SayToAll.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.Y));

//
// Select Button
// Show Help Button
//
SelectButton = new VirtualButton();
SelectButton.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.Escape));
SelectButton.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.Back));
ShowHelpButton = new VirtualButton();
ShowHelpButton.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.F1));
ShowHelpButton.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.Back));

//
// Quit Button
Expand Down Expand Up @@ -401,7 +400,7 @@ public void Register()
ChangeClass.Register();
SayToTeam.Register();
SayToAll.Register();
SelectButton.Register();
ShowHelpButton.Register();
MenuUp.Register();
MenuDown.Register();
MenuLeft.Register();
Expand Down Expand Up @@ -429,7 +428,7 @@ public void Unregister()
ChangeClass.Unregister();
SayToTeam.Unregister();
SayToAll.Unregister();
SelectButton.Unregister();
ShowHelpButton.Unregister();
MenuUp.Unregister();
MenuDown.Unregister();
MenuLeft.Unregister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class InterfaceEngine
SpriteFont uiFont, radarFont;
Rectangle drawRect;

Texture2D texCrosshairs, texBlank, texHelp;
Texture2D texCrosshairs, texBlank, texHelpKeyboardMouse, texHelpGamePad;
Texture2D texRadarBackground, texRadarForeground, texRadarPlayerSame, texRadarPlayerAbove, texRadarPlayerBelow, texRadarPlayerPing, texRadarNorth;
Texture2D texToolRadarRed, texToolRadarBlue, texToolRadarGold, texToolRadarDiamond, texToolRadarLED, texToolRadarPointer, texToolRadarFlash;
Texture2D texToolDetonatorDownRed, texToolDetonatorUpRed, texToolDetonatorDownBlue, texToolDetonatorUpBlue;
Expand All @@ -67,7 +67,8 @@ public InterfaceEngine(InfiniminerGame gameInstance)
texRadarPlayerBelow = gameInstance.Content.Load<Texture2D>("ui/tex_radar_player_below");
texRadarPlayerPing = gameInstance.Content.Load<Texture2D>("ui/tex_radar_player_ping");
texRadarNorth = gameInstance.Content.Load<Texture2D>("ui/tex_radar_north");
texHelp = gameInstance.Content.Load<Texture2D>("menus/tex_menu_help");
texHelpKeyboardMouse = gameInstance.Content.Load<Texture2D>("menus/tex_menu_help_keyboard_mouse");
texHelpGamePad = gameInstance.Content.Load<Texture2D>("menus/tex_menu_help_gamepad");

texToolRadarRed = gameInstance.Content.Load<Texture2D>("tools/tex_tool_radar_red");
texToolRadarBlue = gameInstance.Content.Load<Texture2D>("tools/tex_tool_radar_blue");
Expand Down Expand Up @@ -401,7 +402,7 @@ public void Render(GraphicsDevice graphicsDevice)
spriteBatch.Draw(texRadarForeground, new Vector2(10, 30), Color.White);

// Draw escape message.
if (_P.inputEngine.SelectButton.Check())
if (_P.inputEngine.ShowHelpButton.Check())
{
string quitMessage = string.Empty;
string pixelcideMessage = string.Empty;
Expand Down Expand Up @@ -430,7 +431,7 @@ public void Render(GraphicsDevice graphicsDevice)
if (_P.screenEffectCounter >= 2)
{
string deathMessage = string.Empty;
if(_P.inputEngine.ControlType == ControlType.KeyboardMouse)
if (_P.inputEngine.ControlType == ControlType.KeyboardMouse)
{
deathMessage = "You have died. Left click to respawn.";
}
Expand Down Expand Up @@ -458,10 +459,18 @@ public void Render(GraphicsDevice graphicsDevice)
}

// Draw the help screen.
if (Keyboard.GetState().IsKeyDown(Keys.F1))
if (_P.inputEngine.ShowHelpButton.Check())
{
spriteBatch.Draw(texBlank, new Rectangle(0, 0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height), Color.Black);
spriteBatch.Draw(texHelp, drawRect, Color.White);

if (_P.inputEngine.ControlType == ControlType.KeyboardMouse)
{
spriteBatch.Draw(texHelpKeyboardMouse, drawRect, Color.White);
}
else
{
spriteBatch.Draw(texHelpGamePad, drawRect, Color.White);
}
}

spriteBatch.End();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public override string OnUpdate(GameTime gameTime, KeyboardState keyState, Mouse
///////////////////////////////////////////////////////////////////
/// Check if player want to quit match or commit pixelcide
///////////////////////////////////////////////////////////////////
if (_P.inputEngine.SelectButton.Check())
if (_P.inputEngine.ShowHelpButton.Check())
{
if (_P.inputEngine.QuitButton.Pressed())
{
Expand Down

0 comments on commit 0b85ca3

Please sign in to comment.