Ejemplo n.º 1
0
 public List <LTShowItemData> GetShowItemsList()
 {
     if (showItemsList.Count > 0)
     {
         return(showItemsList);
     }
     else
     {
         ArrayList aList = EB.JSON.Parse(NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("LottetyHcTimesAward")) as ArrayList;
         if (aList == null)
         {
             return(showItemsList);
         }
         for (int i = 0; i < aList.Count; i++)
         {
             string id    = EB.Dot.String("data", aList[i], string.Empty);
             int    count = EB.Dot.Integer("quantity", aList[i], 0);
             string type  = EB.Dot.String("type", aList[i], string.Empty);
             if (!string.IsNullOrEmpty(id))
             {
                 LTShowItemData showItemData = new LTShowItemData(id, count, type);
                 showItemsList.Add(showItemData);
             }
         }
         return(showItemsList);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化ShowItemData
        /// </summary>
        /// <param name="itemDataArray"></param>
        /// <returns></returns>
        private List <LTShowItemData> InitRewardData(ArrayList itemDataArray)
        {
            List <LTShowItemData> itemDataList = new List <LTShowItemData>();

            if (itemDataArray != null)
            {
                for (var i = 0; i < itemDataArray.Count; i++)
                {
                    object    candidate = itemDataArray[i];
                    Hashtable redeemer  = candidate as Hashtable;
                    if (redeemer != null)
                    {
                        RedeemerItem item = new RedeemerItem(redeemer);

                        if (item.IsValid == true && !LTChargeManager.Instance.IgnoreItemList.Contains(item.Type))// !item.Type.Equals("bpt") && !item.Type.Equals("pab") && !item.Type.Equals("pdb") && !item.Type.Equals("act") && !item.Type.Equals("heromedal"))
                        {
                            LTShowItemData tempData = new LTShowItemData(item.Data, item.Quantity, item.Type, false);
                            itemDataList.Add(tempData);
                        }
                    }
                }
            }

            return(itemDataList);
        }
Ejemplo n.º 3
0
 private void OnRewardBtnClick()
 {
     InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
     //
     LTWelfareModel.Instance.DrawGrowReward(delegate (bool success)
     {
         if (success)
         {
             string str = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("WelfareGrowUpAward");
             DataLookupsCache.Instance.CacheData("user_prize_data.grow_reward", true);
             m_RewardBtn.gameObject.CustomSetActive(true);
             AwardInfo.CurSlider.gameObject.CustomSetActive(false);
             RuleBtn.gameObject.CustomSetActive(false);
             m_RewardBtnLabel.text = EB.Localizer.GetString("ID_BUTTON_LABEL_HAD_PULL");
             m_RewardBtn.enabled = false;
             m_RewardBtn.GetComponent<UISprite>().color = Color.magenta;
             if (str != null)
             {
                 LTShowItemData itemData = GetItemData(str);
                 if (itemData.type == "hero")
                 {
                     //如果是英雄将弹出获得伙伴界面
                     GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData);
                 }
             }
         }
     });
 }
Ejemplo n.º 4
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);
            activityId = (int)param;

            Hotfix_LT.Data.TimeLimitActivityTemplate activity = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(activityId);

            if (activity == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(activity.parameter2))
            {
                costList = new List <int>();
                string[] Splits = activity.parameter2.Split('|');
                string[] splits = Splits[0].Split(',');
                CostItemData = new LTShowItemData(splits[1], 0, splits[0]);

                splits = Splits[1].Split(',');
                for (int i = 0; i < splits.Length; ++i)
                {
                    costList.Add(int.Parse(splits[i]));
                }
            }
            stagesList = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivityStages(activity.id);
            InitUI();
        }
Ejemplo n.º 5
0
        public void OnSigninBack()
        {
            InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
            FusionAudio.PostEvent("UI/General/ButtonClick");
            UpdateReceiveState(eReceiveState.have);

            if (StageDta.Type.Equals(LTShowItemType.TYPE_HERO))
            {
                LTShowItemData itemData = new LTShowItemData(StageDta.Id, StageDta.Count, StageDta.Type);
                GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData);
                ILRTimerManager.instance.AddTimer(100, 1, delegate { CallBack(); });
            }
            else
            {
                List <LTShowItemData> Awards = new List <LTShowItemData>()
                {
                    new LTShowItemData(StageDta.Id, StageDta.Count, StageDta.Type)
                };
                for (int i = 0; i < Awards.Count; i++)
                {
                    if (Awards[i].id == "hc")
                    {
                        FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, Awards[i].count, "签到获得");
                    }
                    if (Awards[i].id == "gold")
                    {
                        FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.gold, Awards[i].count, "签到获得");
                    }
                }
                var ht = Johny.HashtablePool.Claim();
                ht.Add("reward", Awards);
                ht.Add("callback", new System.Action(CallBack));
                GlobalMenuManager.Instance.Open("LTShowRewardView", ht);
            }
        }
