示例#1
0
 public override IEnumerator OnRemoveFromStack()
 {
     StopAllCoroutines();
     if (SelectEquipEven.SelectEquipment != null)
     {
         SelectEquipEven.SelectEquipment(-1);
     }
     DestroySelf();
     yield break;
 }
示例#2
0
        public override IEnumerator OnAddToStack()
        {
            yield return(base.OnAddToStack());

            firstController.UpdateCollider();//更新碰撞体的区域
            if (SelectEquipEven.SelectEquipment != null)
            {
                SelectEquipEven.SelectEquipment(firstController.data.Eid);
            }
        }
示例#3
0
 public void OnRemoveBtnClick()
 {
     if (delGoodsCount <= 0)
     {
         IsPressItemBtn   = false;
         IsPressRemoveBtn = false;
         return;
     }
     delGoodsCount--;
     LTPartnerEquipDataManager.Instance.removeEquipUpItemNum(Data.ECid);
     ShowGoodsCount();
     SelectEquipEven.ChooseEquipment();
 }
示例#4
0
 public void OnItemBtnClick()
 {
     if (Data == null || Data.Num - delGoodsCount <= 0 || JudgeExp())
     {
         IsPressItemBtn   = false;
         IsPressRemoveBtn = false;
         return;
     }
     if (!LTResToolTipController.isOpen)
     {
         LTResToolTipController.Show(LTShowItemType.TYPE_GAMINVENTORY, Data.ECid);
     }
     delGoodsCount++;
     LTPartnerEquipDataManager.Instance.addEquipUpItemNum(Data.ECid);
     ShowGoodsCount();
     SelectEquipEven.ChooseEquipment();
 }
示例#5
0
 public void OnLockBtnClick()
 {
     LTPartnerEquipDataManager.Instance.RequireLock(data.Eid, !data.isLock, delegate
     {
         data = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(data.Eid);
         if (data == null)
         {
             EB.Debug.LogError("LTEquipmentFirstinfo.OnLockBtnClick data is null");
             return;
         }
         LockIcon.spriteName = data.isLock ? "Equipment_Icon_Suoding" : "Equipment_Icon_Jiesuo";
         Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerEquipChange);
         if (m_type == 2)
         {
             if (LTPartnerEquipDataManager.Instance.UpLevelSelectList.Contains(data.Eid))
             {
                 LTPartnerEquipDataManager.Instance.UpLevelSelectList.Remove(data.Eid);
             }
             SelectEquipEven.LockBtnClick(data.Eid);
             SelectEquipEven.ChooseEquipment();
             mDMono.transform.parent.GetComponent <UIController>().Close();
         }
     });
 }
示例#6
0
        public void OnBagItemClick()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");

            if (Data == null || string.IsNullOrEmpty(Data.ECid))
            {
                return;
            }

            if (Data.Eid == 0 && !string.IsNullOrEmpty(Data.ECid))
            {
                UITooltipManager.Instance.DisplayTooltipSrc(Data.ECid, EconomyConstants.System.GENERIC, "default");
                return;
            }

            if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.LevelView)
            {
                if (LTPartnerEquipMainController.CurLevelupEid == Data.Eid)
                {
                    return;
                }

                if (isEquipUpItem)
                {
                    OnItemBtnClick();
                    return;
                }

                if (JudgeExp())
                {
                    return;
                }

                if (Data.isLock)
                {
                    var ht = Johny.HashtablePool.Claim();
                    ht.Add("fromType", 2);
                    ht.Add("eid", Data.Eid);
                    ht.Add("pos", 1);
                    GlobalMenuManager.Instance.Open("LTPartnerEquipmentInfoUI", ht);
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTPartnerEquipCellController_3844"));
                    Johny.HashtablePool.Release(ht);
                    return;
                }

                IsSelect = !IsSelect;
                SelectBG.CustomSetActive(IsSelect);

                if (IsSelect)
                {
                    var ht = Johny.HashtablePool.Claim();
                    ht.Add("fromType", 2);
                    ht.Add("eid", Data.Eid);
                    ht.Add("pos", 1);
                    GlobalMenuManager.Instance.Open("LTPartnerEquipmentInfoUI", ht);

                    if (LTPartnerEquipDataManager.Instance.UpLevelSelectList.Contains(Data.Eid))
                    {
                        return;
                    }

                    LTPartnerEquipDataManager.Instance.UpLevelSelectList.Add(Data.Eid);
                }
                else if (LTPartnerEquipDataManager.Instance.UpLevelSelectList.Contains(Data.Eid))
                {
                    LTPartnerEquipDataManager.Instance.UpLevelSelectList.Remove(Data.Eid);
                }

                SelectEquipEven.ChooseEquipment();
                return;
            }

            if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.SynthesisView)
            {
                var ht = Johny.HashtablePool.Claim();
                ht.Add("fromType", 3);
                ht.Add("eid", Data.Eid);
                ht.Add("pos", 1);
                GlobalMenuManager.Instance.Open("LTPartnerEquipmentInfoUI", ht);
                return;
            }

            bool showBelongInfo = false;

            if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetEditView &&
                LTEquipmentBelongInfoViewController.CanShow(Data.Eid))
            {
                GlobalMenuManager.Instance.Open("LTEquipmentBelongInfoView", Data.Eid);
                showBelongInfo = true;
            }

            var hashTable = Johny.HashtablePool.Claim();

            hashTable.Add("fromType", 0);
            hashTable.Add("eid", Data.Eid);
            hashTable.Add("pos", showBelongInfo ? 3 : 1);
            GlobalMenuManager.Instance.Open("LTPartnerEquipmentInfoUI", hashTable);
        }
