Main/System/HeroUI/HeroUIManager.cs
@@ -12,8 +12,7 @@
{
    #region 武将列表界面
    public List<string> heroSortList { get; private set; } = new List<string>();  //上阵为主线的 GUID列表 
    public int selectHeroListJob = 0;    //武将列表界面 筛选职业
    public int selectHeroListCountry = 0;    //武将列表界面筛选国家
    public List<int> selectHeroList = new List<int>();   //武将列表界面 筛选职业
    public string selectHeroGuid; //选中的武将id
    public int[] heroRedpointItemList;  //有影响红点的道具
    #endregion
@@ -31,6 +30,7 @@
    public int firstHeroIDBookUpdate = 0;    //图鉴中第一个可以升级或者升星的武将,引导用
    public List<int> heroSpecialAttrsForSelect = new List<int>();  //筛选用的特殊属性汇总
    public override void Init()
    {
@@ -43,7 +43,7 @@
        QuickSetting.Instance.onQuickSettingUpdate += OnQuickSettingUpdate;
        ParseConfig();
        InitHeroOnTeamRedpointList();
        InitHeroBookRedpointList();
        InitHerosData();
    }
    public override void Release()
@@ -208,6 +208,20 @@
        return hero.heroLevel == GetMaxLVByBreakLV(hero.Quality, hero.breakLevel);
    }
    public int GetAllHeroPer()
    {
        var list = HeroManager.Instance.GetHeroList();
        int per = 0;
        foreach (var hero in list)
        {
            if (hero.isAttrActive)
            {
                per += hero.GetAddPer();
            }
        }
        return per;
    }
    #endregion
@@ -240,7 +254,7 @@
    //刷新时机, 打开武将界面 或者 关闭功能界面
    public void SortHeroList()
    {
        heroSortList = HeroManager.Instance.GetHeroGuidList(selectHeroListJob, selectHeroListCountry);
        heroSortList = HeroManager.Instance.GetHeroGuidList(selectHeroList);
        heroSortList.Sort(CmpHero);
    }
@@ -252,6 +266,13 @@
        if (heroA == null || heroB == null)
        {
            return 0;
        }
        bool isActiveA = heroA.isAttrActive;
        bool isActiveB = heroB.isAttrActive;
        if (isActiveA != isActiveB)
        {
            return isActiveA ? -1 : 1;
        }
        // 排序规则:上阵>武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID
@@ -286,7 +307,6 @@
    }
    #region 招募
    public HappXBTitle selectCallType;  //寻宝枚举类型
@@ -295,8 +315,7 @@
    //积分招募预览
    public List<int> heroCallSortList { get; private set; } = new List<int>();  //积分招募列表 
    public int selectHeroCallListJob = 0;    //筛选职业
    public int selectHeroCallListCountry = 0;    //筛选国家
    public List<int> selectHeroCallList = new List<int>();    //筛选
    public List<int> newHeroIDList = new List<int>();  //新武将列表
    public bool IsNewHero(int heroID)
@@ -356,12 +375,28 @@
            allHeroCallScoreList = HappyXBModel.Instance.GetAllGridLibItemIDByType((int)HappXBTitle.HeroCallScore);
        }
        heroCallSortList = new List<int>();
        if (selectHeroCallListJob == 0 && selectHeroCallListCountry == 0)
        if (selectHeroCallList.IsNullOrEmpty())
        {
            heroCallSortList = allHeroCallScoreList;
        }
        else
        {
            int job = 0;
            int country = 0;
            int hurtType = 0;
            int fightAttrType = 0;
            int specialAttrType = 0;
            if (!selectHeroCallList.IsNullOrEmpty())
            {
                job = selectHeroCallList[0];
                country = selectHeroCallList[1];
                hurtType = selectHeroCallList[2];
                fightAttrType = selectHeroCallList[3];
                specialAttrType = selectHeroCallList[4];
            }
            foreach (var item in allHeroCallScoreList)
            {
                HeroConfig heroConfig = HeroConfig.Get(item);
@@ -369,14 +404,41 @@
                {
                    continue;
                }
                if (selectHeroCallListJob != 0 && selectHeroCallListJob != heroConfig.Class)
                //0代表全部, 同级别是可复选,不同级别为且的关系
                bool isMatch = true;
                if (job != 0)
                {
                    isMatch = isMatch && (job & (1 << heroConfig.Class)) > 0;
                }
                if (country != 0)
                {
                    isMatch = isMatch && (country & (1 << heroConfig.Country)) > 0;
                }
                if (hurtType != 0)
                {
                    isMatch = isMatch && (hurtType & (1 << heroConfig.HurtType)) > 0;
                }
                if (fightAttrType != 0)
                {
                    isMatch = isMatch && (fightAttrType & (1 << heroConfig.Specialty)) > 0;
                }
                if (specialAttrType != 0)
                {
                    bool isMatch2 = false;
                    for (int i = 0; i < heroConfig.Specialty2.Length; i++)
                    {
                        isMatch2 = (specialAttrType & (1 << heroConfig.Specialty2[i])) > 0;
                        if (isMatch2)
                            break;
                    }
                    isMatch = isMatch && isMatch2;
                }
                if (!isMatch)
                {
                    continue;
                }
                if (selectHeroCallListCountry != 0 && selectHeroCallListCountry != heroConfig.Country)
                {
                    continue;
                }
                heroCallSortList.Add(item);
            }
        }
@@ -507,16 +569,33 @@
    }
    void InitHeroBookRedpointList()
    void InitHerosData()
    {
        heroBookRedpointList.Clear();
        foreach (var key in HeroConfig.GetKeys())
        {
            var config = HeroConfig.Get(key);
            //汇总特殊属性
            if (!config.Specialty2.IsNullOrEmpty())
            {
                foreach (var num in config.Specialty2)
                {
                    if (!heroSpecialAttrsForSelect.Contains(num))
                    {
                        heroSpecialAttrsForSelect.Add(num);
                    }
                }
            }
            if (config.PlayerCanUse == 0)
                continue;
            //图鉴红点
            heroBookRedpointList.Add(new Redpoint(MainRedDot.HeroCardCollectRedpoint, MainRedDot.HeroCardCollectRedpoint * 10000000 + key));
        }
        heroSpecialAttrsForSelect.Sort();
    }