Ejemplo n.º 6
0
 public void SetAwardInfo()
 {
     string str = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue("WelfareGrowUpAward");
     if (str != null)
     {
         LTShowItemData itemData = GetItemData(str);
         if (itemData != null)
         {
             if (itemData.type == LTShowItemType.TYPE_HEROSHARD|| itemData.type == LTShowItemType.TYPE_HERO)
             {
                 id = itemData.id;
                 int cid = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(itemData.id).character_id;
                 Hotfix_LT.Data.HeroInfoTemplate data = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(cid);
                 MainIcon.spriteName = data.icon;
                 RoleIcon.spriteName = LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[data.char_type]; 
                 HotfixCreateFX.ShowCharTypeFX(charFx, efClip, RoleIcon.transform, (PartnerGrade)data.role_grade, data.char_type);
                 GradeIcon.spriteName = LTPartnerConfig.PARTNER_GRADE_SPRITE_NAME_DIC[(PartnerGrade)data.role_grade];
                 HeroItem.CustomSetActive(true);
             }
             else
             {
                 ShowItem.LTItemData = itemData;
                 ShowItem.mDMono.gameObject.CustomSetActive(true);
             }
         }
     }
 }
Ejemplo n.º 7
0
        private void InitChargeShowData()
        {
            if (curItemDataList == null)
            {
                curItemDataList = new List <LTShowItemData>();
            }
            curItemDataList.Clear();
            for (int i = 0; i < curChargeData.redeemers.Count; ++i)
            {
                if (!LTChargeManager.Instance.IgnoreItemList.Contains(curChargeData.redeemers[i].Type))
                {
                    LTShowItemData tempData = new LTShowItemData(curChargeData.redeemers[i].Data, curChargeData.redeemers[i].Quantity, curChargeData.redeemers[i].Type);
                    curItemDataList.Add(tempData);
                }
            }

            for (int i = 0; i < ItemsList.Count; i++)
            {
                if (i < curItemDataList.Count)
                {
                    ItemsList[i].mDMono.gameObject.CustomSetActive(true);
                    ItemsList[i].LTItemData = curItemDataList[i];
                }
                else
                {
                    ItemsList[i].mDMono.gameObject.CustomSetActive(false);
                }
            }
            ItemsGrid.repositionNow = true;
        }
Ejemplo n.º 8
0
        private bool CheckRes(string str, bool showTip = true)
        {
            string         itemStr = Data.NewGameConfigTemplateManager.Instance.GetGameConfigStrValue(str);
            LTShowItemData item    = GetItemData(itemStr);

            return(CheckRes(item.id, item.count, showTip));
        }
Ejemplo n.º 9
0
 private void setSelectBoxState(bool isShow, LTShowItemData item, int index)
 {
     if (isShow)
     {
         selectBoxContrl = selectBoxContrl ?? mDMono.transform.GetMonoILRComponent <QuicklyGetGoldItemController>("golditemSelect(Clone)", false);
         if (selectBoxContrl == null)
         {
             Transform selectBox;
             selectBox               = GameObject.Instantiate(selectBoxTemplate, mDMono.transform);
             selectBoxContrl         = selectBox.GetMonoILRComponent <QuicklyGetGoldItemController>();
             selectBox.localPosition = new Vector3(-888, 8, 0);
             selectBox.localScale    = Vector3.one;
             selectBox.gameObject.CustomSetActive(true);
         }
         selectBoxContrl.Fill(item, delegate { UseItemBox(index); });
     }
     else
     {
         selectBoxContrl = selectBoxContrl ?? mDMono.transform.GetMonoILRComponent <QuicklyGetGoldItemController>("golditemSelect(Clone)", false);
         if (selectBoxContrl != null)
         {
             selectBoxContrl.Fill(null, null);
         }
     }
 }
