少年修仙传客户端代码仓库
client_Zxw
2018-11-14 252d46b8642ad4ecebe1a8b9d3a0678913413ebf
System/Store/StoreWin.cs
@@ -69,7 +69,7 @@
            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;
@@ -148,7 +148,6 @@
        {
            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;
@@ -171,15 +170,15 @@
                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();
@@ -193,10 +192,10 @@
            {
                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);
@@ -213,28 +212,28 @@
        {
            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);
@@ -247,14 +246,14 @@
            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);
@@ -273,7 +272,7 @@
        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)
            {
@@ -322,7 +321,7 @@
                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;
@@ -339,7 +338,7 @@
                        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);
@@ -435,7 +434,6 @@
        private void OnClickIntegralStore()
        {
            m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.IntegralStore);
            m_storeModel.shoplist.Clear();
            m_storeModel.storeFuncType = StoreFunc.IntegralStore;
            OnCreate();
            RefreshResetTime();
@@ -445,7 +443,6 @@
        private void OnClickBindStore()
        {
            m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.BindStore);
            m_storeModel.shoplist.Clear();
            m_storeModel.storeFuncType = StoreFunc.BindStore;
            OnCreate();
            RefreshResetTime();
@@ -455,7 +452,6 @@
        private void OnClickStrengthStore()
        {
            m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.GrowStrongerStore);
            m_storeModel.shoplist.Clear();
            m_storeModel.storeFuncType = StoreFunc.GrowStrongerStore;
            OnCreate();
            RefreshResetTime();
@@ -465,7 +461,6 @@
        private void OnClickCommonStore()
        {
            m_storeModel.ClearAllPetAndMountRedpoint(StoreFunc.CommonStore);
            m_storeModel.shoplist.Clear();
            m_storeModel.storeFuncType = StoreFunc.CommonStore;
            OnCreate();
            RefreshResetTime();