lcy
昨天 16dba0ff4d2eed7f5a4a7c37640f158ee9f73d8c
669 子 【武将】武将系统 / 时装新增开服天数显示入口字段
14个文件已修改
223 ■■■■■ 已修改文件
Main/Config/ConfigManager.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/HeroSkinConfig.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroBestBaseWin.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroCollectionWin.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroSkinWin.cs 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainBaseWin.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.Collect.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroUIManager.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/PhantasmPavilion/PhantasmPavilionManager.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/SkinStoreCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/SkinStoreLineCell.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/SkinStoreWin.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/StoreModel.cs 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/UIBase/UIJumpManager.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/ConfigManager.cs
@@ -43,6 +43,7 @@
        // 加载配置文件
        // 加载配置文件
        // 加载配置文件
        HashSet<Type> configTypes = new HashSet<Type>() {
            typeof(ActBillboardAwardConfig),
            typeof(ActHeroAppearArtConfig),
Main/Config/Configs/HeroSkinConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           Tuesday, May 19, 2026
//    [  Date ]:           2026年6月5日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -31,6 +31,7 @@
    public string ApearMotionName;
    public string TransfMotionName;
    public string LoopMotionName;
    public int OpenDay;
    public override int LoadKey(string _key)
    {
@@ -95,6 +96,8 @@
            TransfMotionName = tables[13];
            LoopMotionName = tables[14];
            int.TryParse(tables[15],out OpenDay);
        }
        catch (Exception exception)
        {
Main/System/HeroUI/HeroBestBaseWin.cs
@@ -45,7 +45,8 @@
            return;
        }
        var config = HeroConfig.Get(HeroUIManager.Instance.selectForPreviewHeroID);
        tabButtons[1].SetActive(config.SkinIDList.Length > 1);
        // 仅默认皮肤可显示(所有非默认皮肤均未到开服天数)时隐藏时装入口
        tabButtons[1].SetActive(HeroUIManager.HasHeroAnyAvailableSkin(config.HeroID));
    }
    //其他界面和此界面的层级显示问题
Main/System/HeroUI/HeroCollectionWin.cs
@@ -60,6 +60,8 @@
    private void OnDayEvent()
    {
        // 过天时 OpenDay 可能变化,先刷新图鉴红点状态,再重绘列表
        HeroUIManager.Instance.UpdateHeroBookRedpoint();
        HeroUIManager.Instance.SortHeroCollectList();
        CreateScroller();
    }
Main/System/HeroUI/HeroSkinWin.cs
@@ -156,7 +156,19 @@
        {
            tmpIndex = HeroUIManager.Instance.selectSkinIndex;
        }
        // 检查选中的非默认皮肤是否满足 OpenDay 展示条件
        if (tmpIndex > 0)
        {
            int selectedSkinID = heroConfig.SkinIDList[tmpIndex];
            if (!HeroUIManager.IsSkinOpenDayMet(selectedSkinID))
            {
                // 当前选中皮肤未到开服展示时间,回退到默认皮肤
                tmpIndex = 0;
                HeroUIManager.Instance.selectSkinIndex = 0;
            }
        }
        skinID = heroConfig.SkinIDList[tmpIndex];
        bgTexture.SetTexture2D(HeroUIManager.Instance.GetBGName(skinID, heroConfig.Country));
        roleLhModel.Create(skinID, 1, motionName: "", isLh: true);
@@ -237,14 +249,31 @@
    void CreateScroller()
    {
        skinScroller.Refresh();
        int visibleCount = 0;
        for (int i = 0; i < heroConfig.SkinIDList.Length; i++)
        {
            skinScroller.AddCell(ScrollerDataType.Header, i);
            // 默认皮肤(索引0)始终显示,非默认皮肤需满足 OpenDay 展示条件
            if (i == 0 || HeroUIManager.IsSkinOpenDayMet(heroConfig.SkinIDList[i]))
            {
                skinScroller.AddCell(ScrollerDataType.Header, i);
                visibleCount++;
            }
        }
        skinScroller.Restart();
        if (tmpIndex > 2)
        // 计算当前选中皮肤在过滤后的列表中的视觉位置
        int visualIndex = 0;
        for (int i = 0; i < heroConfig.SkinIDList.Length; i++)
        {
            skinScroller.JumpIndex(tmpIndex - 1);
            if (i == tmpIndex)
                break;
            if (i == 0 || HeroUIManager.IsSkinOpenDayMet(heroConfig.SkinIDList[i]))
                visualIndex++;
        }
        if (visualIndex > 2)
        {
            skinScroller.JumpIndex(visualIndex - 1);
        }
    }
Main/System/HeroUI/HeroTrainBaseWin.cs
@@ -63,7 +63,8 @@
            return;
        }
        var config = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuid).heroConfig;
        tabButtons[2].SetActive(config.SkinIDList.Length > 1);
        // 仅默认皮肤可显示(所有非默认皮肤均未到开服天数)时隐藏时装入口
        tabButtons[2].SetActive(HeroUIManager.HasHeroAnyAvailableSkin(config.HeroID));
    }
