diff --git a/assets/images/help_menu.psd b/assets/images/help_menu.psd new file mode 100644 index 0000000..d67571e Binary files /dev/null and b/assets/images/help_menu.psd differ diff --git a/assets/images/xbox-controller-dark-mode.png b/assets/images/xbox-controller-dark-mode.png new file mode 100644 index 0000000..1d9a2a9 Binary files /dev/null and b/assets/images/xbox-controller-dark-mode.png differ diff --git a/assets/images/xbox-controller-dark-mode.svg b/assets/images/xbox-controller-dark-mode.svg new file mode 100644 index 0000000..0361da8 --- /dev/null +++ b/assets/images/xbox-controller-dark-mode.svg @@ -0,0 +1,181 @@ + +Xbox ControllerXbox Controller10/27/2023Christopher Whitley (@AristurtleDev)xboxcontrollerAn image of an xbox controllerBXYA diff --git a/assets/images/xbox-controller-light-mode.png b/assets/images/xbox-controller-light-mode.png new file mode 100644 index 0000000..676b668 Binary files /dev/null and b/assets/images/xbox-controller-light-mode.png differ diff --git a/assets/images/xbox-controller-light-mode.svg b/assets/images/xbox-controller-light-mode.svg new file mode 100644 index 0000000..7ae654c --- /dev/null +++ b/assets/images/xbox-controller-light-mode.svg @@ -0,0 +1,181 @@ + +Xbox ControllerXbox Controller10/27/2023Christopher Whitley (@AristurtleDev)xboxcontrollerAn image of an xbox controllerBXYA diff --git a/source/Infiniminer/Infiniminer.Client.Shared/.config/dotnet-tools.json b/source/Infiniminer/Infiniminer.Client.Shared/.config/dotnet-tools.json new file mode 100644 index 0000000..efabe22 --- /dev/null +++ b/source/Infiniminer/Infiniminer.Client.Shared/.config/dotnet-tools.json @@ -0,0 +1,36 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-mgcb": { + "version": "3.8.1.303", + "commands": [ + "mgcb" + ] + }, + "dotnet-mgcb-editor": { + "version": "3.8.1.303", + "commands": [ + "mgcb-editor" + ] + }, + "dotnet-mgcb-editor-linux": { + "version": "3.8.1.303", + "commands": [ + "mgcb-editor-linux" + ] + }, + "dotnet-mgcb-editor-windows": { + "version": "3.8.1.303", + "commands": [ + "mgcb-editor-windows" + ] + }, + "dotnet-mgcb-editor-mac": { + "version": "3.8.1.303", + "commands": [ + "mgcb-editor-mac" + ] + } + } +} \ No newline at end of file diff --git a/source/Infiniminer/Infiniminer.Client.Shared/Content/Content.Shared.mgcb b/source/Infiniminer/Infiniminer.Client.Shared/Content/Content.Shared.mgcb index 3c7b67c..ab50b8b 100644 --- a/source/Infiniminer/Infiniminer.Client.Shared/Content/Content.Shared.mgcb +++ b/source/Infiniminer/Infiniminer.Client.Shared/Content/Content.Shared.mgcb @@ -3,6 +3,7 @@ /outputDir:bin/$(Platform) /intermediateDir:obj/$(Platform) +/platform:Windows /config: /profile:Reach /compress:False @@ -12,7 +13,6 @@ #---------------------------------- Content ---------------------------------# - #begin blocks/tex_block_bank_back_blue.png /importer:TextureImporter /processor:TextureProcessor @@ -753,7 +753,19 @@ /processorParam:TextureFormat=Color /build:menus/tex_menu_class_red.png -#begin menus/tex_menu_help.png +#begin menus/tex_menu_help_gamepad.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:menus/tex_menu_help_gamepad.png + +#begin menus/tex_menu_help_keyboard_mouse.png /importer:TextureImporter /processor:TextureProcessor /processorParam:ColorKeyColor=255,0,255,255 @@ -763,7 +775,7 @@ /processorParam:ResizeToPowerOfTwo=False /processorParam:MakeSquare=False /processorParam:TextureFormat=Color -/build:menus/tex_menu_help.png +/build:menus/tex_menu_help_keyboard_mouse.png #begin menus/tex_menu_loading.png /importer:TextureImporter diff --git a/source/Infiniminer/Infiniminer.Client.Shared/Content/menus/tex_menu_help_gamepad.png b/source/Infiniminer/Infiniminer.Client.Shared/Content/menus/tex_menu_help_gamepad.png new file mode 100644 index 0000000..ad5886f Binary files /dev/null and b/source/Infiniminer/Infiniminer.Client.Shared/Content/menus/tex_menu_help_gamepad.png differ diff --git a/source/Infiniminer/Infiniminer.Client.Shared/Content/menus/tex_menu_help.png b/source/Infiniminer/Infiniminer.Client.Shared/Content/menus/tex_menu_help_keyboard_mouse.png similarity index 100% rename from source/Infiniminer/Infiniminer.Client.Shared/Content/menus/tex_menu_help.png rename to source/Infiniminer/Infiniminer.Client.Shared/Content/menus/tex_menu_help_keyboard_mouse.png diff --git a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs index f85b2b0..86a7477 100644 --- a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs +++ b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InputEngine.cs @@ -136,12 +136,19 @@ 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 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 SelectButton { get; private set; } + public VirtualButton ShowOptionsButton { get; private set; } /////////////////////////////////////////////////////////////////////////// /// Quit Button @@ -274,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 @@ -294,11 +303,18 @@ public InputEngine() SayToAll.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.Y)); // - // Select Button + // Show Help Button + // + ShowHelpButton = new VirtualButton(); + ShowHelpButton.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.F1)); + ShowHelpButton.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.Back)); + + // + // Show Options Button // - SelectButton = new VirtualButton(); - SelectButton.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.Escape)); - SelectButton.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.Back)); + ShowOptionsButton = new VirtualButton(); + ShowOptionsButton.Nodes.Add(new VirtualButton.Keyboard.Key(Keys.Escape)); + ShowOptionsButton.Nodes.Add(new VirtualButton.GamePad.Button(Buttons.Start)); // // Quit Button @@ -401,7 +417,7 @@ public void Register() ChangeClass.Register(); SayToTeam.Register(); SayToAll.Register(); - SelectButton.Register(); + ShowHelpButton.Register(); MenuUp.Register(); MenuDown.Register(); MenuLeft.Register(); @@ -429,7 +445,7 @@ public void Unregister() ChangeClass.Unregister(); SayToTeam.Unregister(); SayToAll.Unregister(); - SelectButton.Unregister(); + ShowHelpButton.Unregister(); MenuUp.Unregister(); MenuDown.Unregister(); MenuLeft.Unregister(); diff --git a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs index 759ff7a..c4ac83a 100644 --- a/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs +++ b/source/Infiniminer/Infiniminer.Client.Shared/Engines/InterfaceEngine.cs @@ -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; @@ -67,7 +67,8 @@ public InterfaceEngine(InfiniminerGame gameInstance) texRadarPlayerBelow = gameInstance.Content.Load("ui/tex_radar_player_below"); texRadarPlayerPing = gameInstance.Content.Load("ui/tex_radar_player_ping"); texRadarNorth = gameInstance.Content.Load("ui/tex_radar_north"); - texHelp = gameInstance.Content.Load("menus/tex_menu_help"); + texHelpKeyboardMouse = gameInstance.Content.Load("menus/tex_menu_help_keyboard_mouse"); + texHelpGamePad = gameInstance.Content.Load("menus/tex_menu_help_gamepad"); texToolRadarRed = gameInstance.Content.Load("tools/tex_tool_radar_red"); texToolRadarBlue = gameInstance.Content.Load("tools/tex_tool_radar_blue"); @@ -401,24 +402,35 @@ 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.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); } @@ -430,7 +442,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."; } @@ -458,10 +470,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(); diff --git a/source/Infiniminer/Infiniminer.Client.Shared/States/MainGameState.cs b/source/Infiniminer/Infiniminer.Client.Shared/States/MainGameState.cs index 5236827..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.SelectButton.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();