Make gear appear unstackable in inventories while other items remain stackable. Each individual piece of gear can now have its own stats.
This commit is contained in:
@@ -122,7 +122,7 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
|
||||
const std::vector<std::shared_ptr<Item>>&equips=Inventory::get("Equipment");
|
||||
const std::vector<std::shared_ptr<Item>>&accessories=Inventory::get("Accessories");
|
||||
std::vector<std::shared_ptr<Item>>availableEquipment;
|
||||
std::vector<std::weak_ptr<Item>>availableEquipment;
|
||||
std::copy_if(equips.begin(),equips.end(),std::back_inserter(availableEquipment),[&](const std::shared_ptr<Item>it){
|
||||
return it->GetEquipSlot()&slot;
|
||||
});
|
||||
@@ -132,9 +132,8 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
|
||||
ScrollableWindowComponent*equipList=Component<ScrollableWindowComponent>(data.component->parentMenu,"Equip List");
|
||||
equipList->RemoveAllComponents();
|
||||
for(int counter=0;const std::shared_ptr<Item>it:availableEquipment){
|
||||
std::weak_ptr<Item>itemInvRef=Inventory::GetItem(it->ActualName());
|
||||
auto equip=equipList->ADD("Equip Item "+std::to_string(counter),RowItemDisplay)({{2,2+counter*29.f},{120-15,28}},itemInvRef,
|
||||
for(int counter=0;const std::weak_ptr<Item>it:availableEquipment){
|
||||
auto equip=equipList->ADD("Equip Item "+std::to_string(counter),RowItemDisplay)({{2,2+counter*29.f},{120-15,28}},it,
|
||||
[](MenuFuncData data){
|
||||
RowItemDisplay*comp=DYNAMIC_CAST<RowItemDisplay*>(data.component);
|
||||
if(comp!=nullptr){
|
||||
@@ -201,7 +200,7 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
equip->SetSelectionType(SelectionType::NONE);
|
||||
|
||||
equip->I(Attribute::EQUIP_TYPE)=int(slot);
|
||||
if(Inventory::GetEquip(slot)==itemInvRef){
|
||||
if(Inventory::GetEquip(slot)==it){
|
||||
equip->SetSelected(true);
|
||||
}
|
||||
equip->SetCompactDescriptions(NON_COMPACT);
|
||||
|
||||
Reference in New Issue
Block a user