Exemple #1
0
        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();
        }
Exemple #2
0
 private void SetBagContent(object cell)
 {
     if (cell != null)
     {
         ShowBagContent.Instance.Icon.transform.parent.gameObject.CustomSetActive(true);
         ShowBagContent.Instance.SetBagContentData(cell as IDictionary);
     }
     else
     {
         ShowBagContent.Instance.Icon.transform.parent.gameObject.CustomSetActive(false);
         ShowBagContent.Instance.SetBagContentData(null);
     }
     LTInventoryAllController.SelectFirst(EB.Dot.String("inventory_id", cell, null));
 }