public void PurchaseItemConfirmed(object item, bool response) { if (!response) { return; } MerchantItem mItem = (MerchantItem)item; PurchaseItemFromMerchant(mItem.itemID, mItem.count); }
void _HandleMerchantList(Dictionary <string, object> props) { merchantItems.Clear(); NpcId = (OID)props["npcOid"]; int numItems = (int)props["numItems"]; for (int i = 0; i < numItems; i++) { MerchantItem merchantItem = new MerchantItem(); merchantItem.itemID = (int)props["item_" + i + "ID"]; merchantItem.count = (int)props["item_" + i + "Count"]; merchantItem.cost = (int)props["item_" + i + "Cost"]; merchantItem.purchaseCurrency = (int)props["item_" + i + "Currency"]; merchantItems.Add(merchantItem); } // dispatch a ui event to tell the rest of the system string[] args = new string[1]; args[0] = NpcId.ToString(); AtavismEventSystem.DispatchEvent("MERCHANT_UPDATE", args); }