A long-overdue task, I decided to finally implement the basic settings and pause menu functionality right before continuing work on the attacks and adding the two unimplemented attacks into the game. The settings implemented at the moment are the ability to change the resolution and toggle between fullscreen and windowed mode. These are then saved using a save button and stored permanently in the player's settings config.
To implement resolution swapping, I placed three (although it could easily be scaled to include more) buttons in a vertical box that acts as a dropdown menu. The dropdown isĀ representing three 16:9 resolutions commonly used by games, being 1920x1080, 1280x720, and 960x540. The main reason behind including a resolution setting is to increase the number of devices that can run our game, as running a game at a lower resolution takes a lot less computer resources (primarily reducing the load on the GPU). Additionally, I added a toggle for fullscreen as resolution changes don't apply to windowed and windowless fullscreen apps. The way I made sure the player knew when an option is selected / toggled is by swapping between button background colours - setting default 'selected' and 'unselected' colours that can be globally applied to all buttons.
Implementing the pause menu was much easier and simpler. All I had to do was ensure that every pawn that the player uses (first person, combat, dodging, etc.) has the menu UI as a widget, then set up both buttons to either change the scene to the main menu (exit to menu) or close the game (exit game). Toggling the pause menu on and off is linked to the escape button using an Input Action, which is then linked up to the player controller's Input Mapping Context.
Implementing these two menu features was a both easy and simple, which is why I put it off for so long. I felt that doing them now would be helpful for testing, as rather than relaunching the entire game to reset progress, I can just exit to menu. This helps to speed up testing and debugging. As stated earlier, having even basic resolution settings helps to improve the game's accessibility for those with lower end machines by giving players an option to run the game at a lower resolution, with the small trade-off of making the game's UI bigger. This can be rectified at a later date by making a UI scale option and applying this to the rest of the UI, something I may do if I have the time towards the end of the project. If I have the time, I'd also like to refactor the code that actually controls the resolution drop-down menu to make it much easier to expand. Overall, I have little problem with how I've implemented these two features outside of potential UI issues.