Author Topic: [SOLVED]How to use FindByItemID while using more than one InvDatabase.  (Read 1558 times)

blahdot3h

  • Guest
I was taking a look through documentation and trying to figure out how to go about specifying which database you want to be searching with every itemID search.  Any help getting pointed in the right direction to keep these inventory database's separate would be greatly appreciated.  Thank you for the great work on NGUI, it has been a life saver.


For example I have two database's one with database id 0 other with database id 1 and I want the first item in the inventory from database id 1.  How would I go about getting this without having it pull the item from database id 0 instead?
« Last Edit: July 19, 2013, 10:04:34 AM by blahdot3h »

blahdot3h

  • Guest
Re: How to use FindByItemID while using more than one InvDatabase?
« Reply #1 on: July 18, 2013, 10:49:50 PM »
Problem solved, added a new static
static public InvBaseItem FindByID (int id32, int _db)
   {
      InvDatabase db = GetDatabase(_db);
      return (db != null) ? db.GetItem(id32 & 0xFFFF) : null;
   }

Allows you to specify the Db you want to search for when you search for an item.