少年修仙传客户端代码仓库
Client_PangDeRong
2018-08-15 495c336b3fe1c13d1e7310e32b0744ef46d010d0
【2571】修改寻宝商店红点和增加符印商店显示逻辑
2个文件已修改
92 ■■■■ 已修改文件
Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HappyXB/HappyXBModel.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs
@@ -72,6 +72,7 @@
                    if (PlayerDatas.Instance.baseData.LV >= s_storeModelDict[type][i].LV)
                    {
                        StoreConfig storeConfig = s_storeModelDict[type][i];
                        //等于1隐藏
                        if (storeConfig.TheOnlyShop == 1)
                        {
                            bool isSellOut = false;
@@ -80,8 +81,8 @@
                                List<StoreConfig> storelist = s_TheOnlyShopDict[storeConfig.ItemID];
                                for (int j = 0; j < storelist.Count; j++)
                                {
                                    BuyShopItemLimit shopItemLimit = ModelCenter.Instance.GetModel<StoreModel>().GetBuyShopLimit((uint)storelist[j].ID);
                                    if (shopItemLimit != null && shopItemLimit.BuyCnt >= storelist[j].PurchaseNumber[0])
                                    int remainCnt = 0;
                                    if (CheckShopIsSellOut(storelist[j], out remainCnt))
                                    {
                                        isSellOut = true;
                                        break;
@@ -95,32 +96,39 @@
                        }
                        else
                        {
                            if (storeConfig.RefreshType != 0)
                            if (storeConfig.IsHideSellOut != 1)
                            {
                                switch (storeConfig.ShopType)
                                {
                                    case 12:
                                        if (CheckRuneStoreIsCanBuy(storeConfig))
                            {
                                modellist.Add(storeConfig);
                            }
                            else
                            {
                                int canBuyCnt = 0;
                                int addBuyCnt = 0;
                                bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
                                BuyShopItemLimit shopItemLimit = ModelCenter.Instance.GetModel<StoreModel>().GetBuyShopLimit((uint)storeConfig.ID);
                                if (isLimitBuy && !_keepOld)
                                {
                                    int remainNum = canBuyCnt;
                                    if (shopItemLimit != null)
                                    {
                                        remainNum = canBuyCnt - shopItemLimit.BuyCnt;
                                        break;
                                    default:
                                        modellist.Add(storeConfig);
                                        break;
                                    }
                                    if (remainNum > 0)
                                    {
                                        modellist.Add(storeConfig);
                                    }
                                }
                                else
                                {
                                int remainCnt = 0;
                                switch (storeConfig.ShopType)
                                {
                                    case 12:
                                        if (CheckRuneStoreIsCanBuy(storeConfig) && !CheckShopIsSellOut(storeConfig, out remainCnt))
                                        {
                                    modellist.Add(storeConfig);
                                        }
                                        break;
                                    default:
                                        if (!CheckShopIsSellOut(storeConfig, out remainCnt))
                                        {
                                            modellist.Add(storeConfig);
                                        }
                                        break;
                                }
                            }
                        }
@@ -135,6 +143,42 @@
            return sortlist;
        }
        public static bool CheckShopIsSellOut(StoreConfig storeConfig,out int remainCnt)
        {
            int canBuyCnt = 0;
            int addBuyCnt = 0;
            remainCnt = 0;
            bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
            BuyShopItemLimit shopItemLimit = ModelCenter.Instance.GetModel<StoreModel>().GetBuyShopLimit((uint)storeConfig.ID);
            if (!isLimitBuy) return false;
            if(shopItemLimit != null)
            {
                remainCnt = canBuyCnt - shopItemLimit.BuyCnt;
                if (canBuyCnt <= shopItemLimit.BuyCnt)
                {
                    return true;
                }
            }
            return false;
        }
        public static bool CheckRuneStoreIsCanBuy(StoreConfig storeConfig)
        {
            Dictionary<int, List<int>> unlockRunelist = ModelCenter.Instance.GetModel<RuneModel>().GetAllUnlockRuneIdlist();
            if(unlockRunelist != null)
            {
                foreach (var tower in unlockRunelist.Keys)
                {
                    if(unlockRunelist[tower].Contains(storeConfig.ItemID))
                    {
                        return true;
                    }
                }
            }
            return false;
        }
        public static int CompareByShopSort(StoreConfig start, StoreConfig end)
        {
            int sort1 = start.ShopSort;
System/HappyXB/HappyXBModel.cs
@@ -74,7 +74,8 @@
        {
            HAPPYXBITEMKEY = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "HappyXBItemTime");
            XBWarehouseRedPoint();
            XBStoreRedPoint();
            m_storeModel.RefreshTCBPlayerDataEvent -= RefreshStoreScore;
            m_storeModel.RefreshTCBPlayerDataEvent += RefreshStoreScore;
        }
        public override void UnInit()
@@ -688,6 +689,13 @@
            }
        }
        private void RefreshStoreScore(PlayerDataRefresh type)
        {
            if (type != PlayerDataRefresh.CDBPlayerRefresh_TreasureScore) return;
            XBStoreRedPoint();
        }
        private List<StoreConfig> storelist = null;
        public void XBStoreRedPoint()
        {