|
|
@ -254,12 +254,14 @@ void Menu::InitializeCharacterMenuWindow(){ |
|
|
|
if(Menu::UsingMouseNavigation()){ |
|
|
|
if(Menu::UsingMouseNavigation()){ |
|
|
|
equipList->HandleOutsideDisabledButtonSelection(*itemEquipped); |
|
|
|
equipList->HandleOutsideDisabledButtonSelection(*itemEquipped); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
data.menu.I(A::ITEM_SLOT)=equipList->GetComponentIndex(*itemEquipped); |
|
|
|
}else |
|
|
|
}else |
|
|
|
if(equipmentList.size()>0){ |
|
|
|
if(equipmentList.size()>0){ |
|
|
|
data.menu.SetSelection(equipmentList[0],true,true); |
|
|
|
data.menu.SetSelection(equipmentList[0],true,true); |
|
|
|
if(Menu::UsingMouseNavigation()){ |
|
|
|
if(Menu::UsingMouseNavigation()){ |
|
|
|
equipList->HandleOutsideDisabledButtonSelection(equipmentList[0]); |
|
|
|
equipList->HandleOutsideDisabledButtonSelection(equipmentList[0]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
data.menu.I(A::ITEM_SLOT)=0; |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
data.menu.SetSelection("Equip Selection Select Button"sv); |
|
|
|
data.menu.SetSelection("Equip Selection Select Button"sv); |
|
|
|
} |
|
|
|
} |
|
|
@ -267,7 +269,6 @@ void Menu::InitializeCharacterMenuWindow(){ |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
},[](MenuFuncData data){//On Mouse Hover
|
|
|
|
},[](MenuFuncData data){//On Mouse Hover
|
|
|
|
EquipSlot slot=DYNAMIC_POINTER_CAST<EquipSlotButton>(data.component.lock())->GetSlot(); |
|
|
|
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); |
|
|
|
const std::weak_ptr<Item>equip=Inventory::GetEquip(slot); |
|
|
|
if(!ISBLANK(equip)){ |
|
|
|
if(!ISBLANK(equip)){ |
|
|
|
Component<CharacterRotatingDisplay>(data.component.lock()->parentMenu,"Character Rotating Display")->Disable(); |
|
|
|
Component<CharacterRotatingDisplay>(data.component.lock()->parentMenu,"Character Rotating Display")->Disable(); |
|
|
@ -319,10 +320,49 @@ void Menu::InitializeCharacterMenuWindow(){ |
|
|
|
returnData=std::format("Equip Slot {}",slotNames[0]); |
|
|
|
returnData=std::format("Equip Slot {}",slotNames[0]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ //Button Key
|
|
|
|
{ //Button Key
|
|
|
|
|
|
|
|
{{game->KEY_SHOULDER,Pressed},{"Scroll",[](MenuType type){}}}, |
|
|
|
|
|
|
|
{{game->KEY_SCROLL,Analog},{"Scroll",[](MenuType type){}}}, |
|
|
|
{game->KEY_BACK,{"Back",[](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_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
|
|
|
|
,{ //Button Navigation Rules
|
|
|
|
{"Equip List",{ |
|
|
|
{"Equip List",{ |
|
|
@ -330,16 +370,24 @@ void Menu::InitializeCharacterMenuWindow(){ |
|
|
|
if(!Menu::menus[type]->GetSelection().expired()){ |
|
|
|
if(!Menu::menus[type]->GetSelection().expired()){ |
|
|
|
auto selection=Menu::menus[type]->GetSelection().lock(); |
|
|
|
auto selection=Menu::menus[type]->GetSelection().lock(); |
|
|
|
size_t index=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponentIndex(selection); |
|
|
|
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); |
|
|
|
index--; |
|
|
|
returnData=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[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){ |
|
|
|
.down=[](MenuType type,Data&returnData){ |
|
|
|
if(!Menu::menus[type]->GetSelection().expired()){ |
|
|
|
if(!Menu::menus[type]->GetSelection().expired()){ |
|
|
|
auto selection=Menu::menus[type]->GetSelection().lock(); |
|
|
|
auto selection=Menu::menus[type]->GetSelection().lock(); |
|
|
|
size_t index=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponentIndex(selection); |
|
|
|
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); |
|
|
|
index++; |
|
|
|
returnData=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[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){ |
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
@ -378,8 +426,12 @@ void Menu::InitializeCharacterMenuWindow(){ |
|
|
|
{std::format("Equip Slot {}", slotNames[0]),{ |
|
|
|
{std::format("Equip Slot {}", slotNames[0]),{ |
|
|
|
.up="Back button", |
|
|
|
.up="Back button", |
|
|
|
.down=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
|
.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[1]); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
.right=std::format("Equip Slot {}", slotNames[1]),}}, |
|
|
|
.right=std::format("Equip Slot {}", slotNames[1]),}}, |
|
|
|
{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]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[3]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
.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]),{ |
|
|
|
{std::format("Equip Slot {}", slotNames[2]),{ |
|
|
|
.up=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
.up=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
|
.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]),}}, |
|
|
|
.right=std::format("Equip Slot {}", slotNames[3]),}}, |
|
|
|
{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]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[5]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
.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]),{ |
|
|
|
{std::format("Equip Slot {}", slotNames[4]),{ |
|
|
|
.up=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
.up=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[6]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[6]), |
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
|
.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]),{ |
|
|
|
{std::format("Equip Slot {}", slotNames[5]),{ |
|
|
|
.up=std::format("Equip Slot {}", slotNames[3]), |
|
|
|
.up=std::format("Equip Slot {}", slotNames[3]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[7]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[7]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
.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]),{ |
|
|
|
{std::format("Equip Slot {}", slotNames[6]),{ |
|
|
|
.up=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
.up=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
.down="Back button", |
|
|
|
.down="Back button", |
|
|
|
.left=std::format("Equip Slot {}", slotNames[7]), |
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
|
.right=std::format("Equip Slot {}", slotNames[7]),}}, |
|
|
|
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]),{ |
|
|
|
{std::format("Equip Slot {}", slotNames[7]),{ |
|
|
|
.up=std::format("Equip Slot {}", slotNames[5]), |
|
|
|
.up=std::format("Equip Slot {}", slotNames[5]), |
|
|
|
.down="Back button", |
|
|
|
.down="Back button", |
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
|
.left=std::format("Equip Slot {}",slotNames[6]), |
|
|
|
Menu::menus[type]->SetSelection(Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); |
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
}, |
|
|
|
if(equipmentWindowOpened){ |
|
|
|
.right=std::format("Equip Slot {}", slotNames[6]),}}, |
|
|
|
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",{ |
|
|
|
{"Back button",{ |
|
|
|
.up=std::format("Equip Slot {}", slotNames[7]), |
|
|
|
.up=std::format("Equip Slot {}", slotNames[7]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
.down=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[7]), |
|
|
|
.left=std::format("Equip Slot {}", slotNames[7]), |
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
.right=std::format("Equip Slot {}",slotNames[6]), |
|
|
|
Menu::menus[type]->SetSelection(Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents()[std::bit_width(unsigned(Menu::menus[type]->I(A::ITEM_SLOT)))-1]); |
|
|
|
}}, |
|
|
|
},}}, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |