少年修仙传客户端代码仓库
client_linchunjie
2019-04-22 46ad58a72ef54b285bdc59f004be0fb8ae375439
3290 【2.0】【BUG】强化达到上限显示错误
3个文件已修改
171 ■■■■■ 已修改文件
System/EquipGem/EquipStrengthRein.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthUpper.cs 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthWin.cs 134 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthRein.cs
@@ -60,6 +60,7 @@
                    itemTipsModel.ShowTip();
                });
            }
            m_TextNumber.text = "+" + (equipLv + 1);
            DisplayMoney();
System/EquipGem/EquipStrengthUpper.cs
@@ -41,16 +41,12 @@
                equipLv = strengthModel.EquipStrengthDic[equipIndex].StrengthLevel;
                equipStrength = strengthModel.EquipStrengthDic[equipIndex];
            }
            NeedMoney.gameObject.SetActive(false);
            var itemPlus = strengthModel.GetEquipConfig(level, equipPlace);
            if (itemPlus == null)
            {
                DebugEx.LogError("没有索引到对应的强化表数据");
                return;
            }
            m_TextNumber.text = "+" + (equipLv);
            var item = packModel.GetItemByGuid(equipGuid);
            if (item != null)
            {
@@ -62,6 +58,12 @@
                });
            }
            m_TextNumber.text = "+" + (equipLv + 1);
            DisplayMoney();
            int equipType = strengthModel.GetEquipStrengthType(equipPlace);
            var star = equipStarModel.GetEquipStarLevel(new Int2(level, equipPlace));
            var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, level);
            star = Mathf.Min(star, maxStar);
@@ -69,7 +71,6 @@
            m_StarLevel.text = Language.Get("EquipStarLevel", star);
            m_StarLevel.gameObject.SetActive(star > 0);
            int equipType = strengthModel.GetEquipStrengthType(equipPlace);
            var equipMaxLv = strengthModel.GetEquipLevelMax(equipType, star);
            m_TextMaxLv.text = Language.Get("ZBQH_02", star, equipMaxLv);
@@ -81,6 +82,7 @@
                ItemAttrData attrData = new ItemAttrData(2100, true, (ulong)1);
                itemTipsModel.SetItemTipsModel(attrData);
            });
            var equipLvNowList = strengthModel.GetEquipValueList(level, equipPlace);
            var equipAddLvList = strengthModel.GetEquipValueList(level, equipPlace, 1);
            m_AttributesText1.gameObject.SetActive(false);
