少年修仙传客户端代码仓库
0312 修复强化材料不足也有红点的bug
优化强化部位没装备的排序问题
优化强化切换不同境界装备默认选中和定位问题
2个文件已修改
83 ■■■■■ 已修改文件
System/EquipGem/EquipStrengthModel.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthWin.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthModel.cs
@@ -588,6 +588,7 @@
            return count;
        }
        public int GetEquipStrengthState(Int2 position)
        {
            var equipGuid = equipModel.GetEquip(position);
@@ -667,10 +668,22 @@
                return false;
            }
            bool result = true;
            ulong money = UIHelper.GetMoneyCnt(3);
            ulong requireMoney = (ulong)config.costCount;
            if (money < requireMoney)
                result = false;
            return requireMoney < money;
            if (config.costItemInfo.Length == 2)
            {
                var itemCount = packModel.GetItemCountByID(PackType.Item, config.costItemInfo[0]);
                if (itemCount < config.costItemInfo[1])
                {
                    result = false;
                }
            }
            return result;
        }
        public bool TryGetRedpoint(int level, out Redpoint _redpoint)
System/EquipGem/EquipStrengthWin.cs
@@ -211,7 +211,7 @@
                {
                    if (selectPlace == place)
                    {
                        return jumpIndex;
                        return Math.Max(jumpIndex - 2, 0);
                    }
                    jumpIndex++;
                }
@@ -386,12 +386,23 @@
        private int EquipCompare(int x, int y)
        {
            //var x_state = model.GetEquipStrengthState(new Int2(model.SelectLevel, x));
            //var y_state = model.GetEquipStrengthState(new Int2(model.SelectLevel, y));
            //if (x_state != y_state)
            //{
            //    return x_state.CompareTo(y_state);
            //}
            var x_state = 0;
            var y_state = 0;
            var equipGuidx = equipModel.GetEquip(new Int2(model.SelectLevel, x));
            if (string.IsNullOrEmpty(equipGuidx))
            {
                x_state = 1;
            }
            var equipGuidy = equipModel.GetEquip(new Int2(model.SelectLevel, y));
            if (string.IsNullOrEmpty(equipGuidy))
            {
                y_state = 1;
            }
            if (x_state != y_state)
            {
                return x_state.CompareTo(y_state);
            }
            return x.CompareTo(y);
        }
@@ -421,7 +432,8 @@
            DisplayEquips();
            if (model.SelectLevel != -1)
            {
                model.SelectEquipPlace = m_Sorts[0];
                SetDefaultSelectEquip();
                m_Controller.JumpIndex(GetJumpIndex(model.SelectLevel, model.SelectEquipPlace));
            }
            SetStrengthenedState();
        }
@@ -598,6 +610,46 @@
            return minStrengthLevel != int.MaxValue;
        }
        //界面打开的情况下
        private void SetDefaultSelectEquip()
        {
            var places = model.equipPlaces;
            foreach (var place in places)
            {
                EquipStrengthModel.EquipStrengthRedpoint redpoint;
                if (model.TryGetRedpoint(model.SelectLevel, place, out redpoint)
                    && redpoint.redpoint.state == RedPointState.Simple)
                {
                    model.SelectEquipPlace = place;
                    return;
                }
            }
            var minStrengthLevel = int.MaxValue;
            var minSelect = 0;
            var equipSet = equipModel.GetEquipSet(model.SelectLevel);
            if (equipSet == null)
            {
                return;
            }
            places.Sort(EquipCompare);
            foreach (var place in places)
            {
                var state = model.GetEquipStrengthState(new Int2(model.SelectLevel, place));
                if (state == 3)
                {
                    continue;
                }
                var strengthLevel = model.GetStrengthLevel(model.SelectLevel, place);
                if (strengthLevel < minStrengthLevel && state == 0)
                {
                    minStrengthLevel = strengthLevel;
                    minSelect = place;
                }
            }
            model.SelectEquipPlace = minSelect;
        }
        private bool IsForMasterUp()
        {