lcy
2026-06-10 82e8a3f6ff7aaec06d1b60463a545a8bb031f546
588 公会攻防战 修复若干bug

1. 修复入口红点 点击打开攻防战界面后消失bug
2.打开宝库奖励预览界面默认选中胜者奖励
3.宝库格子领取后 格子编号显示置灰、道具名改为玩家名

# Conflicts:
# Main/System/GuildAtkDefBat/GuildAtkDefBatTreasureWin.cs
4个文件已修改
50 ■■■■ 已修改文件
Main/System/GuildAtkDefBat/GuildAtkDefBatManager.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/GuildAtkDefBat/GuildAtkDefBatTreasureCell.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/GuildAtkDefBat/GuildAtkDefBatTreasureGrid.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/GuildAtkDefBat/GuildAtkDefBatTreasureWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/GuildAtkDefBat/GuildAtkDefBatManager.cs
@@ -476,7 +476,7 @@
    public void ClearMainRedpoint()
    {
        hasShowedMainRedpoint = true;
        mainRedpoint.state = RedPointState.None;
        UpdateRedpoint();
    }
    private bool HasShopFreeItem()
@@ -761,8 +761,8 @@
    /// <summary>宝库奖励类型ID (对应CA504的RewardType)</summary>
    public const byte TREASURE_REWARD_TYPE = 11;
    /// <summary>缓存格子开启记录: Key=格子编号(1~n), Value=AwardID</summary>
    public Dictionary<int, int> treasureGridRecords = new Dictionary<int, int>();
    /// <summary>缓存格子开启记录: Key=格子编号(1~n), Value=开启记录</summary>
    public Dictionary<int, GuildAtkDefBatTreasureRecord> treasureGridRecords = new Dictionary<int, GuildAtkDefBatTreasureRecord>();
    /// <summary>标记宝库窗口是否打开,用于收到A525时自动刷新</summary>
    public bool isTreasureWinOpen = false;
@@ -787,17 +787,22 @@
        {
            if (mem.GridNum > 0)
            {
                treasureGridRecords[mem.GridNum] = mem.AwardID;
                treasureGridRecords[mem.GridNum] = new GuildAtkDefBatTreasureRecord
                {
                    AwardID = mem.AwardID,
                    PlayerName = UIHelper.ServerStringTrim(mem.Name),
                };
            }
        }
        if (isTreasureWinOpen)
        {
            int openGrid = pendingOpenGridIndex;
            if (openGrid > 0 && treasureGridRecords.TryGetValue(openGrid, out var awardID))
            GuildAtkDefBatTreasureRecord treasureRecord;
            if (openGrid > 0 && treasureGridRecords.TryGetValue(openGrid, out treasureRecord))
            {
                pendingOpenGridIndex = 0;
                OnTreasureGridOpenEvent?.Invoke(openGrid, awardID);
                OnTreasureGridOpenEvent?.Invoke(openGrid, treasureRecord.AwardID);
            }
            OnTreasureDataUpdateEvent?.Invoke();
        }
@@ -1010,3 +1015,9 @@
    }
    #endregion
}
public class GuildAtkDefBatTreasureRecord
{
    public int AwardID;
    public string PlayerName;
}
Main/System/GuildAtkDefBat/GuildAtkDefBatTreasureCell.cs
@@ -11,9 +11,9 @@
    /// <param name="startIndex">起始格子序号(从1开始)</param>
    /// <param name="gridCount">总格子数</param>
    /// <param name="isWin">是否胜利</param>
    /// <param name="openedGrids">已开启的格子字典 Key=格子编号, Value=AwardID</param>
    /// <param name="openedGrids">已开启的格子字典 Key=格子编号, Value=开启记录</param>
    /// <param name="openAnimGridIndex">播放开启动画的格子编号(0=无)</param>
    public void SetData(int startIndex, int gridCount, bool isWin, Dictionary<int, int> openedGrids, int openAnimGridIndex = 0)
    public void SetData(int startIndex, int gridCount, bool isWin, Dictionary<int, GuildAtkDefBatTreasureRecord> openedGrids, int openAnimGridIndex = 0)
    {
        for (int i = 0; i < grids.Length; i++)
        {
@@ -22,9 +22,16 @@
            {
                grids[i].SetActive(true);
                int awardID = 0;
                bool isOpened = openedGrids != null && openedGrids.TryGetValue(gridIndex, out awardID);
                string playerName = string.Empty;
                GuildAtkDefBatTreasureRecord treasureRecord = null;
                bool isOpened = openedGrids != null && openedGrids.TryGetValue(gridIndex, out treasureRecord);
                if (isOpened && treasureRecord != null)
                {
                    awardID = treasureRecord.AwardID;
                    playerName = treasureRecord.PlayerName;
                }
                bool playAnim = openAnimGridIndex > 0 && gridIndex == openAnimGridIndex;
                grids[i].Init(gridIndex, isWin, isOpened, (ushort)awardID, playAnim);
                grids[i].Init(gridIndex, isWin, isOpened, (ushort)awardID, playerName, playAnim);
            }
            else
            {
Main/System/GuildAtkDefBat/GuildAtkDefBatTreasureGrid.cs
@@ -28,6 +28,7 @@
    private int gridIndex;
    private bool isOpened;
    private ushort awardID;
    private string playerName;
    /// <summary>
    /// 初始化格子
@@ -36,12 +37,14 @@
    /// <param name="isWin">是否胜利</param>
    /// <param name="opened">是否已开启</param>
    /// <param name="awardId">奖励ID(已开启时有效)</param>
    /// <param name="name">开启格子的玩家名</param>
    /// <param name="playOpenAnim">是否播放开启动画(翻牌破碎特效)</param>
    public void Init(int index, bool isWin, bool opened, ushort awardId, bool playOpenAnim = false)
    public void Init(int index, bool isWin, bool opened, ushort awardId, string name, bool playOpenAnim = false)
    {
        gridIndex = index;
        isOpened = opened;
        awardID = awardId;
        playerName = name;
        // 格子序号
        topNumText.text = index.ToString();
@@ -85,6 +88,10 @@
        topNumText.SetActive(!isOpened);
        qualityImage.SetActive(isOpened);
        itemImage.SetActive(isOpened);
        itemCntText.text = string.Empty;
        itemNameText.text = isOpened ? playerName : string.Empty;
        if (isOpened && awardID > 0)
        {
            var config = FamilyAtkDefBatTreasureConfig.Get(awardID);
@@ -95,7 +102,6 @@
                {
                    itemImage.SetItemSprite(config.ItemID);
                    itemCntText.text = config.ItemCount > 1 ? $"x{config.ItemCount}" : string.Empty;
                    itemNameText.text = itemConfig.ItemName;
                }
                qualityImage.SetSprite($"GuildAtkDefBatTreasureAwardColor{config.AwardColor}");
Main/System/GuildAtkDefBat/GuildAtkDefBatTreasureWin.cs
@@ -32,7 +32,7 @@
        awardButton.AddListener(() =>
        {
            UIManager.Instance.OpenWindow<GuildAtkDefBatAwardPreviewWin>();
            UIManager.Instance.OpenWindow<GuildAtkDefBatAwardPreviewWin>(1);
        });
        lastLineButton.AddListener(() =>