Main/System/HeroUI/HeroUIManager.Collect.cs
@@ -465,6 +465,44 @@
    #endregion
    #region 皮肤开服天数相关方法
    /// <summary>
    /// 检查皮肤是否满足开服天数展示条件
    /// </summary>
    /// <param name="skinID">皮肤ID</param>
    /// <returns>true: 可展示; false: 尚未满足开服天数</returns>
    public static bool IsSkinOpenDayMet(int skinID)
    {
        var skinConfig = HeroSkinConfig.Get(skinID);
        if (skinConfig == null || skinConfig.OpenDay <= 0)
            return true;  // OpenDay <= 0 表示无限制
        return TimeUtility.OpenDay + 1 >= skinConfig.OpenDay;
    }
    /// <summary>
    /// 判断武将在考虑 OpenDay 限制后,是否有至少一个可显示的非默认皮肤
    /// 默认皮肤(SkinIDList[0])不受 OpenDay 控制,始终可用
    /// </summary>
    /// <param name="heroID">武将ID</param>
    /// <returns>true: 有至少一个非默认皮肤可显示; false: 仅默认皮肤可显示</returns>
    public static bool HasHeroAnyAvailableSkin(int heroID)
    {
        var heroConfig = HeroConfig.Get(heroID);
        if (heroConfig == null || heroConfig.SkinIDList.Length <= 1)
            return false;  // 只有默认皮肤或没有皮肤
        // 从索引 1 开始检查非默认皮肤
        for (int i = 1; i < heroConfig.SkinIDList.Length; i++)
        {
            if (IsSkinOpenDayMet(heroConfig.SkinIDList[i]))
                return true;
        }
        return false;
    }
    #endregion
    #endregion
}
Main/System/HeroUI/HeroUIManager.cs
@@ -43,6 +43,7 @@
        PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
        TeamManager.Instance.OnTeamChange += OnTeamChangeEvent;
        QuickSetting.Instance.onQuickSettingUpdate += OnQuickSettingUpdate;
        TimeMgr.Instance.OnDayEvent += OnDayEvent;
        ParseConfig();
        InitHeroOnTeamRedpointList();
        InitHerosData();
@@ -58,6 +59,7 @@
        PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
        TeamManager.Instance.OnTeamChange -= OnTeamChangeEvent;
        QuickSetting.Instance.onQuickSettingUpdate -= OnQuickSettingUpdate;
        TimeMgr.Instance.OnDayEvent -= OnDayEvent;
    }
    void ParseConfig()
@@ -744,7 +746,7 @@
        return false;
    }
    void UpdateHeroBookRedpoint()
    public void UpdateHeroBookRedpoint()
    {
        if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Hero))
            return;
@@ -777,6 +779,14 @@
            UpdateHeroCardRedpoint();
            refreshRedPoint = false;
        }
    }
    void OnDayEvent()
    {
        // 过天时 OpenDay 可能变化,需要刷新红点
        UpdateHeroCardRedpoint();
        UpdateHeroCardSkinRedpoint();
        UpdateHeroBookRedpoint();
    }
    void RefreshItemEvent(PackType packType, int index, int itemID)
