lcy
2025-12-30 64166885248e4c1f64e7c87ac04c59150add960c
382 武将宿缘-客户端 适配不同品质武将混搭表格配置
6个文件已修改
64 ■■■■ 已修改文件
Main/Config/Configs/HeroFatesConfig.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroFatesQualityLVConfig.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroFates/HeroFatesCell.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroFates/HeroFatesManager.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroFates/HeroFatesPutWin.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroFates/HeroFatesUpgradeWin.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroFatesConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           2025年12月10日
//    [  Date ]:           Tuesday, December 30, 2025
//--------------------------------------------------------
using System.Collections.Generic;
@@ -19,6 +19,7 @@
    public int FatesID;
    public string FatesName;
    public int FatesQuality;
    public int BGQuality;
    public int[] HeroIDList;
    public int[][] AwardItemList;
    public int[] AttrIDList;
@@ -40,13 +41,15 @@
            int.TryParse(tables[2],out FatesQuality); 
            if (tables[3].Contains("["))
            int.TryParse(tables[3],out BGQuality);
            if (tables[4].Contains("["))
            {
                HeroIDList = JsonMapper.ToObject<int[]>(tables[3]);
                HeroIDList = JsonMapper.ToObject<int[]>(tables[4]);
            }
            else
            {
                string[] HeroIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] HeroIDListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                HeroIDList = new int[HeroIDListStringArray.Length];
                for (int i=0;i<HeroIDListStringArray.Length;i++)
                {
@@ -54,15 +57,15 @@
                }
            }
            AwardItemList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]"));
            AwardItemList = JsonMapper.ToObject<int[][]>(tables[5].Replace("(", "[").Replace(")", "]"));
            if (tables[5].Contains("["))
            if (tables[6].Contains("["))
            {
                AttrIDList = JsonMapper.ToObject<int[]>(tables[5]);
                AttrIDList = JsonMapper.ToObject<int[]>(tables[6]);
            }
            else
            {
                string[] AttrIDListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] AttrIDListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                AttrIDList = new int[AttrIDListStringArray.Length];
                for (int i=0;i<AttrIDListStringArray.Length;i++)
                {
@@ -70,13 +73,13 @@
                }
            }
            if (tables[6].Contains("["))
            if (tables[7].Contains("["))
            {
                LVAttrValueList = JsonMapper.ToObject<int[]>(tables[6]);
                LVAttrValueList = JsonMapper.ToObject<int[]>(tables[7]);
            }
            else
            {
                string[] LVAttrValueListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                string[] LVAttrValueListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                LVAttrValueList = new int[LVAttrValueListStringArray.Length];
                for (int i=0;i<LVAttrValueListStringArray.Length;i++)
                {
Main/Config/Configs/HeroFatesQualityLVConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           2025年12月10日
//    [  Date ]:           2025年12月30日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -21,6 +21,7 @@
    public int FatesLV;
    public int NeedStarTotal;
    public int NeedHeroCnt;
    public int NeedQuality;
    public override int LoadKey(string _key)
    {
@@ -41,6 +42,8 @@
            int.TryParse(tables[3],out NeedStarTotal); 
            int.TryParse(tables[4],out NeedHeroCnt); 
            int.TryParse(tables[5],out NeedQuality);
        }
        catch (Exception exception)
        {
Main/System/HeroFates/HeroFatesCell.cs
@@ -60,10 +60,10 @@
        txtUpgrade.text = Language.Get(state == HeroFatesState.MaxLevel ? "L1110" : "L1109");
        imgUpgradeRed.SetActive(state == HeroFatesState.ActiveUpgradable);
        imgBG.SetSprite(manager.GetCellBgByFatesQuality(config.FatesQuality));
        imgBG.SetSprite(manager.GetCellBgByFatesQuality(config.BGQuality));
        txtFateName.text = config.FatesName;
        txtFateName.color = UIHelper.GetUIColorByFunc(config.FatesQuality);
        outlineFateName.OutlineColor = UIHelper.GetUIOutlineColor(config.FatesQuality);
        txtFateName.color = UIHelper.GetUIColorByFunc(config.BGQuality);
        outlineFateName.OutlineColor = UIHelper.GetUIOutlineColor(config.BGQuality);
        int needHeroHasCnt = manager.GetFateNeedHeroHasCnt(fatesId);
        int needHeroCnt = config.HeroIDList.Length;
@@ -94,7 +94,6 @@
            if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.HeroFatesUpgrade, true))
                return;
            manager.chooseHeroFatesId = fatesId;
            manager.chooseHeroFatesQuality = config.FatesQuality;
            UIManager.Instance.OpenWindow<HeroFatesUpgradeWin>();
        });
    }
