Added full controller compatibility for the character menu window. Release Build 7187.

pull/35/head
sigonasr2 10 months ago
parent 29005e366c
commit 783428dfa1
  1. 129
      Adventures in Lestoria/CharacterMenuWindow.cpp
  2. 4
      Adventures in Lestoria/MenuType.h
  3. 2
      Adventures in Lestoria/Version.h
  4. 4
      Adventures in Lestoria/assets/config/Interface.txt
  5. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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<EquipSlotButton>(data.component.lock())->GetSlot();
data.menu.I(A::ITEM_SLOT)=int(slot);
const std::weak_ptr<Item>equip=Inventory::GetEquip(slot);
if(!ISBLANK(equip)){
Component<CharacterRotatingDisplay>(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<MenuComponent>(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<MenuComponent>(type,"Equip Selection Select Button")->Click();
}else{
Component<MenuComponent>(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<ScrollableWindowComponent>(type,"Equip List")->GetComponentIndex(selection);
index=std::clamp(index-1,size_t(0),Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents().size()-1);
returnData=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[index];
index--;
if(index>=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents().size()){
returnData="Equip Selection Select Button";
}else{
returnData=Component<ScrollableWindowComponent>(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<ScrollableWindowComponent>(type,"Equip List")->GetComponentIndex(selection);
index=std::clamp(index+1,size_t(0),Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents().size()-1);
returnData=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[index];
index++;
if(index>=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents().size()){
returnData="Equip Selection Select Button";
}else{
returnData=Component<ScrollableWindowComponent>(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<ScrollableWindowComponent>(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<ScrollableWindowComponent>(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<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]);
if(equipmentWindowOpened){
returnData=Component<ScrollableWindowComponent>(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<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]);
if(equipmentWindowOpened){
returnData=Component<ScrollableWindowComponent>(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<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]);
if(equipmentWindowOpened){
returnData=Component<ScrollableWindowComponent>(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<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]);
if(equipmentWindowOpened){
returnData=Component<ScrollableWindowComponent>(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<ScrollableWindowComponent>(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<ScrollableWindowComponent>(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<ScrollableWindowComponent>(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<ScrollableWindowComponent>(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<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]);
},}},
.right=std::format("Equip Slot {}",slotNames[6]),
}},
});
}

@ -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

@ -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

@ -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

Loading…
Cancel
Save