Refactored analog control system to use digital DAS input system with directional input support.

This commit is contained in:
2024-02-09 22:48:49 -06:00
parent b0e9799624
commit ce46a1d3d7
14 changed files with 91 additions and 53 deletions
+1 -14
View File
@@ -81,17 +81,6 @@ void Menu::InitializeLoadGameWindow(){
onlineCharacterTab->SetSelectionType(HIGHLIGHT);
#endif
#pragma region ScrollWindow macro lambda
#define ScrollWindow(amount) \
[](MenuType type){ \
auto scrollWindow=Component<ScrollableWindowComponent>(type,"Game Files List"); \
scrollWindow->Scroll(amount); \
float scrollAmt=amount*game->GetElapsedTime()*"Interface.AnalogScrollSpeed"_F;\
/*Height of these buttons is 48.*/ \
scrollWindow->IncreaseSelectionIndex(scrollAmt/48.f); \
}
#pragma endregion
#pragma region Keyboard Navigation Rules
loadGameWindow->SetupKeyboardNavigation(
[](MenuType type,Data&returnData){ //On Open
@@ -109,9 +98,7 @@ void Menu::InitializeLoadGameWindow(){
{{game->KEY_BACK},{"Back to Title Screen",[](MenuType type){
Component<MenuComponent>(type,"Go Back Button")->Click();
}}},
{{game->KEY_SCROLL,Analog},{"Scroll",ScrollWindow(game->KEY_SCROLL.Analog())}},
{{game->KEY_SCROLLUP,Held},{"Scroll Up",ScrollWindow(-1.0f)}},
{{game->KEY_SCROLLDOWN,Held},{"Scroll Down",ScrollWindow(1.0f)}},
{{game->KEY_SCROLLVERT,Analog},{"Scroll",[](MenuType type){}}},
}
,{ //Button Navigation Rules
{"Game Files List",{