Main/System/HeroFates/HeroFatesManager.cs
@@ -217,7 +217,7 @@
            return false;
        }
        // 消耗武将数量是否满足需求
        List<HeroInfo> consumableHeroInfos = GetConsumableHeroInfoList(heroFatesQualityLVConfig.FatesQuality);
        List<HeroInfo> consumableHeroInfos = GetConsumableHeroInfoList(heroFatesQualityLVConfig.NeedQuality);
        int hasHeroCnt = consumableHeroInfos == null ? 0 : consumableHeroInfos.Count;
        int needHeroCnt = heroFatesQualityLVConfig.NeedHeroCnt;
        if (hasHeroCnt < needHeroCnt)
@@ -427,7 +427,7 @@
        }
        int needHeroCnt = nextLVConfig.NeedHeroCnt;
        List<HeroInfo> consumableHeroInfoList = GetConsumableHeroInfoList(fatesQuality);
        List<HeroInfo> consumableHeroInfoList = GetConsumableHeroInfoList(nextLVConfig.NeedQuality);
        if (consumableHeroInfoList.IsNullOrEmpty())
        {
            return null;
@@ -444,7 +444,6 @@
    #region 玩家选中内容
    public int chooseHeroFatesId = 0;
    public int chooseHeroFatesQuality = 0;
    public HeroInfo chooseHeroInfo = null;
    // 给玩家操作选中的列表
@@ -689,7 +688,7 @@
                }
                // 先比较品质
                int qualityCompare = config1.FatesQuality.CompareTo(config2.FatesQuality);
                int qualityCompare = config1.BGQuality.CompareTo(config2.BGQuality);
                if (qualityCompare != 0)
                {
                    return qualityCompare; // 品质不同,按品质排序
Main/System/HeroFates/HeroFatesPutWin.cs
@@ -56,9 +56,11 @@
    void CreateScoller()
    {
        scroller.Refresh();
        if (manager.TryGetHeroFatesConfig(manager.chooseHeroFatesId, out HeroFatesConfig config))
        if (manager.TryGetHeroFatesConfig(manager.chooseHeroFatesId, out HeroFatesConfig config) &&
         manager.TryGetNowLVAndNextLVConfig(config.FatesID, out int nowLv, out HeroFatesQualityLVConfig nowLVConfig, out HeroFatesQualityLVConfig nextLVConfig))
        {
            int fatesQuality = config.FatesQuality;
            int fatesQuality = nextLVConfig.NeedQuality;
            list = manager.GetConsumableHeroInfoList(fatesQuality);
            transNoCanChooseHero.SetActive(list.IsNullOrEmpty());
            if (!list.IsNullOrEmpty())
Main/System/HeroFates/HeroFatesUpgradeWin.cs
@@ -41,8 +41,8 @@
            var list = manager.GetPutPreviewHeroList(manager.chooseHeroFatesId);
            if (list.IsNullOrEmpty())
            {
                //符合升级条件的武将不足
                SysNotifyMgr.Instance.ShowTip("HeroFates02");
                //消耗武将数量不足
                SysNotifyMgr.Instance.ShowTip("HeroFates04");
                return;
            }
            UIManager.Instance.OpenWindow<HeroFatesFastPutPreviewWin>();
@@ -64,7 +64,7 @@
            }
            ushort[] arr = manager.GetItemIndexList(manager.realCostHeroInfos);
            //放入的消耗武将数量不足
            //消耗武将数量不足
            if (arr.IsNullOrEmpty() || nextLVConfig.NeedHeroCnt > manager.realCostHeroInfos.Count)
            {
                SysNotifyMgr.Instance.ShowTip("HeroFates04");
@@ -239,10 +239,10 @@
        btnQualityHeroClear.SetActive(isChoose);
        imgQualityHeroNull.SetActive(!isChoose);
        imgQualityHeroBg.SetItemBackGround(config.FatesQuality);
        imgQualityHeroIcon.SetSprite(StringUtility.Concat("HeroFatesQualityHead", config.FatesQuality.ToString()));
        txtQualityHeroName.text = StringUtility.Concat(RichTextMsgReplaceConfig.GetRichReplace("HeroQuality", config.FatesQuality), Language.Get("herocard3"));
        txtQualityHeroName.color = UIHelper.GetUIColorByFunc(config.FatesQuality);
        imgQualityHeroBg.SetItemBackGround(config.BGQuality);
        imgQualityHeroIcon.SetSprite(StringUtility.Concat("HeroFatesQualityHead", config.BGQuality.ToString()));
        txtQualityHeroName.text = StringUtility.Concat(RichTextMsgReplaceConfig.GetRichReplace("HeroQuality", config.BGQuality), Language.Get("herocard3"));
        txtQualityHeroName.color = UIHelper.GetUIColorByFunc(config.BGQuality);
        int needCnt = nextLVConfig.NeedHeroCnt;
        txtNeedQualityHeroCnt.text = UIHelper.AppendColor(chooseCnt >= needCnt ? TextColType.DarkGreen : TextColType.Red, Language.Get("BoneField09", chooseCnt, needCnt));