少年修仙传客户端代码仓库
Client_PangDeRong
2018-09-12 079b065efc9666a621617e947bab8ff88463fd4e
3484 新增的噬天丹特殊显示和新增红点
2个文件已修改
80 ■■■■■ 已修改文件
System/Store/StoreModel.cs 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreWin.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreModel.cs
@@ -31,6 +31,7 @@
{
    public int[] normalBuyCoinsTypes { get; private set; }
    public string UNIONSTORESAVE_KEY { get; private set; }
    public string MUSTBUYSAVE_KEY { get; private set; }
    public string StoreEffectRecord_Key { get; private set; }
    public List<StoreConfig> shoplist;
@@ -67,8 +68,8 @@
    public void OnAfterPlayerDataInitialize()
    {
        UNIONSTORESAVE_KEY = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, LocalSaveStoreType.UnionStore);
        DebugEx.Log("UNIONSTORESAVE_KEY:" + UNIONSTORESAVE_KEY);
        StoreEffectRecord_Key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "StoreEffectRecord");
        MUSTBUYSAVE_KEY = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID,"MustBuy");
    }
    public void OnPlayerLoginOk()
@@ -662,7 +663,7 @@
    public bool CheckWeekStoreIsShopBuy(out List<StoreConfig> buylist)
    {
        buylist = new List<StoreConfig>();
        if (!IsNewDay()) return false;
        if (!IsNewDay(StoreEffectRecord_Key)) return false;
        List<StoreConfig> shoplist = StoreConfig.GetTypeStoreModel((int)StoreFunc.WeekStore);
        for(int i = 0; i < shoplist.Count; i++)
@@ -700,16 +701,16 @@
        }
    }
    private bool IsNewDay()
    private bool IsNewDay(string recordKey)
    {
        if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return false;
   
        if (PlayerPrefs.HasKey(StoreEffectRecord_Key))
        if (PlayerPrefs.HasKey(recordKey))
        {
            int day = LocalSave.GetInt(StoreEffectRecord_Key);
            int day = LocalSave.GetInt(recordKey);
            if(day != TimeUtility.ServerNow.Day)
            {
                LocalSave.SetInt(StoreEffectRecord_Key,TimeUtility.ServerNow.Day);
                LocalSave.SetInt(recordKey, TimeUtility.ServerNow.Day);
                return true;
            }
            else
@@ -719,7 +720,7 @@
        }
        else
        {
            LocalSave.SetInt(StoreEffectRecord_Key, TimeUtility.ServerNow.Day);
            LocalSave.SetInt(recordKey, TimeUtility.ServerNow.Day);
            return true;
        }
    }
@@ -835,9 +836,45 @@
                    shopRedDict[storeConfig.ID].state = RedPointState.None;
                }
            }
            UpdateMustBuyRedpoint(storeConfig);
        }
    }
    public void UpdateMustBuyRedpoint(StoreConfig storeConfig)
    {
        if (CheckIsMustBuy(storeConfig))
        {
            shopRedDict[storeConfig.ID].state = RedPointState.Simple;
        }
        else
        {
            shopRedDict[storeConfig.ID].state = RedPointState.None;
        }
    }
    public void ClearMustBuyRedpoint(StoreConfig storeConfig)
    {
        if(mustIdlist.Contains(storeConfig.ItemID))
        {
            shopRedDict[storeConfig.ID].state = RedPointState.None;
        }
    }
    public List<int> mustIdlist = new List<int>() { 4741};
    public bool CheckIsMustBuy(StoreConfig config)
    {
        if(mustIdlist.Contains(config.ItemID)
            && CheckShopIsCanBuy(config))
        {
            if(IsNewDay(MUSTBUYSAVE_KEY))
            {
                return true;
            }
        }
        return false;
    }
    public bool CheckScoreStoreIsCanBuy(StoreConfig storeConfig)
    {
        List<StoreConfig> list = StoreConfig.GetSellShoplist();
System/Store/StoreWin.cs
@@ -392,36 +392,9 @@
                            shopId = 0;
                            shopItemCell.LoadGuidEffectCtrl(shopInfo.ID, shopId);
                        }
                        //if(shopItemCell.effect.IsPlaying)
                        //{
                        //    shopItemCell.effect.StopImediatly();
                        //    if(m_storeModel.shoplist.Contains(shopInfo))
                        //    {
                        //        m_storeModel.shoplist.Remove(shopInfo);
                        //    }
                        //}
                        m_storeModel.ClearMustBuyRedpoint(shopInfo);
                        m_storeModel.OnClickShopCell(shopInfo);
                    });
                    //if(m_storeModel.storeFuncType == StoreFunc.WeekStore)
                    //{
                    //    if(m_storeModel.shoplist.Contains(shopInfo))
                    //    {
                    //        if(!shopItemCell.effect.IsPlaying)
                    //        {
                    //            shopItemCell.effect.Play();
                    //        }
                    //    }
                    //    else
                    //    {
                    //        if (shopItemCell.effect.IsPlaying)
                    //        {
                    //            shopItemCell.effect.StopImediatly();
                    //        }
                    //    }
                    //}
                }
                else
                {