Пример #1
0
        public void Initialize(EquipmentInfoData _equipmentinfodata, int modelid)
        {
            this.modelID = _equipmentinfodata.ModelId.ToString();
            this.equipID = _equipmentinfodata.EquipmentId.ToString();
            SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(this.ModelID);

            try
            {
                this.variety = int.Parse(dataById.sub_type.Split(new char[]
                {
                    '|'
                })[1]);
            }
            catch (Exception var_1_61)
            {
            }
            this.classification      = dataById.quality;
            this.runesclassification = (RunesClassification)this.classification;
            this.runesvariety        = (RunesVariety)this.variety;
            UIEventListener.Get(this.rune_compound.gameObject).onClick = new UIEventListener.VoidDelegate(this.Click_2_Item);
            UIEventListener.Get(this.rune_purchase.gameObject).onClick = new UIEventListener.VoidDelegate(this.Click_2_Item);
            this.count            = _equipmentinfodata.Count;
            this.rune_number.text = this.count.ToString();
            if (_equipmentinfodata.Count < 0)
            {
                this.rune_number.text = "0";
            }
            this.SetBtnState(this.count, dataById);
        }
Пример #2
0
 private void OnMsg_DemountCollection(MobaMessage msg)
 {
     if (msg != null)
     {
         if (!this.isExchange)
         {
             EquipmentInfoData equipmentinfodata = (EquipmentInfoData)msg.Param;
             GridHelper.FillGrid <PropViewCollectionUnit>(this.grid, this.collectUnit, this.typeNum, delegate(int idx, PropViewCollectionUnit comp)
             {
                 comp.RefreshData();
                 comp.RefreshUnit(equipmentinfodata, 2);
             });
             MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewClickCollectionItem, this.currEffectItem, false);
         }
         else
         {
             int[] param = new int[]
             {
                 this.currEffectItem.ModelID,
                 1
             };
             MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewUseEffectItem, param, false);
             this.isExchange = false;
         }
     }
     SacrificialCtrl.GetInstance().collectionState = CollectionState.Nothing;
 }
Пример #3
0
    private void NewShow(List <EquipmentInfoData> eid)
    {
        SysCustomizationVo dataById = BaseDataMgr.instance.GetDataById <SysCustomizationVo>(this.modelID.ToString());

        this.newmark.gameObject.SetActive(dataById.newproduct == 1);
        this.isNew  = (dataById.newproduct == 1);
        this.source = int.Parse(dataById.customization_source);
        EquipmentInfoData equipmentInfoData = eid.Find((EquipmentInfoData obj) => obj.ModelId == this.modelID);

        if (dataById.newproduct != 1)
        {
            if (equipmentInfoData != null)
            {
                this.hasWore = (1 == equipmentInfoData.isweared);
                this.exclamation.gameObject.SetActive(!this.hasWore);
            }
            else
            {
                this.exclamation.gameObject.SetActive(false);
            }
        }
        else
        {
            this.exclamation.gameObject.SetActive(false);
        }
    }
        private bool CheckCount()
        {
            this.moneyRequire = 0;
            if (this.countRunesExp <= 0)
            {
                return(false);
            }
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();
            EquipmentInfoData        equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.ModelId == this.modelID_1);
            int num = (equipmentInfoData != null) ? equipmentInfoData.Count : 0;

            equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.ModelId == this.modelID_2);
            int num2 = (equipmentInfoData != null) ? equipmentInfoData.Count : 0;
            int num3 = this.countRunesExp * 3;

            if (num3 <= num2)
            {
                this.runesend.ModelID = this.modelID_3;
                this.runesend.Count1  = 0;
                this.runesend.Count2  = num3;
                this.moneyRequire     = this.countRunesExp * this.cost2to3;
                return(true);
            }
            int num4 = (num3 - num2) * 3;

            this.moneyRequire = (num3 - num2) * this.cost1to2 + this.countRunesExp * this.cost2to3;
            if (num4 <= num)
            {
                this.runesend.ModelID = this.modelID_3;
                this.runesend.Count1  = num4;
                this.runesend.Count2  = num2;
                return(true);
            }
            return(false);
        }
Пример #5
0
        public static void SetModelData()
        {
            DrawCardModelData        drawData = ModelManager.Instance.GetDrawData();
            List <EquipmentInfoData> list     = ModelManager.Instance.Get_equipmentList_X();
            List <EquipmentInfoData> list2    = new List <EquipmentInfoData>();

            list2 = drawData.equipList;
            if (list2 != null && list2.Count != 0)
            {
                foreach (EquipmentInfoData item in list2)
                {
                    EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.EquipmentId == item.EquipmentId);
                    if (equipmentInfoData != null)
                    {
                        if (equipmentInfoData.ModelId == 7777)
                        {
                        }
                        equipmentInfoData.Count += item.Count;
                    }
                    else
                    {
                        list.Add(item);
                    }
                }
            }
        }
