diff --git a/Adventures in Lestoria/CharacterMenuWindow.cpp b/Adventures in Lestoria/CharacterMenuWindow.cpp index 18c41f88..106a0eb1 100644 --- a/Adventures in Lestoria/CharacterMenuWindow.cpp +++ b/Adventures in Lestoria/CharacterMenuWindow.cpp @@ -254,12 +254,14 @@ void Menu::InitializeCharacterMenuWindow(){ if(Menu::UsingMouseNavigation()){ equipList->HandleOutsideDisabledButtonSelection(*itemEquipped); } + data.menu.I(A::ITEM_SLOT)=equipList->GetComponentIndex(*itemEquipped); }else if(equipmentList.size()>0){ data.menu.SetSelection(equipmentList[0],true,true); if(Menu::UsingMouseNavigation()){ equipList->HandleOutsideDisabledButtonSelection(equipmentList[0]); } + data.menu.I(A::ITEM_SLOT)=0; }else{ data.menu.SetSelection("Equip Selection Select Button"sv); } @@ -267,7 +269,6 @@ void Menu::InitializeCharacterMenuWindow(){ return true; },[](MenuFuncData data){//On Mouse Hover EquipSlot slot=DYNAMIC_POINTER_CAST(data.component.lock())->GetSlot(); - data.menu.I(A::ITEM_SLOT)=int(slot); const std::weak_ptrequip=Inventory::GetEquip(slot); if(!ISBLANK(equip)){ Component(data.component.lock()->parentMenu,"Character Rotating Display")->Disable(); @@ -319,10 +320,49 @@ void Menu::InitializeCharacterMenuWindow(){ returnData=std::format("Equip Slot {}",slotNames[0]); }, { //Button Key + {{game->KEY_SHOULDER,Pressed},{"Scroll",[](MenuType type){}}}, + {{game->KEY_SCROLL,Analog},{"Scroll",[](MenuType type){}}}, {game->KEY_BACK,{"Back",[](MenuType type){ - Component(type,"Back button")->Click(); + if(!Menu::menus[type]->GetSelection().expired()&& + !Menu::menus[type]->GetSelection().lock()->parentComponent.expired()&& + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->GetName()=="Equip List"){ + Component(type,"Equip Selection Select Button")->Click(); + }else{ + Component(type,"Back button")->Click(); + } }}}, {game->KEY_CONFIRM,{"Select",[](MenuType type){}}}, + {{game->KEY_SCROLLVERT,Analog,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + if(!Menu::menus[type]->GetSelection().expired()&& + !Menu::menus[type]->GetSelection().lock()->parentComponent.expired()&& + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->GetName()=="Equip List"){ + float scrollAmt=0.f; + if(game->KEY_SCROLLVERT.AnalogDAS()>0.f)scrollAmt=1.f; + else if(game->KEY_SCROLLVERT.AnalogDAS()<0.f)scrollAmt=-1.f; + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->IncreaseSelectionIndex(scrollAmt); + } + }}}, + {{game->KEY_FASTSCROLLUP,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + if(!Menu::menus[type]->GetSelection().expired()&& + !Menu::menus[type]->GetSelection().lock()->parentComponent.expired()&& + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->GetName()=="Equip List"){ + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->IncreaseSelectionIndex(-3.f); + } + }}}, + {{game->KEY_FASTSCROLLDOWN,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + if(!Menu::menus[type]->GetSelection().expired()&& + !Menu::menus[type]->GetSelection().lock()->parentComponent.expired()&& + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->GetName()=="Equip List"){ + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->IncreaseSelectionIndex(3.f); + } + }}}, + {{game->KEY_FASTSCROLLUP,PressedDAS,InputEngageGroup::NOT_VISIBLE},{"Scroll",[](MenuType type){ + if(!Menu::menus[type]->GetSelection().expired()&& + !Menu::menus[type]->GetSelection().lock()->parentComponent.expired()&& + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->GetName()=="Equip List"){ + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->IncreaseSelectionIndex(-3.f); + } + }}}, } ,{ //Button Navigation Rules {"Equip List",{ @@ -330,16 +370,24 @@ void Menu::InitializeCharacterMenuWindow(){ if(!Menu::menus[type]->GetSelection().expired()){ auto selection=Menu::menus[type]->GetSelection().lock(); size_t index=Component(type,"Equip List")->GetComponentIndex(selection); - index=std::clamp(index-1,size_t(0),Component(type,"Equip List")->GetComponents().size()-1); - returnData=Component(type,"Equip List")->GetComponents()[index]; + index--; + if(index>=Component(type,"Equip List")->GetComponents().size()){ + returnData="Equip Selection Select Button"; + }else{ + returnData=Component(type,"Equip List")->GetComponents()[index]; + } } }, .down=[](MenuType type,Data&returnData){ if(!Menu::menus[type]->GetSelection().expired()){ auto selection=Menu::menus[type]->GetSelection().lock(); size_t index=Component(type,"Equip List")->GetComponentIndex(selection); - index=std::clamp(index+1,size_t(0),Component(type,"Equip List")->GetComponents().size()-1); - returnData=Component(type,"Equip List")->GetComponents()[index]; + index++; + if(index>=Component(type,"Equip List")->GetComponents().size()){ + returnData="Equip Selection Select Button"; + }else{ + returnData=Component(type,"Equip List")->GetComponents()[index]; + } } }, .left=[](MenuType type,Data&returnData){ @@ -378,8 +426,12 @@ void Menu::InitializeCharacterMenuWindow(){ {std::format("Equip Slot {}", slotNames[0]),{ .up="Back button", .down=std::format("Equip Slot {}", slotNames[2]), - .left=[](MenuType type,Data&returnData){ - Menu::menus[type]->SetSelection(Component(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); + .left=[&](MenuType type,Data&returnData){ + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[1]); + } }, .right=std::format("Equip Slot {}", slotNames[1]),}}, {std::format("Equip Slot {}", slotNames[1]),{ @@ -387,13 +439,21 @@ void Menu::InitializeCharacterMenuWindow(){ .down=std::format("Equip Slot {}", slotNames[3]), .left=std::format("Equip Slot {}", slotNames[0]), .right=[](MenuType type,Data&returnData){ - Menu::menus[type]->SetSelection(Component(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[0]); + } },}}, {std::format("Equip Slot {}", slotNames[2]),{ .up=std::format("Equip Slot {}", slotNames[0]), .down=std::format("Equip Slot {}", slotNames[4]), .left=[](MenuType type,Data&returnData){ - Menu::menus[type]->SetSelection(Component(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[3]); + } }, .right=std::format("Equip Slot {}", slotNames[3]),}}, {std::format("Equip Slot {}", slotNames[3]),{ @@ -401,40 +461,63 @@ void Menu::InitializeCharacterMenuWindow(){ .down=std::format("Equip Slot {}", slotNames[5]), .left=std::format("Equip Slot {}", slotNames[2]), .right=[](MenuType type,Data&returnData){ - Menu::menus[type]->SetSelection(Component(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[2]); + } },}}, {std::format("Equip Slot {}", slotNames[4]),{ .up=std::format("Equip Slot {}", slotNames[2]), .down=std::format("Equip Slot {}", slotNames[6]), .left=[](MenuType type,Data&returnData){ - Menu::menus[type]->SetSelection(Component(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[5]); + } }, - .right=std::format("Equip Slot {}", slotNames[5]),}}, + .right=std::format("Equip Slot {}", slotNames[5]), + }}, {std::format("Equip Slot {}", slotNames[5]),{ .up=std::format("Equip Slot {}", slotNames[3]), .down=std::format("Equip Slot {}", slotNames[7]), .left=std::format("Equip Slot {}", slotNames[4]), .right=[](MenuType type,Data&returnData){ - std::format("Equip Slot {}", slotNames[4]); + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[4]); + } },}}, {std::format("Equip Slot {}", slotNames[6]),{ .up=std::format("Equip Slot {}", slotNames[4]), .down="Back button", - .left=std::format("Equip Slot {}", slotNames[7]), - .right=std::format("Equip Slot {}", slotNames[7]),}}, + .left=[](MenuType type,Data&returnData){ + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[7]); + } + }, + .right=std::format("Equip Slot {}",slotNames[7]), + }}, {std::format("Equip Slot {}", slotNames[7]),{ .up=std::format("Equip Slot {}", slotNames[5]), .down="Back button", - .left=[](MenuType type,Data&returnData){ - Menu::menus[type]->SetSelection(Component(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); - }, - .right=std::format("Equip Slot {}", slotNames[6]),}}, + .left=std::format("Equip Slot {}",slotNames[6]), + .right=[](MenuType type,Data&returnData){ + if(equipmentWindowOpened){ + returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; + }else{ + returnData=std::format("Equip Slot {}",slotNames[6]); + } + },}}, {"Back button",{ .up=std::format("Equip Slot {}", slotNames[7]), .down=std::format("Equip Slot {}", slotNames[0]), .left=std::format("Equip Slot {}", slotNames[7]), - .right=[](MenuType type,Data&returnData){ - Menu::menus[type]->SetSelection(Component(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); - },}}, + .right=std::format("Equip Slot {}",slotNames[6]), + }}, }); } \ No newline at end of file diff --git a/Adventures in Lestoria/MenuType.h b/Adventures in Lestoria/MenuType.h index 04f2b29e..a58de4b3 100644 --- a/Adventures in Lestoria/MenuType.h +++ b/Adventures in Lestoria/MenuType.h @@ -41,7 +41,7 @@ enum MenuType{ /////////////////////////////////////////////////////////// /*DO NOT REMOVE!!*/ENUM_START,/////////////////////////////// /////////////////////////////////////////////////////////// - // 34% Controller Compatibility. (100 total items, 4 items per menu * 25 menus) + // 36% 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 @@ -50,7 +50,7 @@ enum MenuType{ ITEM_LOADOUT, //100% Controller Compatibility LEVEL_COMPLETE, //100% Controller Compatibility OVERWORLD_MENU, //100% Controller Compatibility - CHARACTER_MENU, //50% Controller Compatibility + CHARACTER_MENU, //100% Controller Compatibility INVENTORY, //0% Controller Compatibility MERCHANT, //0% Controller Compatibility BUY_ITEM, //0% Controller Compatibility diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index cb8e32de..c5ea9e03 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 7170 +#define VERSION_BUILD 7187 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Interface.txt b/Adventures in Lestoria/assets/config/Interface.txt index e20b841a..c5ccf5ee 100644 --- a/Adventures in Lestoria/assets/config/Interface.txt +++ b/Adventures in Lestoria/assets/config/Interface.txt @@ -1,10 +1,10 @@ Interface { # How long to wait for the first initial delay auto shift to occur. - InitialScrollDelay = 0.4s + InitialScrollDelay = 0.6s # How long to wait for subsequent scrolling through menu items. - ScrollDelay = 0.2s + ScrollDelay = 0.3s # Scroll speed for ScrollableWindowComponents in pixels/sec AnalogScrollSpeed = 220 diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 4712f184..4d157155 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