From 21965b3c90bc7c5c552b5bd4caf267fbb9179888 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Wed, 17 Jan 2024 17:22:23 +0000 Subject: [PATCH] Save File Window navigation controls Co-authored-by: sigonasr2 --- .../AdventuresInLestoria.cpp | 6 ++++++ Adventures in Lestoria/AdventuresInLestoria.h | 4 ++++ Adventures in Lestoria/MainMenuWindow.cpp | 3 ++- Adventures in Lestoria/SaveFileWindow.cpp | 21 ++++++++++++++++++- Adventures in Lestoria/loc.sh | 0 5 files changed, 32 insertions(+), 2 deletions(-) mode change 100644 => 100755 Adventures in Lestoria/loc.sh diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 004f6b10..31e8263e 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -100,6 +100,7 @@ InputGroup AiL::KEY_MENU; InputGroup AiL::KEY_SCROLLUP; InputGroup AiL::KEY_SCROLLDOWN; InputGroup AiL::KEY_BACK; +InputGroup AiL::KEY_START; #ifndef __EMSCRIPTEN__ ::discord::Core*Discord{}; @@ -2394,6 +2395,11 @@ void AiL::InitializeDefaultKeybinds(){ KEY_SCROLLDOWN.AddKeybind({KEY,NP2}); KEY_SCROLLDOWN.AddKeybind({CONTROLLER,static_cast(GPButtons::R2)}); KEY_SCROLLDOWN.AddKeybind({CONTROLLER,static_cast(GPButtons::R1)}); + + KEY_START.AddKeybind({KEY,RETURN}); + KEY_START.AddKeybind({CONTROLLER,static_cast(GPButtons::START)}); + KEY_SELECT.AddKeybind({KEY,ESCAPE}); + KEY_SELECT.AddKeybind({CONTROLLER,static_cast(GPButtons::SELECT)}); } void AiL::SetBossNameDisplay(std::string name,float time){ diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 02c94c96..52bbe519 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -83,6 +83,10 @@ public: static InputGroup KEY_UP; static InputGroup KEY_DOWN; static InputGroup KEY_MENU; + + static InputGroup KEY_START; + static InputGroup KEY_SELECT; + static float SIZE_CHANGE_SPEED; double levelTime; Camera2D camera; diff --git a/Adventures in Lestoria/MainMenuWindow.cpp b/Adventures in Lestoria/MainMenuWindow.cpp index 350cd06d..b86ee43b 100644 --- a/Adventures in Lestoria/MainMenuWindow.cpp +++ b/Adventures in Lestoria/MainMenuWindow.cpp @@ -90,7 +90,8 @@ void Menu::InitializeMainMenuWindow(){ mainMenuWindow->SetupKeyboardNavigation( { - {game->KEY_BACK,{"",[](MenuType type){}}}, + {game->KEY_CONFIRM,{"Select",[](MenuType type){}}}, + {game->KEY_BACK,{"Back",[](MenuType type){}}}, } ,{ {"New Game Button",{ diff --git a/Adventures in Lestoria/SaveFileWindow.cpp b/Adventures in Lestoria/SaveFileWindow.cpp index 5112ebe1..524f661a 100644 --- a/Adventures in Lestoria/SaveFileWindow.cpp +++ b/Adventures in Lestoria/SaveFileWindow.cpp @@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Portions of this software are copyright © 2023 The FreeType +Portions of this software are copyright � 2023 The FreeType Project (www.freetype.org). Please see LICENSE_FT.txt for more information. All rights reserved. */ @@ -52,4 +52,23 @@ void Menu::InitializeSaveFileWindow(){ SaveFile::SaveGame(); return true; })END; + + + saveFileWindow->SetupKeyboardNavigation( + { + {game->KEY_START,{"Confirm Name",[](MenuType type){ + Component(type,"Continue Button")->Click(); + }}}, + {game->KEY_SELECT,{"Return to Title Screen",[](MenuType type){ + Component(type,"Back Button")->Click(); + }}}, + } + ,{ + {"Continue Button",{ + .left="Back Button", + .right="Back Button",}}, + {"Back Button",{ + .left="Continue Button", + .right="Continue Button",}}, + }); } \ No newline at end of file diff --git a/Adventures in Lestoria/loc.sh b/Adventures in Lestoria/loc.sh old mode 100644 new mode 100755