Пример #6
0
        private void SetData(int consumption)
        {
            this.costMoney = 0;
            if (this.primaryList != null && this.primaryList.Count != 0)
            {
                for (int l = 0; l < this.primaryList.Count; l++)
                {
                    this.ParseData(this.primaryList[l], consumption);
                }
            }
            List <EquipmentInfoData> list = new List <EquipmentInfoData>();
            int m;

            for (m = 0; m < this.finalmiddleList.Count; m++)
            {
                EquipmentInfoData equipmentInfoData = this.middleList.Find((EquipmentInfoData obj) => obj.ModelId == this.finalmiddleList[m].ModelId);
                if (equipmentInfoData != null)
                {
                    this.finalmiddleList[m].Count += equipmentInfoData.Count;
                    list.Add(equipmentInfoData);
                }
            }
            List <EquipmentInfoData> list2 = new List <EquipmentInfoData>();

            list2 = this.middleList.Except(list).ToList <EquipmentInfoData>();
            list2 = this.middleList.FindAll((EquipmentInfoData obj) => obj.Count >= 3);
            for (int j = 0; j < list2.Count; j++)
            {
                EquipmentInfoData item = new EquipmentInfoData
                {
                    Count       = list2[j].Count,
                    EquipmentId = 0L,
                    ModelId     = list2[j].ModelId
                };
                this.finalmiddleList.Add(item);
            }
            if (this.finalmiddleList != null && this.finalmiddleList.Count != 0)
            {
                for (int k = 0; k < this.finalmiddleList.Count; k++)
                {
                    this.ParseData(this.finalmiddleList[k], consumption, true);
                }
            }
            this.finalmiddleList = this.finalmiddleList.FindAll((EquipmentInfoData obj) => obj.Count > 0);
            int i;

            for (i = 0; i < this.middleList.Count; i++)
            {
                EquipmentInfoData equipmentInfoData2 = this.finalmiddleList.Find((EquipmentInfoData obj) => obj.ModelId == this.middleList[i].ModelId);
                if (equipmentInfoData2 != null && equipmentInfoData2.Count <= this.middleList[i].Count)
                {
                    this.finalmiddleList.Remove(equipmentInfoData2);
                }
                else if (equipmentInfoData2 != null && equipmentInfoData2.Count > this.middleList[i].Count)
                {
                    equipmentInfoData2.Count -= this.middleList[i].Count;
                }
            }
            this.SetDisplay();
        }
Пример #7
0
    private void CountShow(List <EquipmentInfoData> eid)
    {
        EquipmentInfoData equipmentInfoData = eid.Find((EquipmentInfoData obj) => obj.ModelId == this.modelID);

        this.count           = ((equipmentInfoData != null) ? equipmentInfoData.Count : 0);
        this.isOwned         = (null != equipmentInfoData);
        this.countLabel.text = "x" + this.count;
    }
 public void RefreshUnit(EquipmentInfoData equipmentinfodata, int type)
 {
     GridHelper.FillGrid <EffectItem>(this.grid, this.effectItem, this.gameItems.Count, delegate(int idx, EffectItem comp)
     {
         EquipmentInfoData eid2 = this.equipList.Find((EquipmentInfoData eid) => eid.ModelId == int.Parse(this.gameItems[idx].items_id));
         comp.Refresh(eid2, equipmentinfodata.ModelId, type);
         comp.CollectionIsUsing(this.heroID);
         comp.CheckIsCurrentHero(this.ItemListCurrHero, this.ItemListAllHero);
     });
 }
Пример #9
0
        private void ReFreshOwned()
        {
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();

            if (list != null)
            {
                EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.ModelId == this.modelID_2);
                this.CountRunesOwn = ((equipmentInfoData != null) ? equipmentInfoData.Count : 0);
            }
        }
Пример #10
0
        private void RefreshOwned()
        {
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();

            if (list != null && list.Count > 0)
            {
                EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.ModelId == this.modelID_1);
                this.CountRunes     = ((equipmentInfoData != null) ? equipmentInfoData.Count : 0);
                this.beforePurchase = this.countRunes;
            }
        }
Пример #11
0
        private void AfterPurchase()
        {
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();

            if (list != null && list.Count > 0)
            {
                EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.ModelId == this.modelID_1);
                this.CountRunes    = ((equipmentInfoData != null) ? equipmentInfoData.Count : 0);
                this.afterPurchase = this.countRunes;
            }
            MobaMessageManagerTools.SendClientMsg(ClientV2C.coalesceviewAfterPurchase, null, false);
        }
Пример #12
0
 public void Refresh(EquipmentInfoData eid, int eModelID, int type)
 {
     if (eModelID == this.modelID)
     {
         this.isUsing = (1 == type);
     }
     else
     {
         this.isUsing = false;
     }
     this.CountShow(eid);
     this.NewShow(eid);
 }
Пример #13
0
 private void OnMsg_WearCollection(MobaMessage msg)
 {
     if (msg != null)
     {
         EquipmentInfoData equipmentinfodata = (EquipmentInfoData)msg.Param;
         GridHelper.FillGrid <PropViewCollectionUnit>(this.grid, this.collectUnit, this.typeNum, delegate(int idx, PropViewCollectionUnit comp)
         {
             comp.RefreshData();
             comp.RefreshUnit(equipmentinfodata, 1);
         });
     }
     MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewClickCollectionItem, this.currEffectItem, false);
     SacrificialCtrl.GetInstance().collectionState = CollectionState.Nothing;
 }
