少年修仙传客户端代码仓库
client_linchunjie
2018-09-14 7edc031f465bdd21decd47f346e00c512d969d45
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
3个文件已修改
99 ■■■■ 已修改文件
System/Store/BagStoreWin.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreModel.cs 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreWin.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/BagStoreWin.cs
@@ -133,6 +133,7 @@
                    {
                        shopItemCell.stateImage.gameObject.SetActive(true);
                        shopItemCell.stateImage.SetSprite(shopInfo.SalesStatus);
                        shopItemCell.stateImage.SetNativeSize();
                    }
                    else
                    {
System/Store/StoreModel.cs
@@ -54,6 +54,7 @@
    public void OnBeforePlayerDataInitialize()
    {
        IsMustBuyDay = false;
        isLogin = true;
        FuncOpen.Instance.OnFuncStateChangeEvent -= FuncStateChange;
        PlayerDatas.Instance.fairyData.OnRefreshFairyMine -= RefreshServerHour;
@@ -82,7 +83,7 @@
        FuncOpen.Instance.OnFuncStateChangeEvent += FuncStateChange;
        RefreshTCBPlayerDataEvent += RefreshPlayerLv;
        TimeMgr.Instance.OnHourEvent += RefreshServerHour;
        SetIsMustBuyDay();
        shoplist = null;
        CheckWeekStoreIsShopBuy(out shoplist);
        ControllerRedPoint();
@@ -239,7 +240,16 @@
    private void RefreshServerHour()
    {
        ControllerRedPoint();
        UpdateMustBuyRedpoint();
        if (PlayerPrefs.HasKey(MUSTBUYSAVE_KEY))
        {
            int day = LocalSave.GetInt(MUSTBUYSAVE_KEY);
            if (day != TimeUtility.ServerNow.Day)
            {
                IsMustBuyDay = true;
                LocalSave.SetInt(MUSTBUYSAVE_KEY, TimeUtility.ServerNow.Day);
                UpdateMustBuyRedpoint();
            }
        }
        if(!PlayerDatas.Instance.fairyData.HasFairy)
        {
            PlayerPrefs.DeleteKey(UNIONSTORESAVE_KEY);
@@ -828,28 +838,32 @@
        foreach(var key in shopRedDict.Keys)
        {
            StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(key);
            if (storeConfig.MoneyNumber == 0)
            if(!mustIdlist.Contains(storeConfig.ItemID))
            {
                if(CheckShopIsCanBuy(storeConfig))
                if (storeConfig.MoneyNumber == 0)
                {
                    shopRedDict[storeConfig.ID].state = RedPointState.Simple;
                    if (CheckShopIsCanBuy(storeConfig))
                    {
                        shopRedDict[storeConfig.ID].state = RedPointState.Simple;
                    }
                    else
                    {
                        shopRedDict[storeConfig.ID].state = RedPointState.None;
                    }
                }
                else
                {
                    shopRedDict[storeConfig.ID].state = RedPointState.None;
                    if (CheckScoreStoreIsCanBuy(storeConfig))
                    {
                        shopRedDict[storeConfig.ID].state = RedPointState.Simple;
                    }
                    else
                    {
                        shopRedDict[storeConfig.ID].state = RedPointState.None;
                    }
                }
            }
            else
            {
                if(CheckScoreStoreIsCanBuy(storeConfig))
                {
                    shopRedDict[storeConfig.ID].state = RedPointState.Simple;
                }
                else
                {
                    shopRedDict[storeConfig.ID].state = RedPointState.None;
                }
            }
        }
    }
@@ -860,13 +874,16 @@
        foreach (var key in shopRedDict.Keys)
        {
            StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(key);
            if (CheckIsMustBuy(storeConfig))
            if(mustIdlist.Contains(storeConfig.ItemID))
            {
                shopRedDict[storeConfig.ID].state = RedPointState.Simple;
            }
            else
            {
                shopRedDict[storeConfig.ID].state = RedPointState.None;
                if (CheckIsMustBuy(storeConfig))
                {
                    shopRedDict[storeConfig.ID].state = RedPointState.Simple;
                }
                else
                {
                    shopRedDict[storeConfig.ID].state = RedPointState.None;
                }
            }
        }
    }
@@ -876,19 +893,41 @@
        if(mustIdlist.Contains(storeConfig.ItemID))
        {
            shopRedDict[storeConfig.ID].state = RedPointState.None;
            IsMustBuyDay = false;
        }
    }
    public bool IsMustBuyDay { get; private set; }
    public void SetIsMustBuyDay()
    {
        if (IsMustBuyDay) return;
        if (PlayerPrefs.HasKey(MUSTBUYSAVE_KEY))
        {
            int day = LocalSave.GetInt(MUSTBUYSAVE_KEY);
            if (day != TimeUtility.ServerNow.Day)
            {
                IsMustBuyDay = true;
                LocalSave.SetInt(MUSTBUYSAVE_KEY, TimeUtility.ServerNow.Day);
            }
            else
            {
                IsMustBuyDay = false;
            }
        }
        else
        {
            IsMustBuyDay = true;
            LocalSave.SetInt(MUSTBUYSAVE_KEY, TimeUtility.ServerNow.Day);
        }
    }
    public List<int> mustIdlist = new List<int>() { 4741};
    public bool CheckIsMustBuy(StoreConfig config)
    {
        if(mustIdlist.Contains(config.ItemID)
            && CheckShopIsCanBuy(config))
        if(CheckShopIsCanBuy(config) && IsMustBuyDay)
        {
            if(IsNewDay(MUSTBUYSAVE_KEY))
            {
                return true;
            }
            return true;
        }
        return false;
    }
System/Store/StoreWin.cs
@@ -307,6 +307,7 @@
                    {
                        shopItemCell.stateImage.gameObject.SetActive(true);
                        shopItemCell.stateImage.SetSprite(shopInfo.SalesStatus);
                        shopItemCell.stateImage.SetNativeSize();
                    }
                    else
                    {