| | |
| | | public Dictionary<int,Dictionary<int,int>> JobReplaceIdDict = new Dictionary<int, Dictionary<int, int>>();
|
| | | public Dictionary<int, string> resetTimeDict { get; private set; }
|
| | | public Dictionary<int, int> showCoinsUIDict { get; private set; }
|
| | | public int[] StoreRedIdlist { get; private set;}
|
| | | public override void Init()
|
| | | {
|
| | | FuncConfigConfig buyItemHinit = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("BuyItemHinit");
|
| | |
| | | resetTimeDict = ConfigParse.GetDic<int, string>(restTimeConfig.Numerical1);
|
| | | FuncConfigConfig mallCurrency = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MallCurrency");
|
| | | showCoinsUIDict = ConfigParse.GetDic<int, int>(mallCurrency.Numerical1);
|
| | | FuncConfigConfig mallPush = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MallPush");
|
| | | StoreRedIdlist = ConfigParse.GetMultipleStr<int>(mallPush.Numerical2);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += RefreshFamilyLv;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= FuncStateChange;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += FuncStateChange;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshPlayerLv;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshPlayerLv;
|
| | | RefreshTCBPlayerDataEvent -= RefreshPlayerLv;
|
| | | RefreshTCBPlayerDataEvent += RefreshPlayerLv;
|
| | | TimeMgr.Instance.OnHourEvent -= RefreshServerHour;
|
| | | TimeMgr.Instance.OnHourEvent += RefreshServerHour;
|
| | | shoplist = null;
|
| | |
| | |
|
| | | private void RefreshPlayerLv(PlayerDataRefresh type)
|
| | | {
|
| | | if (type != PlayerDataRefresh.LV && type != PlayerDataRefresh.VIPLv) return;
|
| | |
|
| | | CheckShopRedpoint();
|
| | | switch(type)
|
| | | {
|
| | | case PlayerDataRefresh.LV:
|
| | | case PlayerDataRefresh.VIPLv:
|
| | | case PlayerDataRefresh.Gold:
|
| | | case PlayerDataRefresh.GoldPaper:
|
| | | case PlayerDataRefresh.FBHelpPoint:
|
| | | CheckShopRedpoint();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | StoreConfig storeConfig = ConfigManager.Instance.GetTemplate<StoreConfig>(key);
|
| | | if (storeConfig.MoneyNumber == 0)
|
| | | {
|
| | | int canBuyCnt = 0;
|
| | | int addBuyCnt = 0;
|
| | | bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | BuyShopItemLimit shopItemLimit = GetBuyShopLimit((uint)storeConfig.ID);
|
| | | int remainNum = canBuyCnt;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | remainNum -= shopItemLimit.BuyCnt;
|
| | | }
|
| | | List<StoreConfig> list = StoreConfig.GetSellShoplist();
|
| | | if (remainNum > 0 && list.Contains(storeConfig))
|
| | | if(CheckShopIsCanBuy(storeConfig))
|
| | | {
|
| | | shopRedDict[storeConfig.ID].state = RedPointState.Simple;
|
| | | }
|
| | |
| | | {
|
| | | 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;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckScoreStoreIsCanBuy(StoreConfig storeConfig)
|
| | | {
|
| | | List<StoreConfig> list = StoreConfig.GetSellShoplist();
|
| | | if(StoreRedIdlist.Contains(storeConfig.ID))
|
| | | {
|
| | | if (CheckShopIsCanBuy(storeConfig))
|
| | | {
|
| | | if(UIHelper.GetMoneyCnt(storeConfig.MoneyType) >= (ulong)storeConfig.MoneyNumber)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool CheckShopIsCanBuy(StoreConfig storeConfig)
|
| | | {
|
| | | int canBuyCnt = 0;
|
| | | int addBuyCnt = 0;
|
| | | bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | BuyShopItemLimit shopItemLimit = GetBuyShopLimit((uint)storeConfig.ID);
|
| | | int remainNum = canBuyCnt;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | remainNum -= shopItemLimit.BuyCnt;
|
| | | }
|
| | | List<StoreConfig> list = StoreConfig.GetSellShoplist();
|
| | | if (remainNum > 0 && list.Contains(storeConfig))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | |
|