Implement Crafting requirements display on equipment crafting window. Add in crafting requirement sample data for non-equipment items.

This commit is contained in:
2023-12-28 02:55:59 -06:00
parent 3410b5b92b
commit 8f41870b46
16 changed files with 103 additions and 43 deletions
+8
View File
@@ -93,24 +93,31 @@ void Menu::InitializeBlacksmithCraftingWindow(){
return true;
},
[](MenuFuncData data){
RowItemDisplay*rowItem=DYNAMIC_CAST<RowItemDisplay*>(data.component);
Component<MenuItemItemButton>(BLACKSMITH,"Item Icon")->SetItem(rowItem->GetItem());
return true;
},
[](MenuFuncData data){
Component<MenuItemItemButton>(BLACKSMITH,"Item Icon")->SetItem(Item::BLANK);
return true;
},
InventoryCreator::RowPlayerWeapons_InventoryUpdate,
{.padding=1,.size={207,28}}
)END;
AddInventoryListener(weaponsDisplay,"Equipment");
weaponsDisplay->SetCompactDescriptions(CRAFTING_INFO);
auto armorDisplay=blacksmithWindow->ADD("Armor Inventory Display",RowInventoryScrollableWindowComponent)({{2,28},{220,blacksmithWindow->size.y-44}},"Item Name Label","Item Description Label",
[](MenuFuncData data){
return true;
},
[](MenuFuncData data){
RowItemDisplay*rowItem=DYNAMIC_CAST<RowItemDisplay*>(data.component);
Component<MenuItemItemButton>(BLACKSMITH,"Item Icon")->SetItem(rowItem->GetItem());
return true;
},
[](MenuFuncData data){
Component<MenuItemItemButton>(BLACKSMITH,"Item Icon")->SetItem(Item::BLANK);
return true;
},
InventoryCreator::RowPlayerArmor_InventoryUpdate,
@@ -118,6 +125,7 @@ void Menu::InitializeBlacksmithCraftingWindow(){
)END;
AddInventoryListener(armorDisplay,"Equipment");
armorDisplay->Enable(false);
armorDisplay->SetCompactDescriptions(CRAFTING_INFO);
#pragma region Inventory Description
float inventoryDescriptionWidth=blacksmithWindow->pos.x+blacksmithWindow->size.x-26-224;