Пример #14
0
 public void Init(EquipmentInfoData eid, SysGameItemsVo sgi, EffectType effType, int idx, long heroid)
 {
     this.effectType       = effType;
     this.modelID          = int.Parse(sgi.items_id);
     this.gameitem         = sgi;
     this.quality          = this.gameitem.quality;
     this.type             = this.gameitem.hero_decorate_type;
     this.icon             = this.gameitem.icon;
     this.name             = LanguageManager.Instance.GetStringById(this.gameitem.name);
     this.frame.spriteName = "Hero_personal_frame_0" + this.quality;
     this.frame.SetDimensions(176, 176);
     this.CollectionIsUsing(heroid);
     this.CountShow(eid);
     this.NewShow(eid);
     UIEventListener.Get(this.frame.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickItem);
 }
Пример #15
0
        private void GetData()
        {
            this.originList.Clear();
            this.finalmiddleList.Clear();
            this.finalhighList.Clear();
            this.primaryList.Clear();
            this.middleList.Clear();
            List <EquipmentInfoData>            list      = ModelManager.Instance.Get_equipmentList_X();
            Dictionary <string, SysGameItemsVo> gameItems = BaseDataMgr.instance.GetTypeDicByType <SysGameItemsVo>();

            if (gameItems == null)
            {
                return;
            }
            for (int num = 0; num != list.Count; num++)
            {
                if (list[num] != null)
                {
                    string key = list[num].ModelId.ToString();
                    if (gameItems.ContainsKey(key) && gameItems[key].type == 4)
                    {
                        this.originList.Add(list[num]);
                    }
                }
            }
            EquipmentInfoData equipmentInfoData = this.originList.Find((EquipmentInfoData obj) => 1 == gameItems[obj.ModelId.ToString()].quality);

            if (this.cost1to2 == 0 && equipmentInfoData != null)
            {
                this.cost1to2 = gameItems[this.originList.Find((EquipmentInfoData obj) => 1 == gameItems[obj.ModelId.ToString()].quality).ModelId.ToString()].consumption_money;
            }
            if (this.cost2to3 == 0)
            {
                equipmentInfoData = this.originList.Find((EquipmentInfoData obj) => 2 == gameItems[obj.ModelId.ToString()].quality);
                if (equipmentInfoData != null)
                {
                    this.cost2to3 = gameItems[this.originList.Find((EquipmentInfoData obj) => 2 == gameItems[obj.ModelId.ToString()].quality).ModelId.ToString()].consumption_money;
                }
            }
            int  num2 = 0;
            bool flag = this.originList != null && this.originList.Count != 0 && int.TryParse(gameItems[this.originList[0].ModelId.ToString()].consumption, out num2);

            this.primaryList.AddRange(this.originList.FindAll((EquipmentInfoData obj) => obj.Count >= 3 && 1 == gameItems[obj.ModelId.ToString()].quality));
            this.middleList.AddRange(this.originList.FindAll((EquipmentInfoData obj) => 2 == gameItems[obj.ModelId.ToString()].quality));
            this.SetData((!flag) ? 3 : num2);
        }
Пример #16
0
        private void AddExpPress(GameObject obj, bool isPress)
        {
            EquipmentInfoData equipmentInfoData = ModelManager.Instance.Get_equipmentList_X().Find((EquipmentInfoData eb) => eb.ModelId == 7777);

            if (!NetWorkHelper.Instance.IsGateAvailable)
            {
                Singleton <TipView> .Instance.ShowViewSetText("网络环境较差,请稍后再试", 1f);
            }
            else if (equipmentInfoData == null || equipmentInfoData.Count == 0)
            {
                this.PurchaseExp(obj);
            }
            else if (isPress)
            {
                if (BottleViewCtrl.GetInstance().drawState == DrawState.Nothing)
                {
                    BottleViewCtrl.GetInstance().drawState = DrawState.Drawing;
                    this.isStop  = false;
                    this.isClick = true;
                    if (this.long_coroutine != null)
                    {
                        base.StopCoroutine("IsLongPress");
                    }
                    this.long_coroutine = base.StartCoroutine("IsLongPress");
                }
            }
            else
            {
                this.isStop = true;
                if (this.long_coroutine != null)
                {
                    base.StopCoroutine("IsLongPress");
                }
                this.realTime = 0f;
                if (this.isClick)
                {
                    if (this.click_coroutine != null)
                    {
                        return;
                    }
                    MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemChangeBottleOnce, 0.3f, false);
                    this.UseExpBall(1);
                }
            }
        }
