diff --git a/Adventures in Lestoria/InventoryConsumableWindow.cpp b/Adventures in Lestoria/InventoryConsumableWindow.cpp index 8f7b5d48..e9e0e70f 100644 --- a/Adventures in Lestoria/InventoryConsumableWindow.cpp +++ b/Adventures in Lestoria/InventoryConsumableWindow.cpp @@ -152,121 +152,166 @@ void Menu::InitializeConsumableInventoryWindow(){ }}, {"inventory",{ .up=[](MenuType type,Data&returnData){ - auto&selection=Menu::menus[type]->GetSelection(); - auto&itemsList=Component(type,"inventory")->GetComponents(); - auto itemsWindow=Component(type,"inventory"); - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); - if(itemsList.size()>0){ - if(component==itemsList.end()){ - //Set the selected button to the last element in the list. - returnData=itemsList.back(); - }else{ - int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); - std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); - int newRowIndex=selectedButton.lock()->inventoryIndex-invWidth; //Moving up moves the cursor up an entire row. - if(newRowIndex<0){ - //This means we have to wrap around. - returnData="OK Button"; - return; - } - if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - //Select the component that matches this new number. - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); - if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - returnData=*component; - } - }else{ + #pragma region Inventory Wrapping Handling Up Macros + //Make sure before using this you have #define SUBCLASS with the children class for this inventory scrollable window component! + #define DetectInventory(menuClass,menuType,inventoryComponentName) \ + auto&selection=Menu::menus[menuType]->GetSelection(); \ + auto&itemsList=Component(menuType,inventoryComponentName)->GetComponents(); \ + auto itemsWindow=Component(menuType,inventoryComponentName); \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); \ + if(itemsList.size()>0){ \ + if(component==itemsList.end()){ \ + /*Set the selected button to the last element in the list.*/ \ + returnData=itemsList.back(); \ + }else{ \ + int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); \ + std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); \ + int newRowIndex=selectedButton.lock()->inventoryIndex-invWidth; /*Moving up moves the cursor up an entire row.*/ \ + if(newRowIndex<0){ + #define DefaultBehavior \ + return; \ + } \ + if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + /*Select the component that matches this new number.*/ \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); \ + if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + returnData=*component; \ + } \ + } \ + else + #define DEFAULT_WRAPPING_BEHAVIOR newRowIndex=itemsList.size()-1; + #pragma endregion + #define SUBCLASS MenuItemButton + DetectInventory(InventoryScrollableWindowComponent,type,"inventory") + { //This means we have to wrap around. We have access to itemsList if we needed to point to a specific item in the inventory. + //By returning here, you are processing returnData yourself. Otherwise manipulate newRowIndex to point to an item in the itemsList when wrapping. + returnData="OK Button"; + return; + } + DefaultBehavior{ //When nothing is found... returnData="OK Button"; } }, .down=[](MenuType type,Data&returnData){ - auto&selection=Menu::menus[type]->GetSelection(); - auto&itemsList=Component(type,"inventory")->GetComponents(); - auto itemsWindow=Component(type,"inventory"); - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); - if(itemsList.size()>0){ - if(component==itemsList.end()){ - //Set the selected button to the first element in the list. - returnData=itemsList.front(); - }else{ - int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); - std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); - int newRowIndex=selectedButton.lock()->inventoryIndex+invWidth; //Moving down moves the cursor down an entire row. - if(newRowIndex>=itemsList.size()){ - int currentRow=newRowIndex/invWidth; - //The logic here is, if we clamp this row index to the last possible index and we're still on the same row, it means there is at least an item on this row. So we go to that instead. - newRowIndex=std::clamp(newRowIndex,0,int(itemsList.size()-1)); - int newRow=newRowIndex/invWidth; - if(currentRow!=newRow){ //This means we are on a different row, so the row we went down on didn't have any items. Simply drop down to the OK Button. - returnData="OK Button"; - return; - } - } - if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - //Select the component that matches this new number. - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); - if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - returnData=*component; - } - }else{ + #pragma region Inventory Wrapping Handling Down Macros + //Make sure before using this you have #define SUBCLASS with the children class for this inventory scrollable window component! + #define DetectInventory(menuClass,menuType,inventoryComponentName) \ + auto&selection=Menu::menus[menuType]->GetSelection(); \ + auto&itemsList=Component(menuType,inventoryComponentName)->GetComponents(); \ + auto itemsWindow=Component(menuType,inventoryComponentName); \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); \ + if(itemsList.size()>0){ \ + if(component==itemsList.end()){ \ + /*Set the selected button to the last element in the list.*/ \ + returnData=itemsList.front();\ + }else{ \ + int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); \ + std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); \ + int newRowIndex=selectedButton.lock()->inventoryIndex+invWidth; /*Moving down moves the cursor down an entire row.*/ \ + if(newRowIndex>=itemsList.size()){ \ + int currentRow=newRowIndex/invWidth; \ + /*The logic here is, if we clamp this row index to the last possible index and we're still on the same row, it means there is at least an item on this row. So we go to that instead.*/ \ + newRowIndex=std::clamp(newRowIndex,0,int(itemsList.size()-1)); \ + int newRow=newRowIndex/invWidth; \ + if(currentRow!=newRow) //This means we are on a different row, so the row we went down on didn't have any items. Simply drop down to the OK Button. + #define DefaultBehavior \ + } \ + if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + /*Select the component that matches this new number.*/ \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); \ + if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + returnData=*component; \ + } \ + } \ + else + #define DEFAULT_WRAPPING_BEHAVIOR newRowIndex=0; + #pragma endregion + #define SUBCLASS MenuItemButton + DetectInventory(InventoryScrollableWindowComponent,type,"inventory") + { //This means we have to wrap around. We have access to itemsList if we needed to point to a specific item in the inventory. + //By returning here, you are processing returnData yourself. Otherwise manipulate newRowIndex to point to an item in the itemsList when wrapping. + returnData="OK Button"; + return; + } + DefaultBehavior{ //When nothing is found... returnData="OK Button"; } }, .left=[](MenuType type,Data&returnData){ - auto&selection=Menu::menus[type]->GetSelection(); - auto&itemsList=Component(type,"inventory")->GetComponents(); - auto itemsWindow=Component(type,"inventory"); - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); - if(itemsList.size()>0){ - if(component==itemsList.end()){ - //Set the selected button to the last element in the list. - returnData=itemsList.back(); - }else{ - int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); - std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); - - int rowBaseIndex=(selectedButton.lock()->inventoryIndex/invWidth)*invWidth; - int newRowIndex=selectedButton.lock()->inventoryIndex-1; - if(newRowIndex=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - //Select the component that matches this new number. - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); - if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - returnData=*component; - } - }else{ + #pragma region Inventory Wrapping Handling Left Macros + #define DetectInventory(menuClass,menuType,inventoryComponentName) \ + auto&selection=Menu::menus[menuType]->GetSelection(); \ + auto&itemsList=Component(menuType,inventoryComponentName)->GetComponents(); \ + auto itemsWindow=Component(menuType,inventoryComponentName); \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); \ + if(itemsList.size()>0){ \ + if(component==itemsList.end()){ \ + /*Set the selected button to the last element in the list.*/ \ + returnData=itemsList.back(); \ + }else{ \ + int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); \ + std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); \ + int rowBaseIndex=(selectedButton.lock()->inventoryIndex/invWidth)*invWidth; \ + int newRowIndex=selectedButton.lock()->inventoryIndex-1; \ + if(newRowIndex=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + /*Select the component that matches this new number.*/ \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); \ + if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + returnData=*component; \ + } \ + }else + #define DEFAULT_WRAPPING_BEHAVIOR newRowIndex+=invWidth; + #pragma endregion + #define SUBCLASS MenuItemButton + DetectInventory(InventoryScrollableWindowComponent,type,"inventory") + { //This means we have to wrap around. We have access to itemsList if we needed to point to a specific item in the inventory. + //By returning here, you are processing returnData yourself. Otherwise manipulate newRowIndex to point to an item in the itemsList when wrapping. + DEFAULT_WRAPPING_BEHAVIOR; + } + DefaultBehavior{ //When nothing is found... returnData="OK Button"; } }, .right=[](MenuType type,Data&returnData){ - auto&selection=Menu::menus[type]->GetSelection(); - auto&itemsList=Component(type,"inventory")->GetComponents(); - auto itemsWindow=Component(type,"inventory"); - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); - if(itemsList.size()>0){ - if(component==itemsList.end()){ - //Set the selected button to the first element in the list. - returnData=itemsList.front(); - }else{ - int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); - std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); - - int rowBaseIndex=(selectedButton.lock()->inventoryIndex/invWidth)*invWidth; - int newRowIndex=selectedButton.lock()->inventoryIndex+1; - if(newRowIndex>rowBaseIndex+invWidth-1)newRowIndex-=invWidth; - newRowIndex=std::clamp(newRowIndex,0,int(itemsList.size()-1)); - if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - //Select the component that matches this new number. - auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); - if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); - returnData=*component; - } - }else{ + #pragma region Inventory Wrapping Handling Right Macros + #define DetectInventory(menuClass,menuType,inventoryComponentName) \ + auto&selection=Menu::menus[menuType]->GetSelection(); \ + auto&itemsList=Component(menuType,inventoryComponentName)->GetComponents(); \ + auto itemsWindow=Component(menuType,inventoryComponentName); \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); \ + if(itemsList.size()>0){ \ + if(component==itemsList.end()){ \ + /*Set the selected button to the last element in the list.*/ \ + returnData=itemsList.front(); \ + }else{ \ + int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); \ + std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); \ + int rowBaseIndex=(selectedButton.lock()->inventoryIndex/invWidth)*invWidth; \ + int newRowIndex=selectedButton.lock()->inventoryIndex+1; \ + if(newRowIndex>rowBaseIndex+invWidth-1) + #define DefaultBehavior \ + newRowIndex=std::clamp(newRowIndex,0,int(itemsList.size()-1)); \ + newRowIndex=std::min(int(itemsList.size())-1,newRowIndex); \ + if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + /*Select the component that matches this new number.*/ \ + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); \ + if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \ + returnData=*component; \ + } \ + }else + #define DEFAULT_WRAPPING_BEHAVIOR newRowIndex-=invWidth; + #pragma endregion + #define SUBCLASS MenuItemButton + DetectInventory(InventoryScrollableWindowComponent,type,"inventory") + { //This means we have to wrap around. We have access to itemsList if we needed to point to a specific item in the inventory. + //By returning here, you are processing returnData yourself. Otherwise manipulate newRowIndex to point to an item in the itemsList when wrapping. + DEFAULT_WRAPPING_BEHAVIOR; + } + DefaultBehavior{ //When nothing is found... returnData="OK Button"; } }, diff --git a/Adventures in Lestoria/Key.cpp b/Adventures in Lestoria/Key.cpp index 0449fa6b..e0bb59f1 100644 --- a/Adventures in Lestoria/Key.cpp +++ b/Adventures in Lestoria/Key.cpp @@ -262,14 +262,14 @@ const float InputGroup::Analog()const{ return 0.f; } -const float InputGroup::AnalogDAS(){ +const float InputGroup::AnalogDAS(const float threshold){ for(Input input:keys){ float analogVal=input.Analog(); - if(analogVal!=0.f&&initialHoldDownTime==0.f){ + if(abs(analogVal)>=threshold&&initialHoldDownTime==0.f){ initialHoldDownTime="Interface.InitialScrollDelay"_F; return analogVal; }else - if(analogVal!=0.f&&initialHoldDownTime>0.f){ + if(abs(analogVal)>=threshold&&initialHoldDownTime>0.f){ initialHoldDownTime-=game->GetElapsedTime(); if(initialHoldDownTime<=0.f){ holdDownTime="Interface.ScrollDelay"_F; @@ -277,7 +277,7 @@ const float InputGroup::AnalogDAS(){ } return 0.f; }else - if(analogVal!=0.f&&holdDownTime>0.f){ + if(abs(analogVal)>=threshold&&holdDownTime>0.f){ holdDownTime-=game->GetElapsedTime(); if(holdDownTime<=0.f){ holdDownTime="Interface.ScrollDelay"_F; diff --git a/Adventures in Lestoria/Key.h b/Adventures in Lestoria/Key.h index 8147f12b..d1918de8 100644 --- a/Adventures in Lestoria/Key.h +++ b/Adventures in Lestoria/Key.h @@ -113,7 +113,7 @@ public: const bool Held()const; const bool Released(); const float Analog()const; - const float AnalogDAS(); + const float AnalogDAS(const float threshold=0.2f); std::string GetDisplayName(); //Draws an input display with accompanying text centered at given position. void DrawInput(const std::variantrenderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha)const; diff --git a/Adventures in Lestoria/LevelCompleteWindow.cpp b/Adventures in Lestoria/LevelCompleteWindow.cpp index 295b7111..dbc3d69f 100644 --- a/Adventures in Lestoria/LevelCompleteWindow.cpp +++ b/Adventures in Lestoria/LevelCompleteWindow.cpp @@ -79,4 +79,77 @@ void Menu::InitializeLevelCompleteWindow(){ levelCompleteWindow->ADD("Stage Loot Popup Item Name",PopupMenuLabel)(geom2d::rect{{0,32},{windowSize.size.x-80.f,12}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; levelCompleteWindow->ADD("Stage Loot Popup Item Description",PopupMenuLabel)(geom2d::rect{{0,44},{windowSize.size.x-80.f,60}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; + + levelCompleteWindow->SetupKeyboardNavigation( + [](MenuType type,Data&returnData){ //On Open + auto monsterLoot=Component(type,"Monster Loot Window"); + auto stageLoot=Component(type,"Stage Loot Window"); + if(monsterLoot->GetComponents().size()>0){ + returnData=monsterLoot->GetComponents().front(); + }else + if(stageLoot->GetComponents().size()>0){ + returnData=stageLoot->GetComponents().front(); + }else{ + returnData="Next Button"; + } + }, + { //Button Key + {{game->KEY_SHOULDER,Pressed},{"Scroll",[](MenuType type){}}}, + {{game->KEY_FASTSCROLLDOWN,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + auto selection=Menu::menus[type]->GetSelection(); + if(!selection.expired()){ + auto parentComponent=DYNAMIC_POINTER_CAST(selection.lock()->parentComponent); + int invWidth=int((parentComponent->rect.size.x-12)/(float(parentComponent->options.size.x)+parentComponent->options.padding)); + parentComponent->IncreaseSelectionIndex(invWidth*3.f); + } + }}}, + {{game->KEY_FASTSCROLLUP,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + auto selection=Menu::menus[type]->GetSelection(); + if(!selection.expired()){ + auto parentComponent=DYNAMIC_POINTER_CAST(selection.lock()->parentComponent); + int invWidth=int((parentComponent->rect.size.x-12)/(float(parentComponent->options.size.x)+parentComponent->options.padding)); + parentComponent->IncreaseSelectionIndex(invWidth*-3.f); + } + }}}, + {game->KEY_SCROLL,{"View Items",[](MenuType type){}}}, + {game->KEY_START,{"Continue",[](MenuType type){}}}, + } + ,{ //Button Navigation Rules + {"Monster Loot Window",{ + .up=[](MenuType type,Data&returnData){ + auto&selection=Menu::menus[type]->GetSelection(); + auto&itemsList=Component(type,"Monster Loot Window")->GetComponents(); + auto itemsWindow=Component(type,"Monster Loot Window"); + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return comp.lock()==selection.lock();}); + if(itemsList.size()>0){ + if(component==itemsList.end()){ + //Set the selected button to the last element in the list. + returnData=itemsList.back(); + }else{ + int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); + std::weak_ptrselectedButton=DYNAMIC_POINTER_CAST(*component); + int newRowIndex=selectedButton.lock()->inventoryIndex-invWidth; //Moving up moves the cursor up an entire row. + if(newRowIndex<0){ + //This means we have to wrap around. + returnData="OK Button"; + return; + } + if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); + //Select the component that matches this new number. + auto component=std::find_if(itemsList.begin(),itemsList.end(),[&](auto&comp){return DYNAMIC_POINTER_CAST(comp)->inventoryIndex==newRowIndex;}); + if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); + returnData=*component; + } + }else{ + returnData="OK Button"; + } + }, + .down="Load Game Button",}}, + {"Load Game Button",{ + .up="New Game Button", + .down="Quit Game Button",}}, + {"Quit Game Button",{ + .up="Load Game Button", + .down="New Game Button",}}, + }); } \ No newline at end of file diff --git a/Adventures in Lestoria/Menu.cpp b/Adventures in Lestoria/Menu.cpp index 1ff558a1..a23e0107 100644 --- a/Adventures in Lestoria/Menu.cpp +++ b/Adventures in Lestoria/Menu.cpp @@ -346,7 +346,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ } if(navigationGroups.count(selectionButtonName)){ Navigation nav=navigationGroups[selectionButtonName]; - if(game->KEY_UP.PressedDAS()||game->KEY_SCROLLUP.AnalogDAS()<-0.2f){ + if(game->KEY_UP.PressedDAS()||game->KEY_SCROLLUP.AnalogDAS(0.5f)<-0.5f){ SetMouseNavigation(false); if(std::holds_alternative(nav.up)&&std::get(nav.up).length()>0)SetSelection(std::string_view(std::get(nav.up))); else @@ -356,7 +356,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ SetSelection(returnData); } } - if(game->KEY_DOWN.PressedDAS()||game->KEY_SCROLLDOWN.AnalogDAS()>0.2f){ + if(game->KEY_DOWN.PressedDAS()||game->KEY_SCROLLDOWN.AnalogDAS(0.5f)>0.5f){ SetMouseNavigation(false); if(std::holds_alternative(nav.down)&&std::get(nav.down).length()>0)SetSelection(std::string_view(std::get(nav.down))); else @@ -366,7 +366,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ SetSelection(returnData); } } - if(game->KEY_LEFT.PressedDAS()||game->KEY_SCROLLLEFT.AnalogDAS()<-0.2f){ + if(game->KEY_LEFT.PressedDAS()||game->KEY_SCROLLLEFT.AnalogDAS(0.5f)<-0.5f){ SetMouseNavigation(false); if(std::holds_alternative(nav.left)&&std::get(nav.left).length()>0)SetSelection(std::string_view(std::get(nav.left))); else @@ -376,7 +376,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ SetSelection(returnData); } } - if(game->KEY_RIGHT.PressedDAS()||game->KEY_SCROLLRIGHT.AnalogDAS()>0.2f){ + if(game->KEY_RIGHT.PressedDAS()||game->KEY_SCROLLRIGHT.AnalogDAS(0.5f)>0.5f){ SetMouseNavigation(false); if(std::holds_alternative(nav.right)&&std::get(nav.right).length()>0)SetSelection(std::string_view(std::get(nav.right))); else diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 6a144c30..34002381 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 7005 +#define VERSION_BUILD 7010 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index ee32692b..af66dc56 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