瀏覽代碼

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

guodong 1 年之前
父節點
當前提交
a2a3ecc5ee

+ 4 - 10
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/GetSuitItemController.cs

@@ -5,6 +5,7 @@ namespace GFGGame
     public class GetSuitItemController
     {
         public static bool enable = true;
+        public static bool showSingle = false;  //是否是每次获得套装就需要显示一次
         private static List<int> _waitingToShowSuit = new List<int>();
         //这个变量主要用于抽奖自动打开
         public static bool isAuto = false;
@@ -21,19 +22,12 @@ namespace GFGGame
                 return;
             }
             int suitId = SuitCfgArray.Instance.GetSuitIdOfItem(itemId);
-            if (_waitingToShowSuit.IndexOf(suitId) < 0)
+            if (_waitingToShowSuit.IndexOf(suitId) < 0 && !showSingle)
             {
                 _waitingToShowSuit.Add(suitId);
             }
         }
 
-        public static bool GetSuitWaitingToId(int itemId)
-        {
-            int suitId = SuitCfgArray.Instance.GetSuitIdOfItem(itemId);
-            int index = _waitingToShowSuit.IndexOf(suitId);
-            return index >= 0;
-        }
-
         public static int TryShow(int itemId)
         {
             int suitId = 0;
@@ -46,14 +40,14 @@ namespace GFGGame
                 if (index >= 0)
                 {
                     _waitingToShowSuit.RemoveAt(index);
-                    ViewManager.Show<SuitItemView>(suitId);
+                    ViewManager.Show<SuitItemView>(new object[] { suitId, 0 });
                 }
             }
             else if (_waitingToShowSuit.Count > 0)
             {
                 suitId = _waitingToShowSuit[0];
                 _waitingToShowSuit.RemoveAt(0);
-                ViewManager.Show<SuitItemView>(suitId);
+                ViewManager.Show<SuitItemView>(new object[] { suitId ,0});
             }
             return suitId;
         }

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/SuitItemView.cs

@@ -10,6 +10,7 @@ namespace GFGGame
         private UI_SuitItemUI _ui;
         private EffectUI _effectUI1;
         private int suitID;
+        private int countSuitId;//当前获得的物品还有多少个相同套装的部件需要展示
         private int count = 0;//套装当前拥有的部件数量
         private int totalCount = 1;
 