Пример #17
0
        public void Init(EquipmentInfoData _equipmentinfodata, int modelid)
        {
            this.modelID = _equipmentinfodata.ModelId.ToString();
            this.equipID = _equipmentinfodata.EquipmentId.ToString();
            SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(this.ModelID);

            try
            {
                this.variety = int.Parse(dataById.sub_type.Split(new char[]
                {
                    '|'
                })[1]);
            }
            catch (Exception var_1_62)
            {
            }
            this.classification      = dataById.quality;
            this.runesclassification = (RunesClassification)this.classification;
            this.runesvariety        = (RunesVariety)this.variety;
            UIEventListener.Get(this.rune_inlay.gameObject).onClick   = new UIEventListener.VoidDelegate(this.ClickItem);
            UIEventListener.Get(this.rune_demount.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickItem);
            this.count            = _equipmentinfodata.Count;
            this.rune_number.text = this.count.ToString();
            if (_equipmentinfodata.Count < 0)
            {
                this.rune_number.text = "0";
            }
            this.rune_compound.gameObject.SetActive(false);
            if (modelid != 0)
            {
                bool flag = modelid == int.Parse(this.modelID);
                this.runesstate = ((!flag) ? RunesState.UnEquiped : RunesState.Equipted);
                this.rune_inlay.gameObject.SetActive(!flag);
                this.rune_demount.gameObject.SetActive(flag);
            }
            else
            {
                this.runesstate = RunesState.UnEquiped;
                this.rune_number.gameObject.SetActive(true);
                this.rune_inlay.gameObject.SetActive(true);
                this.rune_demount.gameObject.SetActive(false);
            }
            this.Details(dataById);
        }
Пример #18
0
        private void RefreshDataUI()
        {
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();
            EquipmentInfoData        equipmentInfoData = new EquipmentInfoData();

            if (list != null)
            {
                equipmentInfoData = ModelManager.Instance.Get_equipmentList_X().Find((EquipmentInfoData obj) => obj.ModelId == 7777);
            }
            if (equipmentInfoData != null && equipmentInfoData.Count != 0)
            {
                MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemAddExpBallSuccess, equipmentInfoData.Count, false);
            }
            else
            {
                MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemAddExpBallSuccess, 0, false);
            }
            BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
        }
Пример #19
0
        private void ParseData(EquipmentInfoData eid, int consumption)
        {
            SysGameItemsVo dataById  = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(eid.ModelId.ToString());
            SysGameItemsVo dataById2 = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(dataById.synthetic_id);
            int            count     = eid.Count;
            int            num       = count / consumption;
            int            num2      = count % consumption;

            if (num > 0)
            {
                int modelId            = int.Parse(dataById.synthetic_id);
                EquipmentInfoData item = new EquipmentInfoData
                {
                    Count       = num,
                    EquipmentId = 0L,
                    ModelId     = modelId
                };
                this.finalmiddleList.Add(item);
                int num3 = this.cost1to2 * num;
                this.costMoney += num3;
            }
        }
Пример #20
0
        private void ParseData(EquipmentInfoData eid, int consumption, bool is2to3)
        {
            if (!is2to3)
            {
                return;
            }
            SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(eid.ModelId.ToString());
            int            count    = eid.Count;
            int            num      = count / consumption;
            int            count2   = count % consumption;

            if (num > 0)
            {
                int num2 = int.Parse(dataById.synthetic_id);
                if (this.finalhighList != null && this.finalhighList.Count > 0)
                {
                    for (int i = 0; i < this.finalhighList.Count; i++)
                    {
                        if (this.finalhighList[i].ModelId == num2)
                        {
                            this.finalhighList[i].Count += num;
                            break;
                        }
                    }
                }
                EquipmentInfoData item = new EquipmentInfoData
                {
                    Count       = num,
                    EquipmentId = 0L,
                    ModelId     = num2
                };
                this.finalhighList.Add(item);
                int num3 = this.cost2to3 * num;
                this.costMoney += num3;
                eid.Count       = count2;
            }
        }
Пример #21
0
        private int ReturnInitCount(int modelid)
        {
            if (modelid == 0)
            {
                return(0);
            }
            int num = 0;
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();

            if (list != null)
            {
                EquipmentInfoData equipmentInfoData = list.Find((EquipmentInfoData obj) => obj.ModelId == modelid);
                int arg_58_0 = (equipmentInfoData != null) ? equipmentInfoData.Count : 0;
            }
            SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(modelid.ToString());
            bool           flag     = true;

            if (dataById != null)
            {
                flag = int.TryParse(dataById.consumption, out num);
            }
            num = ((flag && num != 0) ? num : 3);
            return(0);
        }
Пример #22
0
        private void ActionUseExp(MobaMessage msg)
        {
            int num = 0;

            if (msg != null)
            {
                num = (int)msg.Param;
            }
            if (num != 0)
            {
                EquipmentInfoData equipmentInfoData = ModelManager.Instance.Get_equipmentList_X().Find((EquipmentInfoData obj) => obj.ModelId == 7777);
                if (equipmentInfoData == null)
                {
                    CtrlManager.ShowMsgBox("NullException!", "没有道具可以被找到", delegate
                    {
                    }, PopViewType.PopOneButton, "确定", "取消", null);
                }
                else if (num != 0)
                {
                    if (equipmentInfoData.Count - num >= 0)
                    {
                        SendMsgManager.SendMsgParam param = new SendMsgManager.SendMsgParam(true, "正在使用道具...", true, 15f);
                        SendMsgManager.Instance.SendMsg(MobaGameCode.UseProps, param, new object[]
                        {
                            equipmentInfoData.EquipmentId,
                            num,
                            "0"
                        });
                    }
                    if (equipmentInfoData.Count <= 0)
                    {
                        Singleton <TipView> .Instance.ShowViewSetText("小魔瓶经验球不足!", 1f);
                    }
                }
            }
        }
