private void ShowAward(Hashtable data) { if (data == null) { return; } if (data.ContainsKey("inventory")) { var allInventoryData = data["inventory"] as Hashtable; foreach (ICollection curInventory in allInventoryData.Values) { var inventoryId = EB.Dot.String("inventory_id", curInventory, string.Empty); var inventoryCurNumValue = EB.Dot.Integer("num", curInventory, 0); var inventoryFormerNum = 0; DataLookupsCache.Instance.SearchIntByID("inventory." + inventoryId + ".num", out inventoryFormerNum); if (inventoryCurNumValue > inventoryFormerNum) { var itemData = new LTShowItemData(EB.Dot.String("economy_id", curInventory, string.Empty), inventoryCurNumValue - inventoryFormerNum, LTShowItemType.TYPE_GAMINVENTORY); //上传友盟获得钻石,道具 if (itemData.id == "hc") { FusionTelemetry.PostBonus(itemData.count, Umeng.GA.BonusSource.Source8); } GameUtils.ShowAwardMsg(itemData); } } } if (data.ContainsKey("heroStats")) { var heroStatsData = data["heroStats"] as Hashtable; foreach (ICollection curHeroStat in heroStatsData.Values) { var shardId = EB.Dot.String("id", curHeroStat, string.Empty); var curNumValue = EB.Dot.Integer("shard", curHeroStat, 0); var formerNum = 0; var characterId = EB.Dot.String("character_id", curHeroStat, string.Empty); var templateId = EB.Dot.String("template_id", curHeroStat, string.Empty); var convertShard = EB.Dot.Bool("convertShard", curHeroStat, false); if (!convertShard) { var itemData = new LTShowItemData(templateId, 1, "hero"); LTInventoryAllController.SetShowAwardsQueue(itemData); } DataLookupsCache.Instance.SearchIntByID("heroStats." + shardId + ".shard", out formerNum); if (curNumValue > formerNum) { var itemData = new LTShowItemData(characterId, curNumValue - formerNum, LTShowItemType.TYPE_HEROSHARD); GameUtils.ShowAwardMsg(itemData); } } Messenger.Raise(Hotfix_LT.EventName.InventoryEvent); } dataLookup.ShowAward(); }
private void ShowAward(Hashtable data) { if (data == null) { return; } if (data.ContainsKey("inventory")) { Hashtable allInventoryData = data["inventory"] as Hashtable; foreach (ICollection curInventory in allInventoryData.Values) { string inventoryId = EB.Dot.String("inventory_id", curInventory, string.Empty); int inventoryCurNumValue = EB.Dot.Integer("num", curInventory, 0); int inventoryFormerNum = 0; DataLookupsCache.Instance.SearchIntByID("inventory." + inventoryId + ".num", out inventoryFormerNum); if (inventoryCurNumValue > inventoryFormerNum) { LTShowItemData itemData = new LTShowItemData(EB.Dot.String("economy_id", curInventory, string.Empty), (inventoryCurNumValue - inventoryFormerNum), LTShowItemType.TYPE_GAMINVENTORY); GameUtils.ShowAwardMsg(itemData); } } } if (data.ContainsKey("heroStats")) { Hashtable heroStatsData = data["heroStats"] as Hashtable; foreach (ICollection curHeroStat in heroStatsData.Values) { string shardId = EB.Dot.String("id", curHeroStat, string.Empty); int curNumValue = EB.Dot.Integer("shard", curHeroStat, 0); int formerNum = 0; bool convertShard = EB.Dot.Bool("convertShard", curHeroStat, false); string templateId = EB.Dot.String("template_id", curHeroStat, string.Empty); if (!convertShard) { LTShowItemData itemData = new LTShowItemData(templateId, 1, LTShowItemType.TYPE_HERO); GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData); } DataLookupsCache.Instance.SearchIntByID("heroStats." + shardId + ".shard", out formerNum); if (curNumValue > formerNum) { LTShowItemData itemData = new LTShowItemData(EB.Dot.String("character_id", curHeroStat, string.Empty), (curNumValue - formerNum), LTShowItemType.TYPE_HEROSHARD); GameUtils.ShowAwardMsg(itemData); } } } dataLookup.ShowAward(); }