Added money display to inventory GUI. Corrected inventory amounts displaying incorrectly in inventory menus (references to other items fixed). Added MenuIconButton appearance flags to disable outlines/backgrounds

This commit is contained in:
2023-12-18 00:34:10 -06:00
parent f1aa872717
commit cb09825455
15 changed files with 44 additions and 23 deletions
@@ -67,7 +67,7 @@ public:
vf2d buttonSize=options.size;
vf2d totalSpacing={options.padding+buttonSize.x,options.padding+buttonSize.y};
auto newItem=ADD("item_"+cat+"_"+std::to_string(itemIndex),RowItemDisplay)({totalSpacing*vf2d{float(x),float(y)},buttonSize},Inventory::get(cat)[itemIndex],inventoryButtonClickAction,itemNameLabelName,itemDescriptionLabelName,inventoryButtonsActive?ButtonAttr::NONE:ButtonAttr::UNSELECTABLE)END;
auto newItem=ADD("item_"+cat+"_"+std::to_string(itemIndex),RowItemDisplay)({totalSpacing*vf2d{float(x),float(y)},buttonSize},Inventory::GetInventorySlot(cat,itemIndex),inventoryButtonClickAction,itemNameLabelName,itemDescriptionLabelName,inventoryButtonsActive?ButtonAttr::NONE:ButtonAttr::UNSELECTABLE)END;
newItem->SetCompactDescriptions(compact==COMPACT);
newItem->SetHoverFunc(inventoryButtonHoverAction);
newItem->SetMouseOutFunc(inventoryButtonMouseOutAction);
@@ -77,7 +77,7 @@ public:
for(int counter=0;MenuComponent*component:components){
RowItemDisplay*item=dynamic_cast<RowItemDisplay*>(component);
if(item!=nullptr){
item->SetItem(Inventory::get(cat)[counter]);
item->SetItem(Inventory::GetInventorySlot(cat,counter));
}else{
ERR("WARNING! Could not properly cast item to RowItemDisplay* type!");
}