diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 8041c96f..6cdfa217 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -125,8 +125,10 @@ InputGroup AiL::KEY_FASTSCROLLUP; InputGroup AiL::KEY_SCROLLLEFT; InputGroup AiL::KEY_SCROLLRIGHT; InputGroup AiL::KEY_SCROLLHORZ; +InputGroup AiL::KEY_SCROLLHORZ_L; InputGroup AiL::KEY_SCROLLVERT; InputGroup AiL::KEY_SCROLLVERT_R; +InputGroup AiL::KEY_SCROLLVERT_L; InputGroup AiL::KEY_SCROLL; InputGroup AiL::KEY_SHOULDER; InputGroup AiL::KEY_CHANGE_LOADOUT; @@ -2513,7 +2515,7 @@ void AiL::InitializeDefaultKeybinds(){ KEY_CHANGE_LOADOUT.AddKeybind({KEY,R}); KEY_CHANGE_LOADOUT.AddKeybind({CONTROLLER,static_cast(GPButtons::FACE_U)}); - KEY_START.AddKeybind({KEY,RETURN}); + KEY_START.AddKeybind({KEY,SPACE}); KEY_START.AddKeybind({CONTROLLER,static_cast(GPButtons::START)}); KEY_SELECT.AddKeybind({KEY,ESCAPE}); KEY_SELECT.AddKeybind({CONTROLLER,static_cast(GPButtons::SELECT)}); @@ -2537,8 +2539,10 @@ void AiL::InitializeDefaultKeybinds(){ KEY_SCROLLDOWN.AddKeybind({ANALOG,static_cast(GPAxes::RY)}); KEY_SCROLLVERT.AddKeybind({ANALOG,static_cast(GPAxes::LY)}); KEY_SCROLLVERT.AddKeybind({ANALOG,static_cast(GPAxes::RY)}); + KEY_SCROLLVERT_L.AddKeybind({ANALOG,static_cast(GPAxes::LY)}); KEY_SCROLLVERT_R.AddKeybind({ANALOG,static_cast(GPAxes::RY)}); KEY_SCROLLHORZ.AddKeybind({ANALOG,static_cast(GPAxes::LX)}); + KEY_SCROLLHORZ_L.AddKeybind({ANALOG,static_cast(GPAxes::LX)}); KEY_SCROLLHORZ.AddKeybind({ANALOG,static_cast(GPAxes::RX)}); KEY_SCROLL.AddKeybind({KEY,ARROWS}); KEY_SCROLL.AddKeybind({ANALOG,static_cast(GPAxes::ALL)}); diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 3f6361fd..5cfaf0a6 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -98,8 +98,10 @@ public: static InputGroup KEY_SCROLLLEFT; static InputGroup KEY_SCROLLRIGHT; static InputGroup KEY_SCROLLHORZ; + static InputGroup KEY_SCROLLHORZ_L; static InputGroup KEY_SCROLLVERT; static InputGroup KEY_SCROLLVERT_R; + static InputGroup KEY_SCROLLVERT_L; static InputGroup KEY_SCROLL; static InputGroup KEY_SHOULDER; static InputGroup KEY_CHANGE_LOADOUT; diff --git a/Adventures in Lestoria/InventoryConsumableWindow.cpp b/Adventures in Lestoria/InventoryConsumableWindow.cpp index 3bb20fa8..8f7b5d48 100644 --- a/Adventures in Lestoria/InventoryConsumableWindow.cpp +++ b/Adventures in Lestoria/InventoryConsumableWindow.cpp @@ -107,11 +107,6 @@ void Menu::InitializeConsumableInventoryWindow(){ } }, { //Button Key - {game->KEY_CONFIRM,{"Set Loadout Item",[](MenuType type){}}}, - {game->KEY_BACK,{"Back",[](MenuType type){ - Menu::CloseMenu(); - }}}, - {{game->KEY_SCROLL,Analog},{"Scroll",[](MenuType type){}}}, {{game->KEY_SHOULDER,Pressed},{"Scroll",[](MenuType type){}}}, {{game->KEY_FASTSCROLLDOWN,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ auto itemsWindow=Component(type,"inventory"); @@ -123,6 +118,10 @@ void Menu::InitializeConsumableInventoryWindow(){ int invWidth=int((itemsWindow->rect.size.x-12)/(float(itemsWindow->options.size.x)+itemsWindow->options.padding)); itemsWindow->IncreaseSelectionIndex(invWidth*-3.f); }}}, + {game->KEY_BACK,{"Back",[](MenuType type){ + Menu::CloseMenu(); + }}}, + {game->KEY_CONFIRM,{"Set Loadout Item",[](MenuType type){}}}, } ,{ //Button Navigation Rules {"OK Button",{ diff --git a/Adventures in Lestoria/ItemLoadoutWindow.cpp b/Adventures in Lestoria/ItemLoadoutWindow.cpp index bd802a52..06e58db0 100644 --- a/Adventures in Lestoria/ItemLoadoutWindow.cpp +++ b/Adventures in Lestoria/ItemLoadoutWindow.cpp @@ -54,25 +54,67 @@ void Menu::InitializeItemLoadoutWindow(){ float buttonBorderPadding=64; - itemLoadoutWindow->ADD("Loadout Item 1",MenuItemItemButton)(geom2d::rect{{64,96},{48,48}},game->GetLoadoutItem(0),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=0; return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ + itemLoadoutWindow->ADD("Loadout Item 1",MenuItemItemButton)(geom2d::rect{{64,84},{48,48}},game->GetLoadoutItem(0),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=0; return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ Component(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); Component(ITEM_LOADOUT,"Item Description")->SetLabel(""); return true; },"Item Name Label","Item Description")END; - itemLoadoutWindow->ADD("Loadout Item 2",MenuItemItemButton)(geom2d::rect{{itemLoadoutWindowWidth/2-24,96},{48,48}},game->GetLoadoutItem(1),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=1;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ + itemLoadoutWindow->ADD("Loadout Item 2",MenuItemItemButton)(geom2d::rect{{itemLoadoutWindowWidth/2-24,84},{48,48}},game->GetLoadoutItem(1),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=1;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ Component(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); Component(ITEM_LOADOUT,"Item Description")->SetLabel(""); return true; },"Item Name Label","Item Description")END; - itemLoadoutWindow->ADD("Loadout Item 3",MenuItemItemButton)(geom2d::rect{{itemLoadoutWindowWidth-48-64,96},{48,48}},game->GetLoadoutItem(2),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=2;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ + itemLoadoutWindow->ADD("Loadout Item 3",MenuItemItemButton)(geom2d::rect{{itemLoadoutWindowWidth-48-64,84},{48,48}},game->GetLoadoutItem(2),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=2;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ Component(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); Component(ITEM_LOADOUT,"Item Description")->SetLabel(""); return true; },"Item Name Label","Item Description")END; - itemLoadoutWindow->ADD("Item Name Label",MenuLabel)(geom2d::rect{{0,158},{itemLoadoutWindowWidth,12}},"",1,ComponentAttr::SHADOW)END; - itemLoadoutWindow->ADD("Item Description",MenuLabel)(geom2d::rect{{0,170},{itemLoadoutWindowWidth,24}},"",1,ComponentAttr::SHADOW)END; + itemLoadoutWindow->ADD("Item Name Label",MenuLabel)(geom2d::rect{{0,146},{itemLoadoutWindowWidth,12}},"",1,ComponentAttr::SHADOW)END; + itemLoadoutWindow->ADD("Item Description",MenuLabel)(geom2d::rect{{0,158},{itemLoadoutWindowWidth,24}},"",1,ComponentAttr::SHADOW)END; - itemLoadoutWindow->ADD("Start Level Button",MenuComponent)(geom2d::rect{{itemLoadoutWindowWidth/2-32,214},{64,16}},"Start",[](MenuFuncData data){State_OverworldMap::StartLevel();return true;})END; + itemLoadoutWindow->ADD("Start Level Button",MenuComponent)(geom2d::rect{{itemLoadoutWindowWidth/2+32,202},{64,16}},"Start",[](MenuFuncData data){State_OverworldMap::StartLevel();return true;})END; + itemLoadoutWindow->ADD("Back Button",MenuComponent)(geom2d::rect{{itemLoadoutWindowWidth/2-96,202},{64,16}},"Back",[](MenuFuncData data){Menu::CloseMenu();return true;})END; + + itemLoadoutWindow->SetupKeyboardNavigation( + [](MenuType type,Data&returnData){ //On Open + returnData="Loadout Item 1"; + }, + { //Button Key + {game->KEY_START,{"Start Stage",[](MenuType type){ + Component(type,"Start Level Button")->Click(); + }}}, + {game->KEY_BACK,{"Back",[](MenuType type){ + Component(type,"Back Button")->Click(); + }}}, + {game->KEY_CONFIRM,{"Select",[](MenuType type){}}}, + } + ,{ //Button Navigation Rules + {"Loadout Item 1",{ + .up="Back Button", + .down="Back Button", + .left="Loadout Item 3", + .right="Loadout Item 2",}}, + {"Loadout Item 2",{ + .up="Start Level Button", + .down="Start Level Button", + .left="Loadout Item 1", + .right="Loadout Item 3",}}, + {"Loadout Item 3",{ + .up="Start Level Button", + .down="Start Level Button", + .left="Loadout Item 2", + .right="Loadout Item 1",}}, + {"Start Level Button",{ + .up="Loadout Item 3", + .down="Loadout Item 3", + .left="Back Button", + .right="Back Button",}}, + {"Back Button",{ + .up="Loadout Item 1", + .down="Loadout Item 1", + .left="Start Level Button", + .right="Start Level Button",}}, + }); } \ No newline at end of file diff --git a/Adventures in Lestoria/MenuType.h b/Adventures in Lestoria/MenuType.h index 614cf266..181c24da 100644 --- a/Adventures in Lestoria/MenuType.h +++ b/Adventures in Lestoria/MenuType.h @@ -41,13 +41,13 @@ enum MenuType{ /////////////////////////////////////////////////////////// /*DO NOT REMOVE!!*/ENUM_START,/////////////////////////////// /////////////////////////////////////////////////////////// - // 28% Controller Compatibility. (100 total items, 4 items per menu * 25 menus) + // 32% Controller Compatibility. (100 total items, 4 items per menu * 25 menus) INVENTORY_CONSUMABLES, //100% Controller Compatibility CLASS_INFO, //100% Controller Compatibility CLASS_SELECTION, //100% Controller Compatibility MAIN_MENU, //100% Controller Compatibility OVERWORLD_LEVEL_SELECT, //100% Controller Compatibility - Scrolling for keyboard? - ITEM_LOADOUT, //0% Controller Compatibility + ITEM_LOADOUT, //100% Controller Compatibility LEVEL_COMPLETE, //0% Controller Compatibility OVERWORLD_MENU, //0% Controller Compatibility CHARACTER_MENU, //0% Controller Compatibility @@ -60,7 +60,7 @@ enum MenuType{ CRAFT_CONSUMABLE, //0% Controller Compatibility CONSUMABLE_CRAFT_ITEM, //0% Controller Compatibility SAVE_FILE_NAME, //100% Controller Compatibility - LOAD_GAME, //75% Controller Compatibility + LOAD_GAME, //75% Controller Compatibility - Online Mode Tab switching USER_ID, //0% Controller Compatibility SETTINGS, //0% Controller Compatibility SHERMAN, //0% Controller Compatibility diff --git a/Adventures in Lestoria/State_OverworldMap.cpp b/Adventures in Lestoria/State_OverworldMap.cpp index f63dff1f..632669b3 100644 --- a/Adventures in Lestoria/State_OverworldMap.cpp +++ b/Adventures in Lestoria/State_OverworldMap.cpp @@ -100,15 +100,16 @@ void State_OverworldMap::OnUserUpdate(AiL*game){ #pragma region Handle Connection Point Clicking and Movement for(ConnectionPoint&cp:connections){ if(game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect) - ||game->KEY_LEFT.Pressed()||game->KEY_RIGHT.Pressed()||game->KEY_UP.Pressed()||game->KEY_DOWN.Pressed()){ + ||game->KEY_LEFT.Pressed()||game->KEY_RIGHT.Pressed()||game->KEY_UP.Pressed()||game->KEY_DOWN.Pressed() + ||(!analogMove&&(abs(game->KEY_SCROLLHORZ_L.Analog())>=0.2f||abs(game->KEY_SCROLLVERT_L.Analog())>=0.2f))){ bool mouseUsed=game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect); for(int directionInd=0;int neighborInd:currentConnectionPoint->neighbors){ int targetDirection=-1; - if(game->KEY_LEFT.Pressed())targetDirection=ConnectionPoint::WEST; - if(game->KEY_RIGHT.Pressed())targetDirection=ConnectionPoint::EAST; - if(game->KEY_UP.Pressed())targetDirection=ConnectionPoint::NORTH; - if(game->KEY_DOWN.Pressed())targetDirection=ConnectionPoint::SOUTH; + if(game->KEY_LEFT.Pressed()||game->KEY_SCROLLHORZ_L.Analog()<=-0.2f)targetDirection=ConnectionPoint::WEST; + if(game->KEY_RIGHT.Pressed()||game->KEY_SCROLLHORZ_L.Analog()>=0.2f)targetDirection=ConnectionPoint::EAST; + if(game->KEY_UP.Pressed()||game->KEY_SCROLLVERT_L.Analog()<=-0.2f)targetDirection=ConnectionPoint::NORTH; + if(game->KEY_DOWN.Pressed()||game->KEY_SCROLLVERT_L.Analog()>=0.2f)targetDirection=ConnectionPoint::SOUTH; if(neighborInd==-1){ directionInd++; @@ -132,6 +133,7 @@ void State_OverworldMap::OnUserUpdate(AiL*game){ }else{ game->GetPlayer()->UpdateWalkingAnimation(LEFT); } + if(abs(game->KEY_SCROLLHORZ_L.Analog())>=0.2f||abs(game->KEY_SCROLLVERT_L.Analog()>=0.2f))analogMove=true; goto doneNavigating; } directionInd++; @@ -140,7 +142,9 @@ void State_OverworldMap::OnUserUpdate(AiL*game){ } #pragma endregion doneNavigating: - int a; + if(abs(game->KEY_SCROLLVERT_L.Analog())<0.2f&&abs(game->KEY_SCROLLHORZ_L.Analog())<0.2f){ + analogMove=false; + } }; void State_OverworldMap::Draw(AiL*game){ currentTime+=game->GetElapsedTime(); diff --git a/Adventures in Lestoria/State_OverworldMap.h b/Adventures in Lestoria/State_OverworldMap.h index ad9a46a0..077c9563 100644 --- a/Adventures in Lestoria/State_OverworldMap.h +++ b/Adventures in Lestoria/State_OverworldMap.h @@ -46,6 +46,7 @@ class State_OverworldMap:public GameState{ float currentTime=0; vf2d playerTargetPos; const float playerMoveSpd=48.0; + bool analogMove=false; public: State_OverworldMap(); static std::vectorconnections; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index bd8bf68f..6a144c30 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 6993 +#define VERSION_BUILD 7005 #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 4c3e8fcb..ee32692b 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