示例#7
0
        public void Show(int type, int eid)//0为装备背包栏,1为已装备栏,2为升级背包栏
        {
            m_type = type;
            Pdata  = LTPartnerEquipMainController.CurrentPartnerData;
            if (Pdata == null)
            {
                EB.Debug.LogError("LTEquipmentFirstInfo.Show Pdata == null");
            }
            data = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);
            if (data == null)
            {
                EB.Debug.LogError("LTEquipmentFirstInfo.Show data == null");
                return;
            }
            if (type == 0)
            {
                LevelupBtn.transform.localPosition = new Vector3(-160, -985, 0);
                LevelupBtn.transform.localScale    = Vector3.one;
                LevelupBtn.CustomSetActive(true);
                GetOffBtn.CustomSetActive(false);
                hasEquipObj.CustomSetActive(false);
                EquipSynBtn.CustomSetActive(false);

                if (Pdata == null)
                {
                    return;
                }

                var equippedId = Pdata.GetEquipmentsInfo((int)data.Type - 1).Eid;

                if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetEditView)
                {
                    equippedId = LTPartnerEquipmentInfoController.instance.Eids[(int)data.Type - 1];
                }

                if (equippedId == 0)//没装备
                {
                    ReplaceBtn.transform.GetChild(0).GetComponent <UILabel>().text = ReplaceBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_TIPS_LOAD");
                    SecondInfoUI.mDMono.gameObject.CustomSetActive(false);
                }
                else//有装备
                {
                    ReplaceBtn.transform.GetChild(0).GetComponent <UILabel>().text = ReplaceBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_REPLACE");
                    SecondInfoUI.Show();
                    SecondInfoUI.mDMono.gameObject.CustomSetActive(true);
                }

                ReplaceBtn.CustomSetActive(true);

                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                if (data.FirstSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[false], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[false], data.SecondSuitAttr);
                }
            }
            else if (type == 1)
            {
                LevelupBtn.transform.localPosition = new Vector3(-160, -985, 0);
                LevelupBtn.transform.localScale    = Vector3.one;
                LevelupBtn.CustomSetActive(true);
                GetOffBtn.CustomSetActive(true);
                hasEquipObj.CustomSetActive(true);
                ReplaceBtn.CustomSetActive(false);
                EquipSynBtn.CustomSetActive(false);
                SecondInfoUI.mDMono.gameObject.CustomSetActive(false);
                if (LTPartnerEquipMainController.m_Open && LTPartnerEquipMainController.instance.CurrentEquipmentViewState != LTPartnerEquipMainController.EquipmentViewState.PresetView)
                {
                    GetOffBtn.transform.GetChild(0).GetComponent <UILabel>().text = GetOffBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_TIPS_UNLOAD");
                }
                else
                {
                    GetOffBtn.transform.GetChild(0).GetComponent <UILabel>().text = GetOffBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_REPLACE");
                }
                if (Pdata == null)
                {
                    return;
                }
                List <SuitAttrsSuitTypeAndCount> SuitList = Pdata.EquipmentTotleAttr.SuitList;
                int Count = 0;
                for (int i = 0; i < SuitList.Count; i++)
                {
                    if (data.SuitType == SuitList[i].SuitType)
                    {
                        Count = SuitList[i].count;
                    }
                }

                int suitNeed = 6;
                if (data.FirstSuitAttr != null)
                {
                    suitNeed           = 2;
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    suitNeed           = 4;
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], data.SecondSuitAttr);
                }

                if (Count >= suitNeed)
                {
                    Effect_4Label.effectStyle = UILabel.Effect.Outline8;
                    Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.74f, 1f, 0.85f);
                }
                else
                {
                    Effect_4Label.effectStyle = UILabel.Effect.None;
                    Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                }
            }
            else if (type == 2)
            {
                LevelupBtn.CustomSetActive(false);
                GetOffBtn.CustomSetActive(false);
                hasEquipObj.CustomSetActive(false);
                ReplaceBtn.CustomSetActive(false);
                EquipSynBtn.CustomSetActive(false);
                SecondInfoUI.mDMono.gameObject.CustomSetActive(false);

                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                if (data.FirstSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[false], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[false], data.SecondSuitAttr);
                }
            }
            else if (type == 3)
            {
                LevelupBtn.transform.localPosition = new Vector3(160, -985, 0);
                LevelupBtn.transform.localScale    = Vector3.one;
                LevelupBtn.CustomSetActive(true);
                GetOffBtn.CustomSetActive(false);
                hasEquipObj.CustomSetActive(false);
                ReplaceBtn.CustomSetActive(false);
                //判断显示取回还是放入
                BaseEquipmentInfo[] synArray = LTPartnerEquipMainController.EquipSynArray;
                bool tempisInList            = false;

                for (int i = 0; i < synArray.Length; i++)
                {
                    if (synArray[i] != null)
                    {
                        if (synArray[i].Eid == eid)
                        {
                            //取出
                            EquipSynConditionLabel.text = EquipSynConditionLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_SYN_OUTOFLIST");
                            EquipSynBtn.GetComponent <ConsecutiveClickCoolTrigger>().clickEvent[0] = new EventDelegate(delegate { SelectEquipEven.SelectSynEquipment(eid, false, delegate { InforUI.controller.Close(); }); });
                            tempisInList = true;
                        }
                    }
                }
                if (!tempisInList)
                {
                    //放入
                    EquipSynConditionLabel.text = EquipSynConditionLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_SYN_INTOLIST");
                    EquipSynBtn.GetComponent <ConsecutiveClickCoolTrigger>().clickEvent[0] = new EventDelegate(delegate { SelectEquipEven.SelectSynEquipment(eid, true, delegate { InforUI.controller.Close(); }); });
                }
                EquipSynBtn.CustomSetActive(true);
                SecondInfoUI.mDMono.gameObject.CustomSetActive(false);
                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                if (data.FirstSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[false], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[false], data.SecondSuitAttr);
                }
            }

            DataItem.Fill(data);
            NameLabel.applyGradient  = true;
            NameLabel.gradientTop    = LT.Hotfix.Utility.ColorUtility.QualityToGradientTopColor(data.QualityLevel);
            NameLabel.gradientBottom = LT.Hotfix.Utility.ColorUtility.QualityToGradientBottomColor(data.QualityLevel);
            NameLabel.text           = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = data.Name;

            string MainStr = EquipmentUtility.AttrTypeTrans(data.MainAttributes.Name);

            MainAttr.GetChild(0).GetComponent <UILabel>().text = "[fff348]" + MainStr;
            MainAttr.GetChild(1).GetComponent <UILabel>().text = EquipmentUtility.AttrTypeValue(data.MainAttributes);
            int ExIndex = data.ExAttributes.Count - 1;

            for (int i = 0; i < 4; i++)
            {
                if (i > ExIndex)
                {
                    ExAttr[i].gameObject.CustomSetActive(false);
                }
                else
                {
                    string ExNameStr = EquipmentUtility.AttrTypeTrans(data.ExAttributes[i].Name);
                    ExAttr[i].GetChild(0).GetComponent <UILabel>().text = ExNameStr;
                    ExAttr[i].GetChild(1).GetComponent <UILabel>().text = EquipmentUtility.AttrTypeValue(data.ExAttributes[i]);
                    ExAttr[i].gameObject.CustomSetActive(true);
                }
            }
            Effect_2Label.gameObject.CustomSetActive(false);

            int trans = 0;

            if (type == 2)
            {
                trans = 166;
                EffectTrans.SetParent(EffectPos[0]);
                EffectTrans.localPosition = Vector3.zero;
            }
            else
            {
                EffectTrans.SetParent(EffectPos[1]);
                EffectTrans.localPosition = Vector3.zero;
            }
            mDMono.transform.GetComponent <UIWidget>().height = 619 + 88 * data.ExAttributes.Count + ((Effect_2Label.gameObject.activeSelf) ? Effect_2Label.height : 0) + ((Effect_4Label.gameObject.activeSelf) ? Effect_4Label.height : 0) - trans;
            LockIcon.spriteName = data.isLock ? "Equipment_Icon_Suoding" : "Equipment_Icon_Jiesuo";
        }