| | |
| | | get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
|
| | | }
|
| | |
|
| | | private List<StoreConfig> _tagStoreModellist;
|
| | | private List<StoreModel.StoreData> _tagStoreModellist;
|
| | | private FuncConfigConfig _tagFuncModel1;
|
| | | private FuncConfigConfig _tagFuncModel2;
|
| | | private int shopId = 0;
|
| | |
| | | {
|
| | | m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.WeekStore);
|
| | | m_storeModel.storeFuncType = StoreFunc.WeekStore;
|
| | | m_storeModel.shoplist.Clear();
|
| | | m_storeModel.RefreshBuyShopLimitEvent -= OnCreate;
|
| | | GlobalTimeEvent.Instance.secondEvent -= RefreshResetTime;
|
| | | m_storeModel.RefreshTCBPlayerDataEvent -= OnRefreshPlayerInfo;
|
| | |
| | | SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
|
| | | if(successConfig.Type == 97)
|
| | | {
|
| | | _tagStoreModellist = StoreConfig.GetTypeStoreModel((int)m_storeModel.storeFuncType);
|
| | | List<StoreConfig> orderlist = new List<StoreConfig>();
|
| | | _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
|
| | | List<StoreModel.StoreData> orderlist = new List<StoreModel.StoreData>();
|
| | | orderlist.AddRange(_tagStoreModellist);
|
| | | orderlist.Sort(CompareByMoney);
|
| | | for (int i = 0; i < _tagStoreModellist.Count; i++)
|
| | | {
|
| | | if (_tagStoreModellist[i].ID == orderlist[0].ID)
|
| | | if (_tagStoreModellist[i].shopId == orderlist[0].shopId)
|
| | | {
|
| | | shopId = _tagStoreModellist[i].ID;
|
| | | shopId = _tagStoreModellist[i].shopId;
|
| | | int index = i / 2;
|
| | | _shopCtrl.JumpIndex(index);
|
| | | _shopCtrl.m_Scorller.RefreshActiveCellViews();
|
| | |
| | | {
|
| | | if(m_storeModel.jumpShopId != 0)
|
| | | {
|
| | | _tagStoreModellist = StoreConfig.GetTypeStoreModel((int)m_storeModel.storeFuncType);
|
| | | _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
|
| | | for (int i = 0; i < _tagStoreModellist.Count; i++)
|
| | | {
|
| | | if (_tagStoreModellist[i].ID == m_storeModel.jumpShopId)
|
| | | if (_tagStoreModellist[i].shopId == m_storeModel.jumpShopId)
|
| | | {
|
| | | int index = i / 2 ;
|
| | | _shopCtrl.JumpIndex(index > 2 ? index - 1 : index);
|
| | |
| | | {
|
| | | if(_tagStoreModellist == null || _tagStoreModellist.Count < 1)
|
| | | {
|
| | | _tagStoreModellist = StoreConfig.GetTypeStoreModel((int)m_storeModel.storeFuncType);
|
| | | _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
|
| | | }
|
| | |
|
| | | if(_tagStoreModellist.Count > 0)
|
| | | {
|
| | | if (_tagStoreModellist[0].RefreshType == 0)
|
| | | if (_tagStoreModellist[0].storeConfig.RefreshType == 0)
|
| | | {
|
| | | _resetRefreshTimeText.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | _resetRefreshTimeText.gameObject.SetActive(true);
|
| | | _resetRefreshTimeText.text = m_storeModel.GetStoreRefreshTimeByType(_tagStoreModellist[0].RefreshType);
|
| | | _resetRefreshTimeText.text = m_storeModel.GetStoreRefreshTimeByType(_tagStoreModellist[0].storeConfig.RefreshType);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public int CompareByMoney(StoreConfig start,StoreConfig end)
|
| | | public int CompareByMoney(StoreModel.StoreData start, StoreModel.StoreData end)
|
| | | {
|
| | | int money1 = start.MoneyNumber;
|
| | | int money2 = end.MoneyNumber;
|
| | | int money1 = start.storeConfig.MoneyNumber;
|
| | | int money2 = end.storeConfig.MoneyNumber;
|
| | | if (money1.CompareTo(money2) != 0) return money1.CompareTo(money2);
|
| | | int index1 = _tagStoreModellist.IndexOf(start);
|
| | | int index2 = _tagStoreModellist.IndexOf(end);
|
| | |
| | | if (_tagStoreModellist.Count < 1)
|
| | | return;
|
| | |
|
| | | if(m_storeModel.showCoinsUIDict != null && m_storeModel.showCoinsUIDict.ContainsKey(_tagStoreModellist[0].ShopType))
|
| | | if(m_storeModel.showCoinsUIDict != null && m_storeModel.showCoinsUIDict.ContainsKey(_tagStoreModellist[0].storeConfig.ShopType))
|
| | | {
|
| | | if(m_storeModel.showCoinsUIDict[_tagStoreModellist[0].ShopType] == 1)
|
| | | if(m_storeModel.showCoinsUIDict[_tagStoreModellist[0].storeConfig.ShopType] == 1)
|
| | | {
|
| | | _followStoreBottom.gameObject.SetActive(true);
|
| | | _integralBottom.gameObject.SetActive(false);
|
| | | }
|
| | | else if(m_storeModel.showCoinsUIDict[_tagStoreModellist[0].ShopType] == 2)
|
| | | else if(m_storeModel.showCoinsUIDict[_tagStoreModellist[0].storeConfig.ShopType] == 2)
|
| | | {
|
| | | _followStoreBottom.gameObject.SetActive(false);
|
| | | _integralBottom.gameObject.SetActive(true);
|
| | |
| | | private void OnCreate()
|
| | | {
|
| | | shopId = 0;
|
| | | _tagStoreModellist = StoreConfig.GetTypeStoreModel((int)m_storeModel.storeFuncType);
|
| | | _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
|
| | | _shopCtrl.Refresh();
|
| | | if (_tagStoreModellist.Count > 0)
|
| | | {
|
| | |
| | |
|
| | | if (_tagStoreModellist.Count >= cellCount)
|
| | | {
|
| | | StoreConfig shopInfo = _tagStoreModellist[cellCount - 1];
|
| | | StoreConfig shopInfo = _tagStoreModellist[cellCount - 1].storeConfig;
|
| | | if(m_storeModel.shopRedDict.ContainsKey(shopInfo.ID))
|
| | | {
|
| | | shopItemCell.redpoint.redpointId = m_storeModel.shopRedDict[shopInfo.ID].id;
|
| | |
| | | shopItemCell.stateImage.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | ItemConfig chinModel = Config.Instance.Get<ItemConfig>(m_storeModel.ReplaceItemIdByJob(shopInfo.ID,shopInfo.ItemID));
|
| | | ItemConfig chinModel = Config.Instance.Get<ItemConfig>(m_storeModel.GetReplaceId(shopInfo.ID));
|
| | | if(chinModel != null)
|
| | | {
|
| | | ItemCellModel cellModel = new ItemCellModel(chinModel.ID,true,0,shopInfo.IsBind,"",PackType.rptDeleted,true);
|
| | |
| | | private void OnClickIntegralStore()
|
| | | {
|
| | | m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.IntegralStore);
|
| | | m_storeModel.shoplist.Clear();
|
| | | m_storeModel.storeFuncType = StoreFunc.IntegralStore;
|
| | | OnCreate();
|
| | | RefreshResetTime();
|
| | |
| | | private void OnClickBindStore()
|
| | | {
|
| | | m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.BindStore);
|
| | | m_storeModel.shoplist.Clear();
|
| | | m_storeModel.storeFuncType = StoreFunc.BindStore;
|
| | | OnCreate();
|
| | | RefreshResetTime();
|
| | |
| | | private void OnClickStrengthStore()
|
| | | {
|
| | | m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.GrowStrongerStore);
|
| | | m_storeModel.shoplist.Clear();
|
| | | m_storeModel.storeFuncType = StoreFunc.GrowStrongerStore;
|
| | | OnCreate();
|
| | | RefreshResetTime();
|
| | |
| | | private void OnClickCommonStore()
|
| | | {
|
| | | m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.CommonStore);
|
| | | m_storeModel.shoplist.Clear();
|
| | | m_storeModel.storeFuncType = StoreFunc.CommonStore;
|
| | | OnCreate();
|
| | | RefreshResetTime();
|