hch
2026-01-15 c525b06de1415116f7d95dadfbb4c26d71402d13
0312 支持坊市跳转指定商品,前提是商品存在
3个文件已修改
26 ■■■■■ 已修改文件
Main/System/Store/StoreModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/StoreWin.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/UIBase/UIJumpManager.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Store/StoreModel.cs
@@ -29,7 +29,7 @@
    public event Action RefreshShopEvent;
    public StoreFunc selectStoreFuncType = StoreFunc.Normal;
    public int jumpShopID;
    public int buyShopID;
Main/System/Store/StoreWin.cs
@@ -85,6 +85,7 @@
        }
        scroller.Refresh();
        int jumpIndex = -1;
        var list = StoreModel.Instance.storeTypeDict[(int)StoreModel.Instance.selectStoreFuncType];
        for (int i = 0; i < list.Count; i++)
        {
@@ -92,9 +93,18 @@
            {
                scroller.AddCell(ScrollerDataType.Header, i);
            }
            if (jumpIndex == -1 && list[i].shopId == StoreModel.Instance.jumpShopID)
            {
                jumpIndex = i / 3;
            }
        }
        scroller.Restart();
        scroller.lockType = EnhanceLockType.KeepVertical;
        if (StoreModel.Instance.jumpShopID != 0)
        {
            scroller.JumpIndex(jumpIndex);
            StoreModel.Instance.jumpShopID = 0;
        }
    }
Main/System/UIBase/UIJumpManager.cs
@@ -38,6 +38,20 @@
        }
        var config = WindowSearchConfig.Get(winID);
        if (config.WinName == "StoreBaseWin")
        {
            //指定商品
            StoreModel.Instance.jumpShopID = int.Parse(config.Extra);
            if (StoreModel.Instance.jumpShopID == 0)
            {
                StoreModel.Instance.selectStoreFuncType = StoreFunc.Normal;
            }
            else
            {
                StoreModel.Instance.selectStoreFuncType = (StoreFunc)StoreConfig.Get(StoreModel.Instance.jumpShopID).ShopType;
            }
        }
        if (!UIManager.Instance.IsOpened(config.WinName))
        {
            UIManager.Instance.OpenWindow(config.WinName, config.TabIndex);