@ -147,11 +147,11 @@ Item::Item()
Item : : Item ( uint32_t amt , IT item )
Item : : Item ( uint32_t amt , IT item )
: amt ( amt ) , it ( & ITEM_DATA . at ( item ) ) { }
: amt ( amt ) , it ( & ITEM_DATA . at ( item ) ) { }
void Inventory : : AddItem ( IT it , uint32_t amt ) {
void Inventory : : AddItem ( IT it , uint32_t amt , bool monsterDrop ) {
//There are two places to manipulate items in (Both the sorted inventory and the actual inventory)
//There are two places to manipulate items in (Both the sorted inventory and the actual inventory)
if ( ! _inventory . count ( it ) ) {
if ( ! _inventory . count ( it ) ) {
_inventory [ it ] = Item { amt , it } ;
_inventory [ it ] = Item { amt , it } ;
InsertIntoSortedInv ( it ) ;
InsertIntoSortedInv ( it , monsterDrop ) ;
} else {
} else {
_inventory . at ( it ) . amt + = amt ;
_inventory . at ( it ) . amt + = amt ;
}
}
@ -209,10 +209,16 @@ std::vector<IT>&Inventory::get(ITCategory itemCategory){
return sortedInv . at ( itemCategory ) ;
return sortedInv . at ( itemCategory ) ;
}
}
void Inventory : : InsertIntoSortedInv ( IT item ) {
void Inventory : : InsertIntoSortedInv ( IT item , bool monsterDrop ) {
sortedInv . at ( ITEM_DATA [ item ] . category ) . push_back ( item ) ;
sortedInv . at ( ITEM_DATA [ item ] . category ) . push_back ( item ) ;
std : : string stageInventoryCategory = " Stage Loot " ;
if ( monsterDrop ) {
stageInventoryCategory = " Monster Loot " ;
}
sortedInv . at ( stageInventoryCategory ) . push_back ( item ) ;
//This should be a callback to menus that we need to update the interface with another item slot since a new one has appeared.
//This should be a callback to menus that we need to update the interface with another item slot since a new one has appeared.
Menu : : InventorySlotsUpdated ( ITEM_DATA [ item ] . category ) ;
Menu : : InventorySlotsUpdated ( ITEM_DATA [ item ] . category ) ;
Menu : : InventorySlotsUpdated ( stageInventoryCategory ) ;
}
}
bool Inventory : : ExecuteAction ( IT item ) {
bool Inventory : : ExecuteAction ( IT item ) {