|
|
|
@ -267,6 +267,7 @@ 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(); |
|
|
|
@ -324,37 +325,98 @@ void Menu::InitializeCharacterMenuWindow(){ |
|
|
|
|
{game->KEY_CONFIRM,{"Select",[](MenuType type){}}}, |
|
|
|
|
} |
|
|
|
|
,{ //Button Navigation Rules
|
|
|
|
|
{"Equip List",{}}, |
|
|
|
|
{"Equip List",{ |
|
|
|
|
.up=[](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]; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
.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]; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
|
|
auto equipList=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents(); |
|
|
|
|
returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); |
|
|
|
|
}, |
|
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
|
auto equipList=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents(); |
|
|
|
|
returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); |
|
|
|
|
} |
|
|
|
|
}}, |
|
|
|
|
{"Equip Selection Select Button",{ |
|
|
|
|
.up=[](MenuType type,Data&returnData){ |
|
|
|
|
auto equipList=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents(); |
|
|
|
|
returnData="Equip Selection Select Button"; |
|
|
|
|
if(equipList.size()>0){ |
|
|
|
|
returnData=equipList.back(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
.down=[](MenuType type,Data&returnData){ |
|
|
|
|
auto equipList=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents(); |
|
|
|
|
returnData="Equip Selection Select Button"; |
|
|
|
|
if(equipList.size()>0){ |
|
|
|
|
returnData=equipList.front(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
.left=[](MenuType type,Data&returnData){ |
|
|
|
|
auto equipList=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents(); |
|
|
|
|
returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); |
|
|
|
|
}, |
|
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
|
auto equipList=Component<ScrollableWindowComponent>(type,"Equip List")->GetComponents(); |
|
|
|
|
returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); |
|
|
|
|
} |
|
|
|
|
}}, |
|
|
|
|
{std::format("Equip Slot {}", slotNames[0]),{ |
|
|
|
|
.up="Back button", |
|
|
|
|
.down=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
|
.left=std::format("Equip Slot {}", slotNames[1]), |
|
|
|
|
.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[1]),}}, |
|
|
|
|
{std::format("Equip Slot {}", slotNames[1]),{ |
|
|
|
|
.up="Back button", |
|
|
|
|
.down=std::format("Equip Slot {}", slotNames[3]), |
|
|
|
|
.left=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
|
.right=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]); |
|
|
|
|
},}}, |
|
|
|
|
{std::format("Equip Slot {}", slotNames[2]),{ |
|
|
|
|
.up=std::format("Equip Slot {}", slotNames[0]), |
|
|
|
|
.down=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
|
.left=std::format("Equip Slot {}", slotNames[3]), |
|
|
|
|
.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[3]),}}, |
|
|
|
|
{std::format("Equip Slot {}", slotNames[3]),{ |
|
|
|
|
.up=std::format("Equip Slot {}", slotNames[1]), |
|
|
|
|
.down=std::format("Equip Slot {}", slotNames[5]), |
|
|
|
|
.left=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
|
.right=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]); |
|
|
|
|
},}}, |
|
|
|
|
{std::format("Equip Slot {}", slotNames[4]),{ |
|
|
|
|
.up=std::format("Equip Slot {}", slotNames[2]), |
|
|
|
|
.down=std::format("Equip Slot {}", slotNames[6]), |
|
|
|
|
.left=std::format("Equip Slot {}", slotNames[5]), |
|
|
|
|
.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[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=std::format("Equip Slot {}", slotNames[4]),}}, |
|
|
|
|
.right=[](MenuType type,Data&returnData){ |
|
|
|
|
std::format("Equip Slot {}", slotNames[4]); |
|
|
|
|
},}}, |
|
|
|
|
{std::format("Equip Slot {}", slotNames[6]),{ |
|
|
|
|
.up=std::format("Equip Slot {}", slotNames[4]), |
|
|
|
|
.down="Back button", |
|
|
|
@ -363,12 +425,16 @@ void Menu::InitializeCharacterMenuWindow(){ |
|
|
|
|
{std::format("Equip Slot {}", slotNames[7]),{ |
|
|
|
|
.up=std::format("Equip Slot {}", slotNames[5]), |
|
|
|
|
.down="Back button", |
|
|
|
|
.left=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]); |
|
|
|
|
}, |
|
|
|
|
.right=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=std::format("Equip Slot {}", slotNames[6]),}}, |
|
|
|
|
.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]); |
|
|
|
|
},}}, |
|
|
|
|
}); |
|
|
|
|
} |