Ejemplo n.º 10
0
        private void ShowAward(Hashtable data)
        {
            if (data == null)
            {
                return;
            }
            if (data.ContainsKey("inventory"))
            {
                Hashtable             allInventoryData = data["inventory"] as Hashtable;
                List <LTShowItemData> chips            = new List <LTShowItemData>();
                var iter = allInventoryData.GetEnumerator();
                while (iter.MoveNext())
                {
                    string inventoryId        = EB.Dot.String("inventory_id", iter.Value, string.Empty);
                    int    inventoryFormerNum = 0;
                    DataLookupsCache.Instance.SearchIntByID("inventory." + inventoryId + ".num", out inventoryFormerNum);
                    int    inventoryCurNumValue = EB.Dot.Integer("num", iter.Value, 0);
                    string economy_id           = EB.Dot.String("economy_id", iter.Value, string.Empty);
                    if (inventoryCurNumValue > inventoryFormerNum)
                    {
                        LTShowItemData itemData = new LTShowItemData(economy_id, (inventoryCurNumValue - inventoryFormerNum), LTShowItemType.TYPE_HEROSHARD);
                        chips.Add(itemData);
                    }
                }
                if (chips.Count > 0)
                {
                    GlobalMenuManager.Instance.Open("LTShowRewardView", chips);
                }

                DataLookupsCache.Instance.CacheData(data);
                RefreshUIInfo();
                Hotfix_LT.Messenger.Raise(EventName.OnRefreshPartnerCellRP, true, true);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 商城礼包购买成功调用
        /// </summary>
        /// <param name="item"></param>
        private void OnOfferPurchaseSuceeded(EB.IAP.Item item, EB.IAP.Transaction trans)
        {
            if (!UIStack.Instance.IsStacked(controller))
            {
                EB.Debug.Log("OnOfferPurchaseSuceeded——return!");
                return;
            }

            //处理礼包类型的
            EB.Debug.Log("OnOfferPurchaseSuceeded");

            List <LTShowItemData> itemDataList = new List <LTShowItemData>();

            for (int i = 0; i < item.redeemers.Count; i++)
            {
                if (!LTChargeManager.Instance.IgnoreItemList.Contains(item.redeemers[i].Type)) //item.redeemers[i].Type.CompareTo("mcard") != 0 && item.redeemers[i].Type.CompareTo("bpt") != 0 && item.redeemers[i].Type.CompareTo("pab") != 0 && item.redeemers[i].Type.CompareTo("pdb") != 0 && item.redeemers[i].Type.CompareTo("heromedal") != 0)
                {
                    LTShowItemData tempData = new LTShowItemData(item.redeemers[i].Data, item.redeemers[i].Quantity, item.redeemers[i].Type);
                    itemDataList.Add(tempData);
                }
            }
            if (itemDataList.Count > 0)
            {
                GlobalMenuManager.Instance.Open("LTShowRewardView", itemDataList);
            }

            MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_CHARGE_PAY_SUCC"));

            controller.Close();
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 点击确定按钮
        /// </summary>
        public void OnClickConfirmBtn()
        {
            if (mCurSelectBoxNum < 1 || mCurSelectBoxNum > mBoxMaxNum)
            {
                EB.Debug.LogError("LTSelectBoxController UseItem Error, num Error");
                return;
            }

            Hotfix_LT.Data.SelectBox selectBox   = mCurCell.GetCurSelectBoxData();
            LTPartnerData            partnerData = LTPartnerDataManager.Instance.GetPartnerByStatId(int.Parse(selectBox.ri1));
            bool   isHasPartner = partnerData != null && partnerData.HeroId > 0;
            string statId       = selectBox.ri1;
            int    summonShard  = partnerData == null ? 0 :partnerData.HeroInfo.summon_shard;

            LTPartnerDataManager.Instance.UseItem(mCurInventoryId, mCurSelectBoxNum, selectBox.index, delegate
            {
                if (selectBox.rt1.Equals("hero"))
                {
                    if (!isHasPartner)
                    {
                        LTShowItemData itemData = new LTShowItemData(statId, 1, "hero");
                        GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData);
                    }
                    else
                    {
                        LTShowItemData itemData = new LTShowItemData(statId, summonShard * mCurSelectBoxNum, "heroshard");
                        GlobalMenuManager.Instance.Open("LTShowGetPartnerUI", itemData);
                    }
                }
                else
                {
                    List <LTShowItemData> showItemsList = new List <LTShowItemData>();

                    Hotfix_LT.Data.EconemyItemTemplate info = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(selectBox.ri1);
                    if (info is Hotfix_LT.Data.EquipmentItemTemplate)
                    {
                        for (int i = 0; i < mCurSelectBoxNum; i++)
                        {
                            LTShowItemData showItemData = new LTShowItemData(selectBox.ri1, selectBox.rn1, selectBox.rt1);
                            showItemsList.Add(showItemData);
                        }
                    }
                    else
                    {
                        LTShowItemData showItemData = new LTShowItemData(selectBox.ri1, selectBox.rn1 * mCurSelectBoxNum, selectBox.rt1);
                        showItemsList.Add(showItemData);
                    }

                    GlobalMenuManager.Instance.Open("LTShowRewardView", showItemsList);
                }

                if (mCurSelectBoxNum == mBoxMaxNum)
                {
                    UIInventoryBagLogic.Instance.FirstItem = null;
                }
                UIInventoryBagLogic.Instance.RefeshBag(ShowBagContent.Instance.CurType);

                controller.Close();
            });
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 商城礼包购买成功调用
        /// </summary>
        /// <param name="item"></param>
        private void OnOfferPurchaseSuceeded(EB.IAP.Item item, EB.IAP.Transaction trans)
        {
            if (item.category.CompareTo("comeback") != 0)
            {
                return;                                          //非回归礼包return;
            }
            EB.Debug.Log("OnOfferPurchaseSuceeded");
            List <LTShowItemData> itemDataList = new List <LTShowItemData>();

            for (int i = 0; i < item.redeemers.Count; i++)
            {
                if (!LTChargeManager.Instance.IgnoreItemList.Contains(item.redeemers[i].Type))
                {
                    LTShowItemData tempData = new LTShowItemData(item.redeemers[i].Data, item.redeemers[i].Quantity, item.redeemers[i].Type);
                    itemDataList.Add(tempData);
                }
            }
            if (itemDataList.Count > 0)
            {
                GlobalMenuManager.Instance.Open("LTShowRewardView", itemDataList);
            }

            MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_CHARGE_PAY_SUCC"));

            LTChargeManager.Instance.ReflashLimitedTimeGiftInfo(false, true);
        }
Ejemplo n.º 14
0
        public void OnUpdate(object obj)
        {
            LTSpeedSnatchILRModel.GetInstance().listRewardShowItemData.Clear();
            ArrayList al = obj as ArrayList;

            for (var k = 0; k < al.Count; k++)
            {
                var       v   = al[k];
                Hashtable has = v as Hashtable;
                if (has.ContainsKey("TagAttrRedeemItem"))
                {
                    ArrayList items = has["TagAttrRedeemItem"] as ArrayList;
                    if (items.Count > 0)
                    {
                        for (int i = 0; i < items.Count; i++)
                        {
                            Hashtable      ih    = items[i] as Hashtable;
                            string         type  = EB.Dot.String("type", ih, string.Empty);
                            string         id    = EB.Dot.String("data", ih, string.Empty);
                            int            count = EB.Dot.Integer("quantity", ih, 0);
                            LTShowItemData data  = new LTShowItemData(id, count, type);
                            LTSpeedSnatchILRModel.GetInstance().listRewardShowItemData.Add(data);
                        }
                    }
                }
            }
        }
Ejemplo n.º 15
0
 private void InitRewardView(int CurWinCount)
 {
     if (heroBattleRewards == null)
     {
         heroBattleRewards = new List <HeroBattleLevelReward>();
         List <Hotfix_LT.Data.ClashOfHeroesRewardTemplate> tpls = Hotfix_LT.Data.EventTemplateManager.Instance.GetClashOfHeroesRewardTpls();
         for (int i = 0; i < tpls.Count; i++)
         {
             HeroBattleLevelReward reward = new HeroBattleLevelReward();
             reward.id = tpls[i].id;
             LTShowItemData data1 = new LTShowItemData(tpls[i].item_id1, tpls[i].item_num1, tpls[i].item_type1);
             LTShowItemData data2 = new LTShowItemData(tpls[i].item_id2, tpls[i].item_num2, tpls[i].item_type2);
             LTShowItemData data3 = new LTShowItemData(tpls[i].item_id3, tpls[i].item_num3, tpls[i].item_type3);
             LTShowItemData data4 = new LTShowItemData(tpls[i].item_id4, tpls[i].item_num4, tpls[i].item_type4);
             if (!string.IsNullOrEmpty(data1.id))
             {
                 reward.listShowItemData.Add(data1);
             }
             if (!string.IsNullOrEmpty(data2.id))
             {
                 reward.listShowItemData.Add(data2);
             }
             if (!string.IsNullOrEmpty(data3.id))
             {
                 reward.listShowItemData.Add(data3);
             }
             if (!string.IsNullOrEmpty(data4.id))
             {
                 reward.listShowItemData.Add(data4);
             }
             heroBattleRewards.Add(reward);
         }
     }
     awardView.SetData(heroBattleRewards, CurWinCount);
 }
Ejemplo n.º 16
0
        /// <summary>
        /// 初始化ShowItem数据
        /// </summary>
        private void InitChargeShowData()
        {
            if (curItemDataList == null)
            {
                curItemDataList = new List <LTShowItemData>();
            }
            curItemDataList.Clear();

            for (int i = 0; i < curChargeData.redeemers.Count; i++)
            {
                if (!LTChargeManager.Instance.IgnoreItemList.Contains(curChargeData.redeemers[i].Type))//!curChargeData.redeemers[i].Type.Equals("bpt") && !curChargeData.redeemers[i].Type.Equals("pab") && !curChargeData.redeemers[i].Type.Equals("pdb") && !curChargeData.redeemers[i].Type.Equals("act") && !curChargeData.redeemers[i].Type.Equals("heromedal"))
                {
                    LTShowItemData tempData = new LTShowItemData(curChargeData.redeemers[i].Data, curChargeData.redeemers[i].Quantity, curChargeData.redeemers[i].Type, false);
                    curItemDataList.Add(tempData);
                }
                if (curItemDataList.Count == 0 && curChargeData.redeemers[i].Type.Equals("heromedal"))
                {
                    curItemDataList = Hotfix_LT.Data.EventTemplateManager.Instance.GetTotalHeroMedalItemTp1();
                }
                if (curItemDataList.Count == 0 && curChargeData.redeemers[i].Type.Equals("mcr"))
                {
                    curItemDataList = Hotfix_LT.Data.EventTemplateManager.Instance.GetTotalMainInstanceItemTp1();
                }
            }
        }
Ejemplo n.º 17
0
 public void InitItem(EB.IAP.Item item)
 {
     if (item != null)
     {
         curChargeData  = item;
         NameLabel.text = curChargeData.longName;
         UILabel uILabel = Btn.transform.GetComponent <UILabel>("Label");
         uILabel.text = curChargeData.localizedCost;
         for (int i = 0; i < ShowItems.Length; ++i)
         {
             if (i < curChargeData.redeemers.Count)
             {
                 if (!LTChargeManager.Instance.IgnoreItemList.Contains(curChargeData.redeemers[i].Type))
                 {
                     LTShowItemData tempData = new LTShowItemData(curChargeData.redeemers[i].Data, curChargeData.redeemers[i].Quantity, curChargeData.redeemers[i].Type, false);
                     ShowItems[i].LTItemData = tempData;
                     ShowItems[i].mDMono.gameObject.CustomSetActive(true);
                 }
             }
             else
             {
                 ShowItems[i].mDMono.gameObject.CustomSetActive(false);
             }
         }
         TimesLabel.text = curChargeData.buyLimit.ToString();
         mDMono.gameObject.CustomSetActive(true);
     }
     else
     {
         mDMono.gameObject.CustomSetActive(false);
     }
 }
Ejemplo n.º 18
0
        private List <LTShowItemData> ParseReward(ArrayList data)
        {
            FusionTelemetry.GamePlayData.PostEvent(FusionTelemetry.GamePlayData.infinite_topic,
                                                   FusionTelemetry.GamePlayData.infinite_event_id, FusionTelemetry.GamePlayData.infinite_umengId, "reward");
            List <LTShowItemData> list = new List <LTShowItemData>();

            if (data != null)
            {
                for (int i = 0; i < data.Count; i++)
                {
                    if (data[i] == null)
                    {
                        continue;
                    }
                    string type = EB.Dot.String("type", data[i], string.Empty);
                    string id   = EB.Dot.String("data", data[i], string.Empty);
                    int    num  = EB.Dot.Integer("quantity", data[i], 0);
                    if (!string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(id))
                    {
                        LTShowItemData item = new LTShowItemData(id, num, type);
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 请求扫荡
        /// </summary>
        /// <param name="go"></param>
        private void OnClickWipeOutBtn(GameObject go)
        {
            if (!m_CanChallenge)
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTResourceInstanceHudController_6819"));
                return;
            }
            //打开提示弹窗
            MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_4, string.Format(EB.Localizer.GetString("ID_ALLIANCE_FB_TIP1"), MaxBoxCount), delegate(int result) {
                if (result == 0)
                {
                    //请求扫荡
                    v_UIController.v_Api.RequestBossWipeOut(m_CurrentBoss.monsterId, delegate(Hashtable data) {
                        if (data != null)
                        {
                            DataLookupsCache.Instance.CacheData(data);
                            //弹出奖励界面
                            ArrayList array = (ArrayList)data["reward"];
                            string id, type;
                            int num;
                            if (m_ShowWipeOutList.Count > 0)
                            {
                                m_ShowWipeOutList.Clear();
                            }
                            LTShowItemData golddata         = new LTShowItemData("gold", 0, "res");
                            LTShowItemData alliancegolddata = new LTShowItemData("alliance-gold", 0, "res");
                            for (int i = 0; i < array.Count; i++)
                            {
                                id   = EB.Dot.String("data", array[i], "");
                                num  = EB.Dot.Integer("quantity", array[i], 0);
                                type = EB.Dot.String("type", array[i], LTShowItemType.TYPE_GAMINVENTORY);

                                if (id.Equals("gold"))
                                {
                                    golddata.count += num;
                                }
                                else if (id.Equals("alliance-gold"))
                                {
                                    alliancegolddata.count += num;
                                }
                                else
                                {
                                    m_ShowWipeOutList.Add(new LTShowItemData(id, num, type));
                                }
                            }
                            m_ShowWipeOutList.Insert(0, golddata);
                            m_ShowWipeOutList.Insert(1, alliancegolddata);
                            //赋值奖励链表
                            var ht = Johny.HashtablePool.Claim();
                            ht.Add("reward", m_ShowWipeOutList);
                            GlobalMenuManager.Instance.Open("LTShowRewardView", ht);
                            SetBoss(m_BossIndex, true);
                            FusionTelemetry.GamePlayData.PostEvent(FusionTelemetry.GamePlayData.alliance_camp_topic,
                                                                   FusionTelemetry.GamePlayData.alliance_camp_event_id, FusionTelemetry.GamePlayData.alliance_camp_umengId, "reward");
                        }
                    });
                }
            });
        }
Ejemplo n.º 20
0
 public RewardStageData(int id, int stage, LTShowItemData award, eReceiveState state = eReceiveState.cannot)
 {
     this.Id     = id;
     this.Stage  = stage;
     this.Awards = new List <LTShowItemData>();
     this.Awards.Add(award);
     this.ReceiveState = state;
 }
Ejemplo n.º 21
0
 public static void SetShowAwardsQueue(LTShowItemData itemData)
 {
     if (ShowAwards == null)
     {
         ShowAwards = new Queue();
     }
     ShowAwards.Enqueue(itemData);
 }
Ejemplo n.º 22
0
        /// <summary>
        /// 对数据做加工处理(屏蔽掉一些不用显示的物品)
        /// </summary>
        private void ProcessItemData()
        {
            if (mItemDataList != null)
            {
                List <LTShowItemData> AddList = new List <LTShowItemData>();

                for (int i = mItemDataList.Count - 1; i >= 0; i--)
                {
                    if (LTChargeManager.Instance.IgnoreItemList.Contains(mItemDataList[i].type))
                    {
                        if (mItemDataList[i].type.Equals(LTShowItemType.TYPE_ACTIVITY) || mItemDataList[i].type.Equals(LTShowItemType.TYPE_HEROMEDAL))
                        {
                            //可显示,不处理
                        }
                        else
                        {
                            mItemDataList.RemoveAt(i);
                        }
                    }
                    else if (mItemDataList[i].type.Equals(LTShowItemType.TYPE_HERO))
                    {
                        if (ShowAwards == null)
                        {
                            ShowAwards = new Queue();
                        }

                        ShowAwards.Enqueue(mItemDataList[i]);
                    }
                    else if (mItemDataList[i].type.Equals("res") && mItemDataList[i].count < 0)
                    {
                        mItemDataList.Remove(mItemDataList[i]);
                    }
                    else
                    {
                        //装备需要做不叠加显示(服务器下发的是叠加的)
                        if (mItemDataList[i].count > 1)
                        {
                            var tpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(mItemDataList[i].id);

                            if (tpl != null && tpl is Hotfix_LT.Data.EquipmentItemTemplate)
                            {
                                for (int j = 0; j < mItemDataList[i].count; ++j)
                                {
                                    LTShowItemData newData = new LTShowItemData(mItemDataList[i].id, 1, mItemDataList[i].type, isFromWish: mItemDataList[i].isFromWish);
                                    AddList.Add(newData);
                                }
                                mItemDataList.Remove(mItemDataList[i]);
                            }
                        }
                    }
                }

                if (AddList.Count > 0)
                {
                    mItemDataList.AddRange(AddList);
                }
            }
        }
Ejemplo n.º 23
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();
        }
Ejemplo n.º 24
0
        public void SetItem(LTShowItemData data)
        {
            this.data = data;
            LTShowItemData tempData = new LTShowItemData(data.id, 1, data.type, false);

            item.LTItemData = tempData;
            amountLab.text  = string.Format("x{0}", data.count);

            SetTilteAndIcon();
        }
Ejemplo n.º 25
0
        private void OpenBox(object data, int x, int y)
        {
            ArrayList list = data as ArrayList;

            if (list != null)
            {
                List <LTShowItemData> gamList = new List <LTShowItemData>();
                for (var i = 0; i < list.Count; ++i)
                {
                    var    item = list[i];
                    string type = EB.Dot.String("type", item, string.Empty);
                    string id   = EB.Dot.String("data", item, string.Empty);
                    int    num  = EB.Dot.Integer("quantity", item, 0);
                    if (list.Count == 1 && (type == LTShowItemType.TYPE_RES || type == LTShowItemType.TYPE_HEROSHARD || id == LTDrawCardConfig.LOTTERY_GOLD_ID || id == LTDrawCardConfig.LOTTERY_HC_ID || type == LTShowItemType.TYPE_ACTIVITY))
                    {
                        if (id == LTDrawCardConfig.LOTTERY_GOLD_ID || id == LTDrawCardConfig.LOTTERY_HC_ID || type == LTShowItemType.TYPE_HEROSHARD || id == LTResID.HcName)
                        {
                            FusionAudio.PostEvent("UI/New/ZuanShi", true);//获取抽奖券、碎片、钻石时播放
                        }
                        else if (id == LTResID.GoldName)
                        {
                            FusionAudio.PostEvent("UI/New/Coin", true);//获得金币时播放
                        }
                        else if (id == LTResID.BuddyExpName)
                        {
                            FusionAudio.PostEvent("UI/New/YaoShui", true);//获得伙伴经验时播放
                        }
                        LTIconNameQuality icon_name_lvl = LTItemInfoTool.GetInfo(id, type);
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceHudController_20066"), icon_name_lvl.name, num));
                        continue;
                    }
                    LTShowItemData itemData = new LTShowItemData(id, num, type);
                    gamList.Add(itemData);
                }

                if (gamList.Count > 0)
                {
                    FusionAudio.PostEvent("UI/New/BaoXiang", true);
                    LTInstanceNodeTemp temp = MapCtrl.GetNodeObjByPos(x, y);
                    if (temp != null)
                    {
                        //首领宝箱奖励
                        var floor = temp as Instance.LTInstanceFloorTemp;
                        if (floor != null && floor.hasOtherModel())
                        {
                            //宝箱表现!
                            floor.ShowBossRewardFX(gamList, UICamera.mainCamera.WorldToScreenPoint(FlyScrollObj.transform.position));
                            return;
                        }
                    }
                    //普通宝箱奖励
                    GlobalMenuManager.Instance.Open("LTShowBoxView", gamList);
                }
            }
        }
Ejemplo n.º 26
0
        static public List <LTShowItemData> GetRewardItemDatas()
        {
            int   gold     = 0;
            float gold_mul = 1;

            DataLookupsCache.Instance.SearchIntByID("combat.rewards[0].gold.quantity", out gold);
            if (!DataLookupsCache.Instance.SearchDataByID <float>("combat.rewards[0].gold.mul", out gold_mul))
            {
                gold_mul = 1;
            }

            ArrayList rewards = null;

            DataLookupsCache.Instance.SearchDataByID <ArrayList>(m_RewardListDataID, out rewards);
            List <LTShowItemData> datas = new List <LTShowItemData>();

            if (rewards != null)
            {
                for (int j = 0; j < rewards.Count; j++)
                {
                    string id       = EB.Dot.String("data", rewards[j], "");
                    int    num      = EB.Dot.Integer("quantity", rewards[j], 1);
                    float  mul      = (float)EB.Dot.Double("mul", rewards[j], 1);
                    string type     = EB.Dot.String("type", rewards[j], LTShowItemType.TYPE_GAMINVENTORY);
                    bool   fromWish = EB.Dot.Bool("wishReward", rewards[j], false);

                    int index = datas.FindIndex(delegate(LTShowItemData data)
                    {
                        if (data.id == id)
                        {
                            return(true);
                        }
                        return(false);
                    });

                    if (index < 0)
                    {
                        datas.Add(new LTShowItemData(id, num, type, false, mul, fromWish));
                    }
                    else
                    {
                        datas[index].count = datas[index].count + num;
                    }
                }

                if (gold > 0)
                {
                    var item = new LTShowItemData("gold", gold, LTShowItemType.TYPE_RES, false, gold_mul);
                    datas.Add(item);
                    FusionTelemetry.ItemsUmengCurrency(item, "战斗结算");
                }
            }

            return(datas);
        }
Ejemplo n.º 27
0
 public static void ItemsUmengCurrency(LTShowItemData item, string reason)// FusionTelemetry.ItemsUmengCurrency(
 {
     if (item.id == "hc")
     {
         FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, item.count, reason);
     }
     if (item.id == "gold")
     {
         FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.gold, item.count, reason);
     }
 }
Ejemplo n.º 28
0
        public override void Awake()
        {
            var t = mDMono.transform;

            lTShowItem = t.GetMonoILRComponent <LTShowItem>("Item");
            addvigor   = t.GetComponent <UILabel>("StateShow/Label");
            useitemBtn = t.GetComponent <ConsecutiveClickCoolTrigger>("StateShow/ToGetButton");
            useitemBtn.clickEvent.Add(new EventDelegate(OnUseRecoverItem));
            showdata = new LTShowItemData("vigor", 1, LTShowItemType.TYPE_RES);
            mask     = t.FindEx("StateShow/Mask").gameObject;
        }
Ejemplo n.º 29
0
        public bool UpdateChest()
        {
            int currAchievement = 0;

            DataLookupsCache.Instance.SearchIntByID("user_prize_data.taskacm.curr", out currAchievement);

            List <Hotfix_LT.Data.TimeLimitActivityStageTemplate> stages = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivityStages(ActivityId);
            int stageCount = stages.Count;

            LTHotfixManager.GetManager <TaskManager>().CurrentIndex = GetCurrentStageIndex();
            if (LTHotfixManager.GetManager <TaskManager>().CurrentIndex <= -1 || LTHotfixManager.GetManager <TaskManager>().CurrentIndex >= stageCount)
            {
                EB.Debug.LogError("CurrentIndex <= -1 || CurrentIndex >= stageCount");
                return(false);
            }
            var currentStageData = stages[LTHotfixManager.GetManager <TaskManager>().CurrentIndex];
            int maxAchievement   = currentStageData.stage;

            List <LTShowItemData> itemDatas = new List <LTShowItemData>();

            for (int j = 0; j < currentStageData.reward_items.Count; ++j)
            {
                var            reward   = currentStageData.reward_items[j];
                string         id       = reward.id.ToString();
                int            count    = reward.quantity;
                string         type     = reward.type;
                LTShowItemData itemData = new LTShowItemData(id, count, type, false);
                itemDatas.Add(itemData);
            }

            bool received;

            DataLookupsCache.Instance.SearchDataByID <bool>("user_prize_data.taskacm_reward." + currentStageData.id, out received);
            eReceiveState state = eReceiveState.cannot;

            if (currAchievement >= currentStageData.stage)
            {
                if (received)
                {
                    state = eReceiveState.have;
                }
                else
                {
                    state = eReceiveState.can;
                }
            }
            m_Chest.SetUI(new RewardStageData(currentStageData.id, currentStageData.stage, itemDatas, state));

            LTUIUtil.SetText(m_ProgressLabel, string.Format("{0}/{1}", currAchievement, maxAchievement));
            m_AchievementProgressBar.value = currAchievement / (float)maxAchievement;
            m_ChestRoot.SetActive(true);

            return(true);
        }
Ejemplo n.º 30
0
        public void Init(LTShowItemData data)
        {
            HideUI();
            curData         = data;
            item.LTItemData = data;

            EquipContent.CustomSetActive(false);
            NormalContent.CustomSetActive(true);

            if (data.type == LTShowItemType.TYPE_SCROLL)
            {
                Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(data.id));
                DescLab.text = skillTpl.Description;

                int magicPoint = BalanceResourceUtil.GetResValue("mana");
                MagicPointLab.text = skillTpl.SPCost.ToString();

                MagicObj.CustomSetActive(true);
                DescLab.gameObject.CustomSetActive(true);
            }
            else
            {
                string id = data.id;
                if (data.type == LTShowItemType.TYPE_RES)
                {
                    id = BalanceResourceUtil.GetResID(data.id).ToString();
                }

                Hotfix_LT.Data.EconemyItemTemplate itemTpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id);
                MagicObj.CustomSetActive(false);

                if (itemTpl != null)
                {
                    DescLab.gameObject.CustomSetActive(true);
                    if (itemTpl is Hotfix_LT.Data.EquipmentItemTemplate)
                    {
                        NormalContent.CustomSetActive(false);
                        EquipContent.CustomSetActive(true);
                        InitEquipContent(itemTpl as Hotfix_LT.Data.EquipmentItemTemplate);
                    }
                    else
                    {
                        DescLab.text = itemTpl.Desc;
                    }
                }
                else
                {
                    DescLab.gameObject.CustomSetActive(false);
                }
            }

            ShowUI();
        }