Пример #23
0
    private void InitEquipNewMark(EquipmentInfoData eid)
    {
        SysCustomizationVo dataById = BaseDataMgr.instance.GetDataById <SysCustomizationVo>(this.modelID.ToString());

        this.newmark.gameObject.SetActive(dataById.newproduct == 1);
        this.isNew  = (dataById.newproduct == 1);
        this.source = int.Parse(dataById.customization_source);
        if (dataById.newproduct != 1)
        {
            if (eid != null)
            {
                this.hasWore = (1 == eid.isweared);
                this.exclamation.gameObject.SetActive(!this.hasWore);
            }
            else
            {
                this.exclamation.gameObject.SetActive(false);
            }
        }
        else
        {
            this.exclamation.gameObject.SetActive(false);
        }
    }
Пример #24
0
 public void SetData(bool resetPosition = true)
 {
     if (this.gameItems == null || this.gameItems.Count == 0)
     {
         return;
     }
     this.gameItems.Sort(new Comparison <SysGameItemsVo>(this.CustomSort));
     this.horizontalview.GetComponent <UIPanel>().widgetsAreStatic = false;
     GridHelper.FillGrid <EffectItem>(this.grid, this.effectItem, this.gameItems.Count, delegate(int idx, EffectItem comp)
     {
         EquipmentInfoData eid2 = this.equipList.Find((EquipmentInfoData eid) => eid.ModelId == int.Parse(this.gameItems[idx].items_id));
         comp.Init(eid2, this.gameItems[idx], this.effectType, idx, this.heroID);
         comp.GenerateScrollView(this.horizontalview, this.verticalView);
         comp.CheckIsCurrentHero(this.ItemListCurrHero, this.ItemListAllHero);
         comp.name          = this.effectType.ToString() + this.gameItems[idx].items_id;
         comp.ClickCallback = new Callback <GameObject>(this.ClickItemState);
     });
     if (resetPosition)
     {
         this.grid.Reposition();
         this.horizontalview.ResetPosition();
     }
     this.horizontalview.GetComponent <UIPanel>().widgetsAreStatic = true;
 }
Пример #25
0
        private void GenerateSort(int modelid)
        {
            if (modelid != 0 && !this.eidList.Any((EquipmentInfoData obj) => obj.ModelId == modelid))
            {
                EquipmentInfoData item = new EquipmentInfoData
                {
                    ModelId     = modelid,
                    EquipmentId = 0L,
                    Count       = 0
                };
                this.eidList.Add(item);
            }
            if (this.eidList.Count < this.gridRunesArea.transform.childCount)
            {
                int num  = this.gridRunesArea.transform.childCount - this.eidList.Count;
                int num2 = this.gridRunesArea.transform.childCount - 1;
                while (this.eidList.Count != this.gridRunesArea.transform.childCount)
                {
                    UnityEngine.Object.DestroyImmediate(this.gridRunesArea.transform.GetChild(num2).gameObject);
                    num2--;
                }
            }
            GridHelper.FillGrid <RunesOperationItem>(this.gridRunesArea, this.runesoperationitem, this.eidList.Count, delegate(int idx, RunesOperationItem comp)
            {
                comp.Init(this.eidList[idx], modelid);
                comp.name = this.eidList[idx].ModelId.ToString();
                if (modelid != 0 && this.eidList[idx].ModelId == modelid)
                {
                    comp.name = "0";
                }
                comp.ClickCallBack = new Callback <RunesOperationItem, GameObject>(this.Operation);
            });
            List <RunesOperationItem> list = new List <RunesOperationItem>();

            for (int num3 = 0; num3 != this.gridRunesArea.transform.childCount; num3++)
            {
                list.Add(this.gridRunesArea.transform.GetChild(num3).GetComponent <RunesOperationItem>());
            }
            list.Sort(new Comparison <RunesOperationItem>(this.SortByCustom));
            if (this.gridRunesArea.transform.childCount == list.Count)
            {
                for (int num4 = 0; num4 != list.Count; num4++)
                {
                    RunesOperationItem runesOperationItem = list[num4];
                    for (int num5 = 0; num5 != this.gridRunesArea.transform.childCount; num5++)
                    {
                        if (this.gridRunesArea.transform.GetChild(num5).name.CompareTo(runesOperationItem.name) == 0)
                        {
                            this.gridRunesArea.transform.GetChild(num5).name = string.Format("{0:D3}", num4);
                            break;
                        }
                    }
                }
            }
            this.RePosition();
            this.allRunesList.Clear();
            for (int num6 = 0; num6 != this.gridRunesArea.transform.childCount; num6++)
            {
                this.allRunesList.Add(this.gridRunesArea.transform.GetChild(num6).GetComponent <RunesOperationItem>());
            }
            this.ReCheckToggle();
        }