@@ -864,6 +874,10 @@
        var config = HeroConfig.Get(heroID);
        for (int i = 0; i < config.SkinIDList.Length; i++)
        {
            // 默认皮肤(索引0)始终参与红点计算;非默认皮肤需满足 OpenDay 才参与
            if (i > 0 && !IsSkinOpenDayMet(config.SkinIDList[i]))
                continue;
            var state = HeroSkinStateForRedpoint(config.SkinIDList[i], isBook);
            if (isBook && state == 2)
            {
Main/System/PhantasmPavilion/PhantasmPavilionManager.cs
@@ -695,7 +695,9 @@
        {
            // 皮肤途径,UnlockValue 是 SkinID
            int skinId = unlockValue;
            return IsHeroCollectionOpen(HeroConfig.GetHeroIDBySkinID(skinId));
            // 武将需满足开服天数,且皮肤本身也需满足开服天数展示条件
            return IsHeroCollectionOpen(HeroConfig.GetHeroIDBySkinID(skinId))
                && HeroUIManager.IsSkinOpenDayMet(skinId);
        }
        // 其他获取途径(如活动、默认等),不做限制,直接显示
Main/System/Store/SkinStoreCell.cs
@@ -19,7 +19,7 @@
    public void Display(int index)
    {
        var list = StoreModel.Instance.GetTimeValidStoreDatas(StoreFunc.HeroSkin);
        var list = StoreModel.Instance.GetTimeValidHeroSkinStoreDatas();
        var storeData = list[index];
        int shopID = storeData.shopId;
        var itemID = storeData.storeConfig.ItemID;
Main/System/Store/SkinStoreLineCell.cs
@@ -10,7 +10,16 @@
    public void Display(int index)
    {
        var list = StoreModel.Instance.GetTimeValidStoreDatas(StoreFunc.HeroSkin);
        var list = StoreModel.Instance.GetTimeValidHeroSkinStoreDatas();
        if (list == null)
        {
            for (int i = 0; i < storeCells.Length; i++)
            {
                storeCells[i].SetActive(false);
            }
            return;
        }
        for (int i = 0; i < storeCells.Length; i++)
        {
Main/System/Store/SkinStoreWin.cs
@@ -62,7 +62,12 @@
        int jumpIndex = -1;
        scroller.Refresh();
        var list = StoreModel.Instance.GetTimeValidStoreDatas(StoreFunc.HeroSkin);
        var list = StoreModel.Instance.GetTimeValidHeroSkinStoreDatas();
        if (list == null)
        {
            return;
        }
        for (int i = 0; i < list.Count; i++)
        {
            if (i % 4 == 0)
@@ -78,7 +83,10 @@
        scroller.lockType = EnhanceLockType.KeepVertical;
        if (StoreModel.Instance.jumpShopID != 0)
        {
            scroller.JumpIndex(jumpIndex);
            if (jumpIndex >= 0)
            {
                scroller.JumpIndex(jumpIndex);
            }
            StoreModel.Instance.jumpShopID = 0;
        }
    }
Main/System/Store/StoreModel.cs
@@ -212,10 +212,85 @@
        return validDatas;
    }
    public List<StoreData> GetTimeValidHeroSkinStoreDatas()
    {
        var validDatas = GetTimeValidStoreDatas(StoreFunc.HeroSkin);
        if (validDatas == null)
            return null;
        List<StoreData> heroSkinValidDatas = new List<StoreData>();
        for (int i = 0; i < validDatas.Count; i++)
        {
            var storeData = validDatas[i];
            if (IsHeroSkinShopOpenByStoreConfig(storeData.storeConfig))
            {
                heroSkinValidDatas.Add(storeData);
            }
        }
        return heroSkinValidDatas;
    }
    public bool IsHeroSkinShopOpenByShopID(int shopID)
    {
        return IsHeroSkinShopOpenByStoreConfig(StoreConfig.Get(shopID));
    }
    public bool IsHeroSkinShopOpenByStoreConfig(StoreConfig storeConfig)
    {
        if (!TryGetHeroSkinShopSkinID(storeConfig, out var skinID))
        {
            return true;
        }
        return IsHeroSkinShopOpenBySkinID(skinID);
    }
    public bool IsHeroSkinShopOpenBySkinID(int skinID)
    {
        var skinConfig = HeroSkinConfig.Get(skinID);
        if (skinConfig == null || skinConfig.OpenDay <= 0)
        {
            return true;
        }
        return TimeUtility.OpenDay + 1 >= skinConfig.OpenDay;
    }
    public bool TryGetHeroSkinShopSkinID(StoreConfig storeConfig, out int skinID)
    {
        skinID = 0;
        if (storeConfig == null)
        {
            return false;
        }
        if (HeroSkinAttrConfig.TryGetSkinIDByItemID(storeConfig.ItemID, out skinID))
        {
            return true;
        }
        if (storeConfig.ItemListEx == null)
        {
            return false;
        }
        for (int i = 0; i < storeConfig.ItemListEx.Length; i++)
        {
            var item = storeConfig.ItemListEx[i];
            if (item != null && item.Length > 0 && HeroSkinAttrConfig.TryGetSkinIDByItemID(item[0], out skinID))
            {
                return true;
            }
        }
        return false;
    }
    public bool TryGetTimeValidSkinShopIDByItemID(int itemID, out int shopID)
    {
        shopID = 0;
        var validDatas = GetTimeValidStoreDatas(StoreFunc.HeroSkin);
        var validDatas = GetTimeValidHeroSkinStoreDatas();
        if (validDatas == null)
        {
            return false;
Main/System/UIBase/UIJumpManager.cs
@@ -57,7 +57,15 @@
                }
                else
                {
                    StoreModel.Instance.selectStoreFuncType = (StoreFunc)StoreConfig.Get(StoreModel.Instance.jumpShopID).ShopType;
                    var storeConfig = StoreConfig.Get(StoreModel.Instance.jumpShopID);
                    if (storeConfig.ShopType == (int)StoreFunc.HeroSkin &&
                        !StoreModel.Instance.IsHeroSkinShopOpenByStoreConfig(storeConfig))
                    {
                        SysNotifyMgr.Instance.ShowTip("JumpSkinErr");
                        StoreModel.Instance.jumpShopID = 0;
                        return;
                    }
                    StoreModel.Instance.selectStoreFuncType = (StoreFunc)storeConfig.ShopType;
                }
            }
        }
@@ -162,4 +170,4 @@
            ui?.ClickFuncBtn(config.TabIndex);
        }
    }
}
}