少年修仙传客户端代码仓库
0312 修复法宝界面左右切换,排序按法宝表顺序;修复前端本(个人BOSS)跑主线任务会导致报错问题
3个文件已修改
44 ■■■■ 已修改文件
System/MainInterfacePanel/TaskModel.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureBaseWin.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureModel.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/TaskModel.cs
@@ -1683,6 +1683,8 @@
    }
    private bool IsDungeon()//判断是否在副本中
    {
        if (ClientDungeonStageUtility.isClientDungeon)
            return true;
        var mapId = PlayerDatas.Instance.baseData.MapID;
        var mapConfig = MapConfig.Get(mapId);
        return mapConfig != null && mapConfig.MapFBType != 0;
System/Treasure/TreasureBaseWin.cs
@@ -173,17 +173,17 @@
                case TreasureCategory.King:
                    {
                        var list = kingTreasureModel.GetDisplayList();
                        var leftRifht = list.Contains(model.selectedTreasure + 1);
                        var leftRifht = list.Contains(model.GetNextTreasureID(model.selectedTreasure, model.currentCategory));
                        m_Right.gameObject.SetActive(leftRifht);
                        leftRifht = list.Contains(model.selectedTreasure - 1);
                        leftRifht = list.Contains(model.GetPreTreasureID(model.selectedTreasure, model.currentCategory));
                        m_Left.gameObject.SetActive(leftRifht);
                    }
                    break;
                default:
                    {
                        var leftRifht = TreasureConfig.Get(model.selectedTreasure + 1);
                        var leftRifht = TreasureConfig.Get(model.GetNextTreasureID(model.selectedTreasure, model.currentCategory));
                        m_Right.gameObject.SetActive(leftRifht != null);
                        leftRifht = TreasureConfig.Get(model.selectedTreasure - 1);
                        leftRifht = TreasureConfig.Get(model.GetPreTreasureID(model.selectedTreasure, model.currentCategory));
                        m_Left.gameObject.SetActive(leftRifht != null);
                    }
                    break;
@@ -219,7 +219,7 @@
        private void Left()
        {
            var selectTreasure = model.selectedTreasure - 1;
            var selectTreasure = model.GetPreTreasureID(model.selectedTreasure, model.currentCategory);
            if (!AllowSelectTreasure(selectTreasure))
            {
                return;
@@ -233,7 +233,7 @@
        private void Right()
        {
            var selectTreasure = model.selectedTreasure + 1;
            var selectTreasure = model.GetNextTreasureID(model.selectedTreasure, model.currentCategory);
            if (!AllowSelectTreasure(selectTreasure))
            {
                return;
System/Treasure/TreasureModel.cs
@@ -501,6 +501,36 @@
            }
        }
        // 获取下一个法宝ID,不能直接法宝ID + 1,要从表读取
        public int GetNextTreasureID(int curID, TreasureCategory _category)
        {
            var list = GetTreasureCategory(_category);
            if (list != null)
            {
                int index = list.IndexOf(curID);
                if (index >= 0 && index < list.Count-1)
                {
                    return list[index + 1];
                }
            }
            return 0;
         }
        public int GetPreTreasureID(int curID, TreasureCategory _category)
        {
            var list = GetTreasureCategory(_category);
            if (list != null)
            {
                int index = list.IndexOf(curID);
                if (index > 0 && index <= list.Count)
                {
                    return list[index - 1];
                }
            }
            return 0;
        }
        public int GetCollectedTreasureCount(TreasureCategory _category)
        {
            var treasureIds = GetTreasureCategory(_category);