Пример #26
0
        public void Init(int rank, int idx, List <string> list_key, HeroInfoData heroinfodata)
        {
            Dictionary <string, SysHeroRunsUnlockVo> typeDicByType = BaseDataMgr.instance.GetTypeDicByType <SysHeroRunsUnlockVo>();

            this.level_frame_hightlight.gameObject.SetActive(false);
            switch (idx + 1)
            {
            case 1:
                this.modelID = heroinfodata.Ep_1;
                break;

            case 2:
                this.modelID = heroinfodata.Ep_2;
                break;

            case 3:
                this.modelID = heroinfodata.Ep_3;
                break;

            case 4:
                this.modelID = heroinfodata.Ep_4;
                break;

            case 5:
                this.modelID = heroinfodata.Ep_5;
                break;

            case 6:
                this.modelID = heroinfodata.Ep_6;
                break;
            }
            EquipmentInfoData equipmentInfoData = ModelManager.Instance.Get_equipmentList_X().Find((EquipmentInfoData obj) => obj.ModelId == this.modelID);

            this.equipID = ((equipmentInfoData != null) ? equipmentInfoData.EquipmentId : 0L);
            if (idx + 1 <= rank)
            {
                this.level_rune.gameObject.SetActive(true);
                this.level_num.gameObject.SetActive(false);
                this.level_icon.spriteName = "Hero_rune_icon_sword";
                this.level_icon.MakePixelPerfect();
                this.limit_lock = Limit_lock.unlocked;
                if (this.modelID > 0)
                {
                    SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(this.modelID.ToString());
                    this.level_rune.spriteName = dataById.icon;
                }
                else
                {
                    this.level_rune.spriteName = string.Empty;
                }
            }
            else
            {
                this.level_rune.gameObject.SetActive(false);
                this.level_num.gameObject.SetActive(true);
                this.level_num.spriteName = "Hero_rune_level_" + typeDicByType[list_key[idx]].unlock_level;
                this.level_num.MakePixelPerfect();
                this.rank_rune  = typeDicByType[list_key[idx]].unlock_level;
                this.limit_lock = Limit_lock.locked;
            }
            this.rune_position = (Rune_Position)int.Parse(list_key[idx]);
            UIEventListener.Get(base.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickRune);
        }
Пример #27
0
 private void CountShow(EquipmentInfoData eid)
 {
     this.count           = ((eid != null) ? eid.Count : 0);
     this.isOwned         = (null != eid);
     this.countLabel.text = "x" + this.count;
 }
