Implemented chapter limits for equipment upgrades.

This commit is contained in:
2024-01-31 17:15:40 -06:00
parent 32bec29f61
commit 689eaa6d10
13 changed files with 67 additions and 79 deletions
@@ -63,14 +63,14 @@ void Menu::InitializeConsumableCraftingWindow(){
Component<MenuLabel>(CONSUMABLE_CRAFT_ITEM,"Item Name Header")->SetLabel(std::format("Crafting {}",item.lock()->DisplayName()));
Component<RequiredMaterialsList>(CONSUMABLE_CRAFT_ITEM,"Required Materials List")->SetItem(item);
Component<MenuComponent>(CONSUMABLE_CRAFT_ITEM,"Craft Button")->SetGrayedOut(!item.lock()->CanEnhanceItem());
if(item.lock()->GetEnhancementInfo().AvailableChapter()<=game->GetCurrentChapter()){
if(item.lock()->GetEnhancementInfo()[0].chapterAvailable<=game->GetCurrentChapter()){
Menu::OpenMenu(CONSUMABLE_CRAFT_ITEM);
}
return true;
},
[](MenuFuncData data){
std::weak_ptr<RowItemDisplay>rowItem=DYNAMIC_POINTER_CAST<RowItemDisplay>(data.component.lock());
if(rowItem.lock()->GetItem().lock()->GetEnhancementInfo().AvailableChapter()<=game->GetCurrentChapter()){
if(rowItem.lock()->GetItem().lock()->GetEnhancementInfo()[0].chapterAvailable<=game->GetCurrentChapter()){
Component<MenuItemItemButton>(CRAFT_CONSUMABLE,"Item Icon")->SetHideDetails(false);
}else{
Component<MenuItemItemButton>(CRAFT_CONSUMABLE,"Item Icon")->SetHideDetails(true);