@@ -100,25 +102,43 @@
                            Text addText = m_AttributesText1.transform.Find("Number").GetComponent<Text>();
                            m_AttributesText1.text = _equipLv.StrName + ":" + _equipLv.AttValue;
                            addText.gameObject.SetActive(false);
                            addText.text = "+" + (_equipAddLv.AttValue - _equipLv.AttValue);
                            break;
                        case 1:
                            m_AttributesText2.gameObject.SetActive(true);
                            Text addText1 = m_AttributesText2.transform.Find("Number").GetComponent<Text>();
                            m_AttributesText2.text = _equipLv.StrName + ":" + _equipLv.AttValue;
                            addText1.gameObject.SetActive(false);
                            addText1.text = "+" + (_equipAddLv.AttValue - _equipLv.AttValue);
                            break;
                        case 2:
                            m_AttributesText3.gameObject.SetActive(true);
                            Text addText2 = m_AttributesText3.transform.Find("Number").GetComponent<Text>();
                            m_AttributesText3.text = _equipLv.StrName + ":" + _equipLv.AttValue;
                            addText2.gameObject.SetActive(false);
                            addText2.text = "+" + (_equipAddLv.AttValue - _equipLv.AttValue);
                            break;
                    }
                }
            }
        }
        public void DisplayMoney()
        {
            var config = strengthModel.GetEquipConfig(equipLevel, equipPlace);
            if (config == null)
            {
                return;
            }
            ulong money = UIHelper.GetMoneyCnt(3);
            ulong requireMoney = (ulong)config.costCount;
            string moneyLabel = ItemLogicUtility.Instance.OnChangeCoinsUnit(UIHelper.GetMoneyCnt(3));
            moneyLabel = UIHelper.AppendColor(money >= requireMoney ? TextColType.Green : TextColType.Red, moneyLabel, true);
            string requireLabel = ItemLogicUtility.Instance.OnChangeCoinsUnit(requireMoney);
            NeedMoney.text = StringUtility.Contact(moneyLabel, "/", requireLabel);
        }
    }
}
System/EquipGem/EquipStrengthWin.cs
@@ -33,8 +33,8 @@
        [SerializeField] UIEffect m_UIEffect1B;
        [SerializeField] UIEffect m_UIEffect1C;
        EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
        EquipGemModel model { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
        EquipStrengthModel model { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
        EquipGemModel equipGemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
        EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        EquipStarModel equipStarModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
@@ -57,7 +57,7 @@
        protected override void OnPreOpen()
        {
            strengthModel.IsChangeBool = true;
            model.IsChangeBool = true;
            IsAutomaticBool = false;
            Times = 0f;
            m_StopBtn.gameObject.SetActive(false);
@@ -66,13 +66,13 @@
            OpenSelect();//默认选择                  
            DisplayEquips();
            SetStrengthenedState();
            strengthModel.SelectEquipRefresh += SelectEquipRefresh;
            strengthModel.SelectLevelRefresh += SelectLevelRefresh;
            strengthModel.EquipStrengthUpdate += EquipStrengthUpdate;
            strengthModel.EquipStrengthLvUpdate += EquipStrengthLvUpdate;
            model.SelectEquipRefresh += SelectEquipRefresh;
            model.SelectLevelRefresh += SelectLevelRefresh;
            model.EquipStrengthUpdate += EquipStrengthUpdate;
            model.EquipStrengthLvUpdate += EquipStrengthLvUpdate;
            PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
            m_Controller.JumpIndex(GetJumpIndex(strengthModel.SelectLevel, strengthModel.SelectEquipPlace));
            m_Controller.JumpIndex(GetJumpIndex(model.SelectLevel, model.SelectEquipPlace));
        }
@@ -82,10 +82,10 @@
        protected override void OnPreClose()
        {
            strengthModel.SelectEquipRefresh -= SelectEquipRefresh;
            strengthModel.SelectLevelRefresh -= SelectLevelRefresh;
            strengthModel.EquipStrengthUpdate -= EquipStrengthUpdate;
            strengthModel.EquipStrengthLvUpdate -= EquipStrengthLvUpdate;
            model.SelectEquipRefresh -= SelectEquipRefresh;
            model.SelectLevelRefresh -= SelectLevelRefresh;
            model.EquipStrengthUpdate -= EquipStrengthUpdate;
            model.EquipStrengthLvUpdate -= EquipStrengthLvUpdate;
            PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
        }
@@ -102,8 +102,8 @@
                if (Times >= WaitTime && isBool && upperLimitBool)
                {
                    Times = 0;
                    int itemIndex = EquipPlaceMapConfig.GetServerPlace(strengthModel.SelectLevel, strengthModel.SelectEquipPlace);
                    strengthModel.SendEquip(itemIndex);
                    int itemIndex = EquipPlaceMapConfig.GetServerPlace(model.SelectLevel, model.SelectEquipPlace);
                    model.SendEquip(itemIndex);
                }
                else if (!isBool || !upperLimitBool)
                {
@@ -135,13 +135,13 @@
                }
                if (equipSet.unLocked)
                {
                    var slotCount = model.GetUnlockEquipSlotCount(level);
                    var slotCount = equipGemModel.GetUnlockEquipSlotCount(level);
                    if (slotCount > 0)
                    {
                        jumpIndex++;
                        if (model.selectLevel == level)
                        if (equipGemModel.selectLevel == level)
                        {
                            var places = model.GetMosaicEquipPlaces();
                            var places = equipGemModel.GetMosaicEquipPlaces();
                            foreach (var place in places)
                            {
                                if (equipSet.IsSlotUnLocked(place))
@@ -164,8 +164,8 @@
        {
            if (StrengtheBool())
            {
                int itemIndex = EquipPlaceMapConfig.GetServerPlace(strengthModel.SelectLevel, strengthModel.SelectEquipPlace);
                strengthModel.SendEquip(itemIndex);
                int itemIndex = EquipPlaceMapConfig.GetServerPlace(model.SelectLevel, model.SelectEquipPlace);
                model.SendEquip(itemIndex);
            }
        }
@@ -202,7 +202,7 @@
                m_UIEffect1A.Play();
            }
            m_UIEffect1C.Play();
            if (strengthModel.SelectLevel != -1)
            if (model.SelectLevel != -1)
            {
                SetStrengthenedState();
                m_Controller.m_Scorller.RefreshActiveCellViews();               
@@ -221,13 +221,13 @@
                }
                if (equipSet.unLocked)
                {
                    var slotCount = model.GetUnlockEquipSlotCount(level);
                    var slotCount = equipGemModel.GetUnlockEquipSlotCount(level);
                    if (slotCount > 0)
                    {
                        m_Controller.AddCell(ScrollerDataType.Header, level);
                        if (strengthModel.SelectLevel == level)
                        if (model.SelectLevel == level)
                        {
                            var places = model.GetMosaicEquipPlaces();
                            var places = equipGemModel.GetMosaicEquipPlaces();
                            foreach (var place in places)
                            {
                                if (equipSet.IsSlotUnLocked(place))
@@ -244,7 +244,7 @@
        private void SelectEquipRefresh()
        {
            m_Controller.m_Scorller.RefreshActiveCellViews();
            strengthModel.IsChangeBool = true;
            model.IsChangeBool = true;
            SetStrengthenedState();
            if (IsAutomaticBool)
            {
@@ -256,7 +256,7 @@
        private void SelectLevelRefresh()
        {
            strengthModel.IsChangeBool = true;
            model.IsChangeBool = true;
            if (IsAutomaticBool)
            {
                Times = 0f;
@@ -286,7 +286,7 @@
        private void SetStrengthenedState()
        {
            if (strengthModel.SelectLevel == -1)
            if (model.SelectLevel == -1)
            {
                m_ContainerEmpty.gameObject.SetActive(true);
                m_ContainerStrength.gameObject.SetActive(false);
@@ -300,8 +300,8 @@
            m_EquipStrengthUpper.gameObject.SetActive(false);
            m_EquipStrengthRein.gameObject.SetActive(false);
            m_EquipEvolution.gameObject.SetActive(false);
            int equipLevel = strengthModel.SelectLevel;
            int equipPlace = strengthModel.SelectEquipPlace;
            int equipLevel = model.SelectLevel;
            int equipPlace = model.SelectEquipPlace;
            var equipSet = equipModel.GetEquipSet(equipLevel);
            string equipGuid = string.Empty;
            equipGuid = equipSet.GetEquip(equipPlace);
@@ -316,13 +316,13 @@
                int equipLv = 0;
                int advancedLv = 0;
                if (strengthModel.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级
                if (model.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级
                {
                    equipLv = strengthModel.EquipStrengthDic[equipIndex].StrengthLevel;
                    advancedLv = strengthModel.EquipStrengthDic[equipIndex].EvolveLV;
                    equipLv = model.EquipStrengthDic[equipIndex].StrengthLevel;
                    advancedLv = model.EquipStrengthDic[equipIndex].EvolveLV;
                }
                int equipType = strengthModel.GetEquipStrengthType(equipPlace);
                int equipType = model.GetEquipStrengthType(equipPlace);
                var itemPlusMaxConfig = ItemPlusMaxConfig.GetEquipTypeAndEquipStar(equipType, star);//获取强化等级上限值
                if (itemPlusMaxConfig == null)
                {
@@ -330,7 +330,7 @@
                    return;
                }
                int maxLv = strengthModel.GetEquipLevelMax(equipType, maxStar);//获取最大强化等级
                int maxLv = model.GetEquipLevelMax(equipType, maxStar);//获取最大强化等级
                m_EquipEvolution.gameObject.SetActive(true);
                m_EquipEvolution.SetEquipEvolution(equipPlace, advancedLv);
                if (equipLv >= maxLv)//满级
@@ -341,9 +341,8 @@
                }
                else if (maxLv > equipLv && equipLv >= itemPlusMaxConfig.levelMax)//强化上限
                {
                    m_BottomFrame.SetActive(false);
                    m_BottomFrame.SetActive(true);
                    m_EquipStrengthUpper.gameObject.SetActive(true);
                    m_EquipStrengthUpper.SetEquipStrengthUpper(equipGuid, equipLevel, equipPlace);
                }
                else if (itemPlusMaxConfig.levelMax > equipLv)//可强化过
@@ -362,14 +361,14 @@
        private void OpenSelect()
        {
            strengthModel.SelectLevel = -1;
            strengthModel.SelectEquipPlace = -1;
            model.SelectLevel = -1;
            model.SelectEquipPlace = -1;
            if (!strengthModel.jumpEquipPosition.Equals(Int2.zero))
            if (!model.jumpEquipPosition.Equals(Int2.zero))
            {
                strengthModel.SelectLevel = strengthModel.jumpEquipPosition.x;
                strengthModel.SelectEquipPlace = strengthModel.jumpEquipPosition.y;
                strengthModel.jumpEquipPosition = Int2.zero;
                model.SelectLevel = model.jumpEquipPosition.x;
                model.SelectEquipPlace = model.jumpEquipPosition.y;
                model.jumpEquipPosition = Int2.zero;
                return;
            }
@@ -383,21 +382,21 @@
                }
                if (equipSet.unLocked)
                {
                    var slotCount = model.GetUnlockEquipSlotCount(level);
                    var slotCount = equipGemModel.GetUnlockEquipSlotCount(level);
                    if (slotCount > 0)
                    {
                        if (strengthModel.SelectLevel == -1)
                        if (model.SelectLevel == -1)
                        {
                            strengthModel.SelectLevel = level;
                            model.SelectLevel = level;
                        }
                        if (strengthModel.SelectLevel == level)
                        if (model.SelectLevel == level)
                        {
                            var places = model.GetMosaicEquipPlaces();
                            var places = equipGemModel.GetMosaicEquipPlaces();
                            foreach (var place in places)
                            {
                                if (strengthModel.SelectEquipPlace == -1)
                                if (model.SelectEquipPlace == -1)
                                {
                                    strengthModel.SelectEquipPlace = place;
                                    model.SelectEquipPlace = place;
                                }
                            }
                        }
@@ -408,39 +407,49 @@
        private bool StrengtheBool()
        {
            bool isbool = false;
            var itemPlus = strengthModel.GetEquipConfig(strengthModel.SelectLevel, strengthModel.SelectEquipPlace);
            if (m_EquipStrengthUpper.gameObject.activeSelf)
            {
                int equipType = model.GetEquipStrengthType(model.SelectEquipPlace);
                var equipPosition = new Int2(model.SelectLevel, model.SelectEquipPlace);
                var star = equipStarModel.GetEquipStarLevel(equipPosition);
                var equipGuid = equipModel.GetEquip(equipPosition);
                var item = packModel.GetItemByGuid(equipGuid);
                var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, model.SelectEquipPlace);
                star = Mathf.Min(star, maxStar);
                var equipMaxLv = model.GetEquipLevelMax(equipType, star);
                SysNotifyMgr.Instance.ShowTip("EquipStrengthLimitError_1", star, equipMaxLv);
                return false;
            }
            var itemPlus = model.GetEquipConfig(model.SelectLevel, model.SelectEquipPlace);
            if (itemPlus == null)
            {
                return false;
            }
            ulong money = UIHelper.GetMoneyCnt(3);
            ulong needMoney = (ulong)itemPlus.costCount;
            if (money >= needMoney)
            {
                isbool = true;
            }
            else
            if (money < needMoney)
            {
                ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(2100);
                //ServerTipDetails.DisplayNormalTip(Language.Get("Z1011"));
                isbool = false;
                return false;
            }
            return isbool;
            return true;
        }
        private bool UpperLimitBool()
        {
            bool isBool = false;
            var equipPosition = new Int2(strengthModel.SelectLevel, strengthModel.SelectEquipPlace);
            var equipPosition = new Int2(model.SelectLevel, model.SelectEquipPlace);
            int equipIndex = EquipSet.ClientPlaceToServerPlace(equipPosition);
            int star = equipStarModel.GetStarLevel(equipPosition);
            int equipLv = 0;
            if (strengthModel.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级
            if (model.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级
            {
                equipLv = strengthModel.EquipStrengthDic[equipIndex].StrengthLevel;
                equipLv = model.EquipStrengthDic[equipIndex].StrengthLevel;
            }
            int equipType = strengthModel.GetEquipStrengthType(strengthModel.SelectEquipPlace);
            int equipType = model.GetEquipStrengthType(model.SelectEquipPlace);
            var itemPlusMaxConfig = ItemPlusMaxConfig.GetEquipTypeAndEquipStar(equipType, star);//获取强化等级上限值
            if (itemPlusMaxConfig.levelMax > equipLv)
            {
@@ -459,6 +468,7 @@
            if (dataType == PlayerDataType.Silver)
            {
                m_EquipStrengthRein.DisplayMoney();
                m_EquipStrengthUpper.DisplayMoney();
            }
        }
    }