Пример #28
0
        public static void Set_settle_2GetItemsView(this ModelManager mmng)
        {
            if (mmng == null)
            {
                CtrlManager.CloseWindow(WindowID.GetItemsView);
                return;
            }
            SettlementModelData settlementModelData = mmng.Get_SettlementModelData();

            if (settlementModelData == null)
            {
                CtrlManager.CloseWindow(WindowID.GetItemsView);
                return;
            }
            if (settlementModelData.dropRtnData == null || settlementModelData.equipRtnData == null || settlementModelData.heroRtnData == null || (settlementModelData.dropRtnData.Count == 0 && settlementModelData.equipRtnData.Count == 0 && settlementModelData.heroRtnData.Count == 0))
            {
                CtrlManager.CloseWindow(WindowID.GetItemsView);
                return;
            }
            DropItemData dropItemData = settlementModelData.dropRtnData.Find((DropItemData obj) => obj.itemId == 2 && obj.itemType == 1);
            int          num          = (dropItemData != null) ? dropItemData.itemCount : 0;

            dropItemData = settlementModelData.dropRtnData.Find((DropItemData obj) => obj.itemId == 9 && obj.itemType == 1);
            int num2 = (dropItemData != null) ? dropItemData.itemCount : 0;

            HeroInfoData[] array  = settlementModelData.heroRtnData.ToArray();
            DropItemData[] array2 = (from obj in settlementModelData.dropRtnData
                                     where obj.itemId == 2 && obj.itemType == 3
                                     select obj).ToArray <DropItemData>();
            EquipmentInfoData[] array3 = settlementModelData.equipRtnData.ToArray();
            DropItemData[]      array4 = (from obj in settlementModelData.dropRtnData
                                          where obj.itemId == 3 && obj.itemType == 3
                                          select obj).ToArray <DropItemData>();
            DropItemData[] array5 = (from obj in settlementModelData.dropRtnData
                                     where obj.itemId == 4 && obj.itemType == 3
                                     select obj).ToArray <DropItemData>();
            DropItemData[] array6 = (from obj in settlementModelData.dropRtnData
                                     where obj.itemId == 5 && obj.itemType == 3
                                     select obj).ToArray <DropItemData>();
            DropItemData[] array7 = (from obj in settlementModelData.dropRtnData
                                     where obj.itemType == 6
                                     select obj).ToArray <DropItemData>();
            bool flag = false;

            EquipmentInfoData[] array8 = array3;
            for (int i = 0; i < array8.Length; i++)
            {
                EquipmentInfoData equipmentInfoData = array8[i];
                SysGameItemsVo    dataById          = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(equipmentInfoData.ModelId.ToString());
                if (equipmentInfoData.ModelId == 7777)
                {
                    MobaMessageManagerTools.GetItems_Bottle(equipmentInfoData.Count);
                }
                else if (dataById.type == 4)
                {
                    MobaMessageManagerTools.GetItems_Rune(equipmentInfoData.ModelId);
                }
                else
                {
                    MobaMessageManagerTools.GetItems_GameItem(equipmentInfoData.ModelId.ToString());
                }
            }
            MobaMessageManagerTools.GetItems_Diamond(num);
            MobaMessageManagerTools.GetItems_Caps(num2);
            DropItemData[] array9 = array4;
            for (int j = 0; j < array9.Length; j++)
            {
                DropItemData dropItemData2 = array9[j];
                for (int k = 0; k < settlementModelData.repeatRtnData.Count; k++)
                {
                    if (settlementModelData.repeatRtnData[k].itemType == 3 && settlementModelData.repeatRtnData[k].itemId == 3 && settlementModelData.repeatRtnData[k].itemCount == dropItemData2.itemCount)
                    {
                        MobaMessageManagerTools.GetItems_Exchange(Com.Game.Module.ItemType.HeadPortrait, dropItemData2.itemCount.ToString(), true);
                        flag = true;
                    }
                }
                if (flag)
                {
                    flag = false;
                }
                else
                {
                    MobaMessageManagerTools.GetItems_HeadPortrait(dropItemData2.itemCount);
                }
            }
            DropItemData[] array10 = array5;
            for (int l = 0; l < array10.Length; l++)
            {
                DropItemData dropItemData3 = array10[l];
                for (int m = 0; m < settlementModelData.repeatRtnData.Count; m++)
                {
                    if (settlementModelData.repeatRtnData[m].itemType == 3 && settlementModelData.repeatRtnData[m].itemId == 4 && settlementModelData.repeatRtnData[m].itemCount == dropItemData3.itemCount)
                    {
                        MobaMessageManagerTools.GetItems_Exchange(Com.Game.Module.ItemType.PortraitFrame, dropItemData3.itemCount.ToString(), true);
                        flag = true;
                    }
                }
                if (flag)
                {
                    flag = false;
                }
                else
                {
                    MobaMessageManagerTools.GetItems_PortraitFrame(dropItemData3.itemCount.ToString());
                }
            }
            HeroInfoData[] array11 = array;
            HeroInfoData   item;

            for (int n = 0; n < array11.Length; n++)
            {
                item = array11[n];
                for (int num3 = 0; num3 < settlementModelData.repeatRtnData.Count; num3++)
                {
                    if ((long)settlementModelData.repeatRtnData[num3].itemCount == item.HeroId)
                    {
                        Dictionary <string, SysHeroMainVo> typeDicByType = BaseDataMgr.instance.GetTypeDicByType <SysHeroMainVo>();
                        string npc_id = typeDicByType.Values.FirstOrDefault((SysHeroMainVo obj) => (long)obj.hero_id == item.HeroId).npc_id;
                        MobaMessageManagerTools.GetItems_Exchange(Com.Game.Module.ItemType.Hero, npc_id, true);
                        flag = true;
                    }
                }
                if (flag)
                {
                    flag = false;
                }
                else
                {
                    MobaMessageManagerTools.GetItems_Hero(item.ModelId);
                }
            }
            DropItemData[] array12 = array2;
            for (int num4 = 0; num4 < array12.Length; num4++)
            {
                DropItemData dropItemData4 = array12[num4];
                for (int num5 = 0; num5 < settlementModelData.repeatRtnData.Count; num5++)
                {
                    if (settlementModelData.repeatRtnData[num5].itemType == 3 && settlementModelData.repeatRtnData[num5].itemId == 2 && settlementModelData.repeatRtnData[num5].itemCount == dropItemData4.itemCount)
                    {
                        MobaMessageManagerTools.GetItems_Exchange(Com.Game.Module.ItemType.HeroSkin, dropItemData4.itemCount.ToString(), true);
                        flag = true;
                    }
                }
                if (flag)
                {
                    flag = false;
                }
                else
                {
                    MobaMessageManagerTools.GetItems_HeroSkin(dropItemData4.itemCount);
                }
            }
            DropItemData[] array13 = array6;
            for (int num6 = 0; num6 < array13.Length; num6++)
            {
                DropItemData dropItemData5 = array13[num6];
                for (int num7 = 0; num7 < settlementModelData.repeatRtnData.Count; num7++)
                {
                    if (settlementModelData.repeatRtnData[num7].itemType == 3 && settlementModelData.repeatRtnData[num7].itemId == 5 && settlementModelData.repeatRtnData[num7].itemCount == dropItemData5.itemCount)
                    {
                        MobaMessageManagerTools.GetItems_Exchange(Com.Game.Module.ItemType.Coupon, dropItemData5.itemCount.ToString(), true);
                        flag = true;
                    }
                }
                if (flag)
                {
                    flag = false;
                }
                else
                {
                    MobaMessageManagerTools.GetItems_Coupon(dropItemData5.itemCount.ToString());
                }
            }
            DropItemData[] array14 = array7;
            for (int num8 = 0; num8 < array14.Length; num8++)
            {
                DropItemData dropItemData6 = array14[num8];
                MobaMessageManagerTools.GetItems_GameBuff(dropItemData6.itemId);
                SendMsgManager.Instance.SendMsg(MobaGameCode.GetDoubleCard, null, new object[0]);
            }
            Singleton <GetItemsView> .Instance.Play();
        }