@@ -37,12 +38,16 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            suitID = (int)this.viewData;
+            if (this.viewData != null) { 
+                suitID = (int)(this.viewData as object[])[0];
+                countSuitId = (int)(this.viewData as object[])[1];
+            }
             UpdateView();
         }
         private void UpdateView()
         {
             DressUpMenuSuitDataManager.GetSuitProgressBySuitId(suitID, out count, out totalCount);
+            count = count - countSuitId;
             if (suitID > 0)
             {
                 SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitID);

+ 55 - 20
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -110,7 +110,8 @@ namespace GFGGame
 
         protected void ReferNextShow()
         {
-            if (_chooseIndex != -1 && GetSuitItemController.GetSuitWaitingToId(_itemIdList[_chooseIndex]))
+            int suitId = SuitCfgArray.Instance.GetSuitIdOfItem(_itemIdList[_chooseIndex]);
+            if (_chooseIndex != -1 && suitId > 0)
                 ClickItem(_chooseIndex);
             else
             {
@@ -362,6 +363,14 @@ namespace GFGGame
         private void UpDataTime(object param = null)
         {
             _ui.m_touchFlipOpen.touchable = true;
+            if (_recordTurnIndex.Count >= _rewardList.Count)
+            {
+                Timers.inst.Remove(UpDataTime);
+                HideOtherShowWindow();
+                _ui.m_touchFlipOpen.touchable = false;
+                GetSuitItemController.isAuto = false;
+            }
+
             for (int i = 0; i < _rewardList.Count; i++)
             {
                 if (!_recordTurnIndex.Contains(i))
@@ -370,29 +379,27 @@ namespace GFGGame
                     break;
                 }
             }
-
-            if (_recordTurnIndex.Count >= _rewardList.Count)
-            {
-                Timers.inst.Remove(UpDataTime);
-                HideOtherShowWindow();
-                _ui.m_touchFlipOpen.touchable = false;
-                GetSuitItemController.isAuto = false;
-            }
         }
 
+        //控制展示获得物品界面
         private void ShowTurnItem(int index)
         {
             UI_LuckyBoxBonusShowItem item = UI_LuckyBoxBonusShowItem.Proxy(_itemObjList[index]);
             if (!_AnimationWait)
                 return;
+
             if (item.m_comIcon.m_imgNew.visible)
             {
+                _countShow += 1;
                 //判断是否有套装需要展示
-                if (GetSuitItemController.GetSuitWaitingToId(_itemIdList[index]))
+                int suitId = SuitCfgArray.Instance.GetSuitIdOfItem(_itemIdList[index]);
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemIdList[index]);
+                if (suitId > 0 && itemCfg.itemType != ConstItemType.CARD)
                 {
-                    if (_countShow < 1)
+                    if (_countShow == 1)
                     {
-                        _countShow += 1;
+                        ViewManager.Hide<SuitItemView>();
+                        ViewManager.Hide<LuckyBoxNewCardView>();
                         ViewManager.Hide<GetSuitItemVIew>();
                         _rewardItemList.Clear();
                         _rewardItemList.Add(_rewardList[index]);
@@ -402,26 +409,53 @@ namespace GFGGame
                     {
                         ViewManager.Hide<LuckyBoxNewDressView>();
                         ViewManager.Hide<LuckyBoxNewCardView>();
-                        GetSuitItemController.TryShow(_itemIdList[index]);
-                        _recordTurnIndex.Add(index);
-                        _countShow = 0;
-                        _AnimationWait = false;
+                        int count = 0;
+                        int totalCount = 0;
+                        DressUpMenuSuitDataManager.GetSuitProgressBySuitId(suitId, out count, out totalCount);
+
+                        if (_countShow == 2)   //展示进度条界面
+                        {
+                            int countSuitId = 0;
+                            for (int i = index + 1; i < _rewardList.Count; i++)
+                            {
+                                int itemSuitId = SuitCfgArray.Instance.GetSuitIdOfItem(_rewardList[i].id);
+                                if (itemSuitId == suitId)
+                                    countSuitId++;
+                            }
+                            ViewManager.Show<SuitItemView>(new object[] { suitId, countSuitId });
+                        }
+                        else if (_countShow == 3) //展示集齐套装界面
+                        {
+                            ViewManager.Hide<SuitItemView>();
+                            ViewManager.Show<GetSuitItemVIew>(suitId);
+                            _AnimationWait = false;
+                        }
 
-                        if (_handClick)
+                        //判断是否需要显示集齐套装界面
+                        if (count < totalCount || (count >= totalCount && _countShow > 3))
                         {
-                            _handClick = false;
-                            Timers.inst.Remove(UpClickDataTime);
-                            _ui.m_touchFlipOpen.touchable = false;
+                            _recordTurnIndex.Add(index);
+                            _countShow = 0;
+                            if (_handClick)
+                            {
+                                _handClick = false;
+                                Timers.inst.Remove(UpClickDataTime);
+                                _ui.m_touchFlipOpen.touchable = false;
+                            }
                         }
                     }
                 }
                 else
                 {
+                    //词牌和不是套装进这里
+                    ViewManager.Hide<SuitItemView>();
+                    ViewManager.Hide<LuckyBoxNewCardView>();
                     ViewManager.Hide<GetSuitItemVIew>();
                     _rewardItemList.Clear();
                     _rewardItemList.Add(_rewardList[index]);
                     ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
                     _recordTurnIndex.Add(index);
+                    _countShow = 0;
                     _ui.m_touchFlipOpen.touchable = false;
                 }
             }
@@ -495,6 +529,7 @@ namespace GFGGame
 
         private void HideOtherShowWindow()
         {
+            ViewManager.Hide<SuitItemView>();
             ViewManager.Hide<GetSuitItemVIew>();
             ViewManager.Hide<LuckyBoxNewDressView>();
             ViewManager.Hide<LuckyBoxNewCardView>();

+ 4 - 1
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -527,6 +527,7 @@ namespace GFGGame
         }
         private void OnClickBtnBuyOne(EventContext context)
         {
+            GetSuitItemController.showSingle = true;
             GObject obj = context.sender as GObject;
             int boxId = (int)obj.data;
             LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
@@ -550,13 +551,14 @@ namespace GFGGame
                  {
                      ViewManager.Show<LuckyBoxStarView>(null, new object[] { typeof(LuckyBoxView).FullName, boxId });
                      LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
+                     GetSuitItemController.showSingle = false;
                  }
              });
         }
 
         private void OnClickBtnBuyTen(EventContext context)
         {
-
+            GetSuitItemController.showSingle = true;
             GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.LUCKY_BOX);
             if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0 
                 && (GuideDataManager.currentGuideId == 0 
@@ -586,6 +588,7 @@ namespace GFGGame
                 {
                     ViewManager.Show<LuckyBoxStarView>(null, new object[] { typeof(LuckyBoxView).FullName, boxId });
                     LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
+                    GetSuitItemController.showSingle = false;
                 }
             });
         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Store/StoreChargeAddUpView.cs

@@ -133,7 +133,7 @@ namespace GFGGame
                 _dressUpObjUIs.Add(dressUpObjUI);
             }
             _dressUpObjUI = item.m_holder.data as DressUpObjUI;
-            _dressUpObjUI.ResetSceneObj(80, false, true, null, false);
+            _dressUpObjUI.ResetSceneObj(80, true, true, null, false);
             _dressUpObjUI.dressUpObj.PutOnSuitCfg(vipCfg.suitId, true, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
             _dressUpObjUI.UpdateWrapper(item.m_holder);