diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 8f3675c9..3493afbc 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -115,11 +115,14 @@ InputGroup AiL::KEY_UNEQUIP; InputGroup AiL::KEY_SCROLLDOWN; InputGroup AiL::KEY_SCROLLUP; +InputGroup AiL::KEY_FASTSCROLLDOWN; +InputGroup AiL::KEY_FASTSCROLLUP; InputGroup AiL::KEY_SCROLLLEFT; InputGroup AiL::KEY_SCROLLRIGHT; InputGroup AiL::KEY_SCROLLHORZ; InputGroup AiL::KEY_SCROLLVERT; InputGroup AiL::KEY_SCROLL; +InputGroup AiL::KEY_SHOULDER; InputGroup AiL::KEY_CHANGE_LOADOUT; #ifndef __EMSCRIPTEN__ @@ -2490,16 +2493,16 @@ void AiL::InitializeDefaultKeybinds(){ KEY_MENU.AddKeybind({KEY,ESCAPE}); KEY_MENU.AddKeybind({CONTROLLER,static_cast(GPButtons::START)}); - KEY_SCROLLUP.AddKeybind({KEY,Q}); - KEY_SCROLLUP.AddKeybind({KEY,PGUP}); - KEY_SCROLLUP.AddKeybind({KEY,NP8}); - KEY_SCROLLUP.AddKeybind({CONTROLLER,static_cast(GPButtons::L1)}); - KEY_SCROLLUP.AddKeybind({CONTROLLER,static_cast(GPButtons::L2)}); - KEY_SCROLLDOWN.AddKeybind({KEY,E}); - KEY_SCROLLDOWN.AddKeybind({KEY,PGDN}); - KEY_SCROLLDOWN.AddKeybind({KEY,NP2}); - KEY_SCROLLDOWN.AddKeybind({CONTROLLER,static_cast(GPButtons::R1)}); - KEY_SCROLLDOWN.AddKeybind({CONTROLLER,static_cast(GPButtons::R2)}); + KEY_FASTSCROLLUP.AddKeybind({KEY,Q}); + KEY_FASTSCROLLUP.AddKeybind({KEY,PGUP}); + KEY_FASTSCROLLUP.AddKeybind({KEY,NP8}); + KEY_FASTSCROLLUP.AddKeybind({CONTROLLER,static_cast(GPButtons::L1)}); + KEY_FASTSCROLLUP.AddKeybind({CONTROLLER,static_cast(GPButtons::L2)}); + KEY_FASTSCROLLDOWN.AddKeybind({KEY,E}); + KEY_FASTSCROLLDOWN.AddKeybind({KEY,PGDN}); + KEY_FASTSCROLLDOWN.AddKeybind({KEY,NP2}); + KEY_FASTSCROLLDOWN.AddKeybind({CONTROLLER,static_cast(GPButtons::R1)}); + KEY_FASTSCROLLDOWN.AddKeybind({CONTROLLER,static_cast(GPButtons::R2)}); KEY_CHANGE_LOADOUT.AddKeybind({KEY,X}); KEY_CHANGE_LOADOUT.AddKeybind({CONTROLLER,static_cast(GPButtons::FACE_U)}); @@ -2523,6 +2526,9 @@ void AiL::InitializeDefaultKeybinds(){ KEY_SCROLLHORZ.AddKeybind({ANALOG,static_cast(GPAxes::RX)}); KEY_SCROLL.AddKeybind({ANALOG,static_cast(GPAxes::ALL)}); + KEY_SHOULDER.AddKeybind({KEY,SHOULDER}); + KEY_SHOULDER.AddKeybind({CONTROLLER,static_cast(GPButtons::SHOULDER)}); + KEY_UNEQUIP.AddKeybind({KEY,R}); KEY_UNEQUIP.AddKeybind({CONTROLLER,static_cast(GPButtons::FACE_U)}); diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 52482b79..35094b1b 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -86,6 +86,8 @@ public: static InputGroup KEY_START; static InputGroup KEY_SELECT; + static InputGroup KEY_FASTSCROLLDOWN; + static InputGroup KEY_FASTSCROLLUP; static InputGroup KEY_SCROLLDOWN; static InputGroup KEY_SCROLLUP; static InputGroup KEY_SCROLLLEFT; @@ -93,6 +95,7 @@ public: static InputGroup KEY_SCROLLHORZ; static InputGroup KEY_SCROLLVERT; static InputGroup KEY_SCROLL; + static InputGroup KEY_SHOULDER; static InputGroup KEY_CHANGE_LOADOUT; static float SIZE_CHANGE_SPEED; diff --git a/Adventures in Lestoria/InputHelper.cpp b/Adventures in Lestoria/InputHelper.cpp index c9845980..779e2fbd 100644 --- a/Adventures in Lestoria/InputHelper.cpp +++ b/Adventures in Lestoria/InputHelper.cpp @@ -47,7 +47,9 @@ InputHelper::InputHelper(){} void InputHelper::Initialize(MenuInputGroups&inputGroups){ for(auto&data:inputGroups){ - this->inputGroups[data.first.GetGroup()]=data.second.first; + if(data.first.GetLabelVisible()){ //If the label is not visible, we don't care to include it in our list. + this->inputGroups[data.first.GetGroup()]=data.second.first; + } } } diff --git a/Adventures in Lestoria/Key.cpp b/Adventures in Lestoria/Key.cpp index 11600ce8..02ce1a89 100644 --- a/Adventures in Lestoria/Key.cpp +++ b/Adventures in Lestoria/Key.cpp @@ -481,6 +481,7 @@ std::map,GenericKey::KeyInfo> GenericKey::keyLiteral={ {{KEY, OEM_8},{"\\"}}, {{KEY, CAPS_LOCK},{"CAP LK"}}, {{KEY, olc::ENUM_END},{""}}, + {{KEY, SHOULDER},{"Q-E","themes/button_qe.png"}}, {{MOUSE, Mouse::LEFT},{"L.MOUSE"}}, {{MOUSE, Mouse::RIGHT},{"R.MOUSE"}}, {{MOUSE, Mouse::MIDDLE},{"M.MOUSE"}}, @@ -500,6 +501,7 @@ std::map,GenericKey::KeyInfo> GenericKey::keyLiteral={ {{CONTROLLER, static_cast(GPButtons::DPAD_R)},{"RIGHT"}}, {{CONTROLLER, static_cast(GPButtons::DPAD_U)},{"UP"}}, {{CONTROLLER, static_cast(GPButtons::DPAD_D)},{"DOWN"}}, + {{CONTROLLER, static_cast(GPButtons::SHOULDER)},{"L1-R1","themes/button_r1l1.png"}}, {{ANALOG, static_cast(GPAxes::LY)},{"Up/Down","themes/button_analogstick_vert.png"}}, {{ANALOG, static_cast(GPAxes::RY)},{"Up/Down","themes/button_analogstick_vert.png"}}, {{ANALOG, static_cast(GPAxes::LX)},{"Right/Left","themes/button_analogstick_horz.png"}}, @@ -589,8 +591,8 @@ const bool operator==(const Input&input1,const Input&input2){ return input1.type==input2.type&&input1.key==input2.key; } -InputEngageGroup::InputEngageGroup(InputGroup&group,EngageType type) - :group(group),type(type){} +InputEngageGroup::InputEngageGroup(InputGroup&group,EngageType type,const bool labelVisible) + :group(group),type(type),labelVisible(labelVisible){} const InputEngageGroup::EngageType InputEngageGroup::GetEngageType()const{ @@ -653,4 +655,8 @@ void InputListener::Update(){ const int Input::GetKeyCode()const{ return key; +} + +const bool InputEngageGroup::GetLabelVisible()const{ + return labelVisible; } \ No newline at end of file diff --git a/Adventures in Lestoria/Key.h b/Adventures in Lestoria/Key.h index 09b88d95..6a31d86f 100644 --- a/Adventures in Lestoria/Key.h +++ b/Adventures in Lestoria/Key.h @@ -121,8 +121,11 @@ public: class InputEngageGroup{ public: + static const bool VISIBLE=true; + static const bool NOT_VISIBLE=false; enum EngageType{ Pressed, + PressedDAS, Held, Released, Analog, @@ -130,11 +133,13 @@ public: private: InputGroup&group; EngageType type; + bool labelVisible; public: - InputEngageGroup(InputGroup&group,EngageType type=Released); + InputEngageGroup(InputGroup&group,EngageType type=Released,const bool labelVisible=true); const EngageType GetEngageType()const; InputGroup&GetGroup()const; const InputEngageGroup operator=(const InputEngageGroup&rhs); + const bool GetLabelVisible()const; }; class GenericKey{ diff --git a/Adventures in Lestoria/LoadGameWindow.cpp b/Adventures in Lestoria/LoadGameWindow.cpp index 0e1ee4e6..42a474f1 100644 --- a/Adventures in Lestoria/LoadGameWindow.cpp +++ b/Adventures in Lestoria/LoadGameWindow.cpp @@ -98,7 +98,17 @@ void Menu::InitializeLoadGameWindow(){ {{game->KEY_BACK},{"Back to Title Screen",[](MenuType type){ Component(type,"Go Back Button")->Click(); }}}, + {{game->KEY_CONFIRM},{"Load",[](MenuType type){}}}, {{game->KEY_SCROLLVERT,Analog},{"Scroll",[](MenuType type){}}}, + {{game->KEY_SHOULDER,Pressed},{"Scroll",[](MenuType type){}}}, + {{game->KEY_FASTSCROLLDOWN,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + auto gameFilesList=Component(type,"Game Files List"); + gameFilesList->IncreaseSelectionIndex(3.f); + }}}, + {{game->KEY_FASTSCROLLUP,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + auto gameFilesList=Component(type,"Game Files List"); + gameFilesList->IncreaseSelectionIndex(-3.f); + }}}, } ,{ //Button Navigation Rules {"Game Files List",{ diff --git a/Adventures in Lestoria/MainMenuWindow.cpp b/Adventures in Lestoria/MainMenuWindow.cpp index 186fbf63..f090a93e 100644 --- a/Adventures in Lestoria/MainMenuWindow.cpp +++ b/Adventures in Lestoria/MainMenuWindow.cpp @@ -74,8 +74,8 @@ void Menu::InitializeMainMenuWindow(){ } }, { //Button Key - {game->KEY_CONFIRM,{"Select",[](MenuType type){}}}, {game->KEY_BACK,{"Back",[](MenuType type){}}}, + {game->KEY_CONFIRM,{"Select",[](MenuType type){}}}, } ,{ //Button Navigation Rules {"New Game Button",{ diff --git a/Adventures in Lestoria/Menu.cpp b/Adventures in Lestoria/Menu.cpp index 483addb1..20b0b494 100644 --- a/Adventures in Lestoria/Menu.cpp +++ b/Adventures in Lestoria/Menu.cpp @@ -312,6 +312,9 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ case Pressed:{ activated=input.GetGroup().Pressed(); }break; + case PressedDAS:{ + activated=input.GetGroup().PressedDAS(); + }break; case Held:{ activated=input.GetGroup().Held(); }break; diff --git a/Adventures in Lestoria/ScrollableWindowComponent.h b/Adventures in Lestoria/ScrollableWindowComponent.h index 90aad62e..b180b77c 100644 --- a/Adventures in Lestoria/ScrollableWindowComponent.h +++ b/Adventures in Lestoria/ScrollableWindowComponent.h @@ -59,7 +59,6 @@ protected: vf2d targetScrollOffset{}; float lastScrollUpdate=0.f; float selectionIndex=0.f; - int selectionSkipIncrement=1; //How many items are on each row. This determines the increments that we skip by while scrolling. protected: inline bool OnScreen(std::weak_ptrcomponent){ return geom2d::overlaps(geom2d::rect{{},rect.size},geom2d::rect{component.lock()->rect.pos+vf2d{2,2},component.lock()->rect.size-vf2d{2,2}}); @@ -105,6 +104,12 @@ public: return geom2d::overlaps(geom2d::rect{Menu::menus[parentMenu]->pos+rect.pos,rect.size},game->GetMousePos())&& //Make sure the mouse is inside the parent window component first.... geom2d::overlaps(geom2d::rect{Menu::menus[parentMenu]->pos+rect.pos+child->rect.pos,child->rect.size},game->GetMousePos()); } + + inline void IncreaseSelectionIndex(const float val){ + float prevIndex=selectionIndex; + selectionIndex=std::clamp(selectionIndex+val,0.f,float(components.size()-1)); + if(size_t(prevIndex)!=size_t(selectionIndex)){Menu::menus[parentMenu]->SetSelection(components[size_t(selectionIndex)],false);} + } protected: virtual inline vf2d GetScrollAmount()const{ return scrollOffset; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 164fc87f..65dca823 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 6933 +#define VERSION_BUILD 6936 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/gfx/gfx.txt b/Adventures in Lestoria/assets/config/gfx/gfx.txt index a6ea0389..e8a7b797 100644 --- a/Adventures in Lestoria/assets/config/gfx/gfx.txt +++ b/Adventures in Lestoria/assets/config/gfx/gfx.txt @@ -60,6 +60,9 @@ Images GFX_Button_Face_L2 = themes/button_l2.png GFX_Button_Face_R1 = themes/button_r1.png GFX_Button_Face_R2 = themes/button_r2.png + GFX_Button_SHOULDER_QE = themes/button_qe.png + GFX_Button_SHOULDER_L1R1 = themes/button_r1l1.png + GFX_Button_AnalogStick = themes/button_analogstick.png GFX_Overworld_Arrow = overworld_arrow.png GFX_Exclamation = exclamation.png GFX_Ursule2 = monsters/Ursule Mother of Bears2.png diff --git a/Adventures in Lestoria/assets/themes/button_qe.png b/Adventures in Lestoria/assets/themes/button_qe.png new file mode 100644 index 00000000..b66bc18c Binary files /dev/null and b/Adventures in Lestoria/assets/themes/button_qe.png differ diff --git a/Adventures in Lestoria/assets/themes/button_r1l1.png b/Adventures in Lestoria/assets/themes/button_r1l1.png new file mode 100644 index 00000000..4ad729fb Binary files /dev/null and b/Adventures in Lestoria/assets/themes/button_r1l1.png differ diff --git a/Adventures in Lestoria/olcPGEX_Gamepad.h b/Adventures in Lestoria/olcPGEX_Gamepad.h index 916359f8..5c7f5b33 100644 --- a/Adventures in Lestoria/olcPGEX_Gamepad.h +++ b/Adventures in Lestoria/olcPGEX_Gamepad.h @@ -139,7 +139,9 @@ namespace olc { DPAD_L = 14, DPAD_R = 15, DPAD_U = 16, - DPAD_D = 17 + DPAD_D = 17, + //UNREACHABLE ITEMS BELOW: + SHOULDER = 18, }; enum class GPAxes { @@ -151,6 +153,7 @@ namespace olc { TR = 3, DX = 6, DY = 7, + //UNREACHABLE ITEMS BELOW: ALL = 8, //This does not actually do anything, but is useful for detecting an icon for any analog stick control! }; #pragma endregion diff --git a/Adventures in Lestoria/olcPixelGameEngine.h b/Adventures in Lestoria/olcPixelGameEngine.h index c3345a3d..d9801224 100644 --- a/Adventures in Lestoria/olcPixelGameEngine.h +++ b/Adventures in Lestoria/olcPixelGameEngine.h @@ -650,7 +650,10 @@ namespace olc NP_MUL, NP_DIV, NP_ADD, NP_SUB, NP_DECIMAL, PERIOD, EQUALS, COMMA, MINUS, OEM_1, OEM_2, OEM_3, OEM_4, OEM_5, OEM_6, OEM_7, OEM_8, - CAPS_LOCK, ENUM_END + CAPS_LOCK, ENUM_END, + + //UNREACHABLE ITEMS BELOW: + SHOULDER, }; namespace Mouse