Пример #29
0
        public static void Get_Settle_SavingData(this ModelManager mmng)
        {
            SettlementModelData settlementModelData = mmng.Get_SettlementModelData();
            DropItemData        dropItemData        = settlementModelData.dropRtnData.Find((DropItemData obj) => obj.itemId == 2 && obj.itemType == 1);
            int num = (dropItemData != null) ? dropItemData.itemCount : 0;

            dropItemData = settlementModelData.dropRtnData.Find((DropItemData obj) => obj.itemId == 9 && obj.itemType == 1);
            int num2 = (dropItemData != null) ? dropItemData.itemCount : 0;

            HeroInfoData[] array = settlementModelData.heroRtnData.ToArray();
            if (array != null)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    if (!ModelManager.Instance.Get_heroInfo_list_X().Contains(array[i]))
                    {
                        ModelManager.Instance.Get_heroInfo_list_X().Add(array[i]);
                    }
                }
                CharacterDataMgr.instance.UpdateHerosData();
            }
            EquipmentInfoData[] array2 = settlementModelData.equipRtnData.ToArray();
            DropItemData[]      array3 = (from obj in settlementModelData.dropRtnData
                                          where obj.itemId == 3 && obj.itemType == 3
                                          select obj).ToArray <DropItemData>();
            DropItemData[] array4 = (from obj in settlementModelData.dropRtnData
                                     where obj.itemId == 4 && obj.itemType == 3
                                     select obj).ToArray <DropItemData>();
            DropItemData[] array5 = (from obj in settlementModelData.dropRtnData
                                     where obj.itemId == 5 && obj.itemType == 3
                                     select obj).ToArray <DropItemData>();
            if (settlementModelData.coin_Delta > 0)
            {
                SendMsgManager.Instance.SendMsg(MobaGameCode.GetCurrencyCount, null, new object[]
                {
                    1
                });
            }
            if (settlementModelData.summonerExp_Delta > 0)
            {
                mmng.Get_userData_X().Exp += (long)settlementModelData.summonerExp_Delta;
                CharacterDataMgr.instance.SaveNowUserLevel(mmng.Get_userData_X().Exp);
            }
            SendMsgManager.Instance.SendMsg(MobaGameCode.GetMagicBottleInfo, null, new object[0]);
            if (num > 0)
            {
                SendMsgManager.Instance.SendMsg(MobaGameCode.GetCurrencyCount, null, new object[]
                {
                    2
                });
            }
            if (num2 > 0)
            {
                mmng.Get_userData_X().SmallCap += num2;
            }
            EquipmentInfoData[] array6 = array2;
            EquipmentInfoData   runeItem;

            for (int j = 0; j < array6.Length; j++)
            {
                runeItem = array6[j];
                if (mmng.Get_equipmentList_X().Find((EquipmentInfoData obj) => obj.EquipmentId == runeItem.EquipmentId) == null)
                {
                    mmng.Get_equipmentList_X().Add(runeItem);
                }
                else
                {
                    mmng.Get_equipmentList_X().Find((EquipmentInfoData obj) => obj.EquipmentId == runeItem.EquipmentId).Count += runeItem.Count;
                }
            }
            DropItemData[] array7 = array3;
            for (int k = 0; k < array7.Length; k++)
            {
                DropItemData dropItemData2 = array7[k];
                mmng.GetNewAvatar("3", dropItemData2.itemCount.ToString());
            }
            DropItemData[] array8 = array4;
            for (int l = 0; l < array8.Length; l++)
            {
                DropItemData dropItemData3 = array8[l];
                mmng.GetNewAvatar("4", dropItemData3.itemCount.ToString());
            }
            DropItemData[] array9 = array5;
            for (int m = 0; m < array9.Length; m++)
            {
                DropItemData dropItemData4 = array9[m];
                mmng.GetNewCoupon(dropItemData4.itemCount.ToString());
            }
            if (LevelManager.m_CurLevel.IsLeague(LevelManager.CurBattleId))
            {
                EquipmentInfoData equipmentInfoData = ModelManager.Instance.Get_equipmentList_X().Find((EquipmentInfoData obj) => obj.ModelId == 8000);
                if (equipmentInfoData == null)
                {
                    return;
                }
                if (equipmentInfoData.Count <= 1)
                {
                    ModelManager.Instance.Get_equipmentList_X().Remove(equipmentInfoData);
                }
                else
                {
                    equipmentInfoData.Count--;
                }
            }
            SendMsgManager.Instance.SendMsg(MobaGameCode.GetTaskList, null, new object[]
            {
                0
            });
            SendMsgManager.Instance.SendMsg(MobaGameCode.ShowDailyTask, null, new object[0]);
            if (GameManager.IsVictory.Value)
            {
                ModelManager.Instance.RemoveWinCard();
            }
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurBattleId);
            bool             flag     = LevelManager.m_CurLevel.IsFightWithRobot() || LevelManager.m_CurLevel.IsBattleNewbieGuide() || mmng.Get_Settle_IsSelfDefine();

            ModelManager.Instance.Get_GetMyAchievementData_X().HaveFight = !flag;
            if (ModelManager.Instance.Get_GetMyAchievementData_X().HaveFight)
            {
                SendMsgManager.Instance.SendMsg(MobaGameCode.GetKdaMyHeroData, null, new object[0]);
                SendMsgManager.Instance.SendMsg(MobaGameCode.GetHomeTotalRecord, null, new object[0]);
            }
        }