|
|
@ -139,15 +139,13 @@ std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> |
|
|
|
#pragma region Row Player Weapons Updates |
|
|
|
#pragma region Row Player Weapons Updates |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerWeapons_InventorySlotsUpdate= |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerWeapons_InventorySlotsUpdate= |
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){ |
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){ |
|
|
|
std::vector<std::weak_ptr<Item>>weapons; |
|
|
|
|
|
|
|
std::copy_if(Inventory::get("Equipment").begin(),Inventory::get("Equipment").end(),std::back_inserter(weapons),[](std::weak_ptr<Item> item){return item.lock()->IsWeapon();}); |
|
|
|
|
|
|
|
component.RemoveAllComponents(); |
|
|
|
component.RemoveAllComponents(); |
|
|
|
component.AddButtonOnSlotUpdate(cat); |
|
|
|
component.AddButtonOnSlotUpdate(cat); |
|
|
|
}; |
|
|
|
}; |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerWeapons_AddButtonOnSlotUpdate= |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerWeapons_AddButtonOnSlotUpdate= |
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){
|
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){
|
|
|
|
std::vector<std::weak_ptr<Item>>weapons; |
|
|
|
std::vector<std::weak_ptr<Item>>weapons; |
|
|
|
std::copy_if(Inventory::get("Equipment").begin(),Inventory::get("Equipment").end(),std::back_inserter(weapons),[](std::weak_ptr<Item> item){return item.lock()->IsWeapon();}); |
|
|
|
std::copy_if(Inventory::get("Equipment").begin(),Inventory::get("Equipment").end(),std::back_inserter(weapons),[](std::shared_ptr<Item>item){return item->IsWeapon();}); |
|
|
|
|
|
|
|
|
|
|
|
RowInventoryScrollableWindowComponent*c=DYNAMIC_CAST<RowInventoryScrollableWindowComponent*>(&component); |
|
|
|
RowInventoryScrollableWindowComponent*c=DYNAMIC_CAST<RowInventoryScrollableWindowComponent*>(&component); |
|
|
|
|
|
|
|
|
|
|
@ -173,15 +171,13 @@ std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> |
|
|
|
#pragma region Row Player Armor Updates |
|
|
|
#pragma region Row Player Armor Updates |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerArmor_InventorySlotsUpdate= |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerArmor_InventorySlotsUpdate= |
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){ |
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){ |
|
|
|
std::vector<std::weak_ptr<Item>>armor; |
|
|
|
|
|
|
|
std::copy_if(Inventory::get("Equipment").begin(),Inventory::get("Equipment").end(),std::back_inserter(armor),[](std::weak_ptr<Item> item){return item.lock()->IsArmor();}); |
|
|
|
|
|
|
|
component.RemoveAllComponents(); |
|
|
|
component.RemoveAllComponents(); |
|
|
|
component.AddButtonOnSlotUpdate(cat); |
|
|
|
component.AddButtonOnSlotUpdate(cat); |
|
|
|
}; |
|
|
|
}; |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerArmor_AddButtonOnSlotUpdate= |
|
|
|
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowPlayerArmor_AddButtonOnSlotUpdate= |
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){ |
|
|
|
[](InventoryScrollableWindowComponent&component,ITCategory cat){ |
|
|
|
std::vector<std::weak_ptr<Item>>armor; |
|
|
|
std::vector<std::weak_ptr<Item>>armor; |
|
|
|
std::copy_if(Inventory::get("Equipment").begin(),Inventory::get("Equipment").end(),std::back_inserter(armor),[](std::weak_ptr<Item> item){return item.lock()->IsArmor();}); |
|
|
|
std::copy_if(Inventory::get("Equipment").begin(),Inventory::get("Equipment").end(),std::back_inserter(armor),[](std::shared_ptr<Item>item){return item->IsArmor();}); |
|
|
|
|
|
|
|
|
|
|
|
RowInventoryScrollableWindowComponent*c=DYNAMIC_CAST<RowInventoryScrollableWindowComponent*>(&component); |
|
|
|
RowInventoryScrollableWindowComponent*c=DYNAMIC_CAST<RowInventoryScrollableWindowComponent*>(&component); |
|
|
|
|
|
|
|
|
|
|
|