Browse Source

摘星展示流程补充

huangxiaoyue 1 year ago
parent
commit
7e09e287e4

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -172,6 +172,9 @@ namespace GFGGame
         //MainView to 同步刷新特惠礼包 限时礼包倒计时
         public const string LUCKY_BOX_TIME = "LUCKY_BOX_TIME";
 
+        //摘星奖品展示
+        public const string LUCKY_BOX_REWARD_SHOW = "LUCKY_BOX_REWARD_SHOW";
+
         // 服装散件图鉴配置加载完成
         public const string DRESS_PART_LOAD_FINISHED = "DRESS_PART_LOAD_FINISHED";
     }

+ 38 - 13
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -20,6 +20,7 @@ namespace GFGGame
         private int _chooseIndex = -1;  //当前选中的index
         private int _countShow = 0;   //第几次展示
         private int _countNewRecord = 0;  //展示步骤
+        private bool _handClick = false;   //手动点击开启
 
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
@@ -88,6 +89,25 @@ namespace GFGGame
             _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holder_bg, "ui_LuckyBox", "CK_UI");
             _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holder_cloud, "ui_LuckyBox", "bg_cloud");
         }
+
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.LUCKY_BOX_REWARD_SHOW, ReferNextShow);
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.LUCKY_BOX_REWARD_SHOW, ReferNextShow);
+        }
+
+        protected void ReferNextShow()
+        {
+            if (_chooseIndex != -1)
+                ClickItem(_chooseIndex);
+        }
+
         protected override void OnShown()
         {
             base.OnShown();
@@ -111,9 +131,6 @@ namespace GFGGame
                     UpdateItem(_ui.target.GetChild("item" + i).asCom, i, 10);
                 }
             }
-
-            if(_chooseIndex != -1)
-                HandClickItem(_chooseIndex);
         }
 
         protected override void OnHide()
@@ -207,7 +224,8 @@ namespace GFGGame
 
         private void HandClickItem(int index)
         {
-            _ui.m_touchFlipOpen.touchable = false;
+            _ui.m_touchFlipOpen.touchable = true;
+            _handClick = true;
             ClickItem(index);
             Timers.inst.Add(1f, 1, UpClickDataTime,index);
         }
@@ -223,33 +241,34 @@ namespace GFGGame
                 //先翻开牌面
                 if (!item.m_comIcon.m_imgNew.visible || _countNewRecord < 1)
                 {
-                    if (!item.m_comIcon.m_imgNew.visible) { 
-                        _ui.m_touchFlipOpen.touchable = false;
+                    HideOtherShowWindow();
+                    item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
+                    item.m_t1.Play();
+                    item.m_comIcon.m_t0.Play();
+
+                    if (!item.m_comIcon.m_imgNew.visible) {
+                        if (_handClick)
+                            _ui.m_touchFlipOpen.touchable = false;
                         _recordOpenIndex.Add(index);
                     }
                     else if (_countNewRecord < 1)
                         _countNewRecord += 1;
 
-                    HideOtherShowWindow();
-                    item.m_comIcon.m_FlipOpenType.selectedIndex = 0;
-                    item.m_t1.Play();
-                    item.m_comIcon.m_t0.Play();
                     return;
                 }
 
                 if (item.m_comIcon.m_imgNew.visible && _countNewRecord >= 1)
                 {
-                    Timers.inst.Remove(UpClickDataTime);
                     //判断是否有套装需要展示
                     if (GetSuitItemController.GetSuitWaitingToId(_itemIdList[index]))
                     {
                         if (_countShow < 1)
                         {
+                            _countShow += 1;
                             ViewManager.Hide<GetSuitItemVIew>();
                             _rewardItemList.Clear();
                             _rewardItemList.Add(_rewardList[index]);
                             ViewManager.Show<LuckyBoxNewDressView>(_rewardItemList);
-                            _countShow += 1;
                         }
                         else
                         {
@@ -272,6 +291,12 @@ namespace GFGGame
                     }
                 }
                 UI_LuckyBoxBonusShowItem.ProxyEnd();
+
+                if (_handClick)
+                {
+                    _ui.m_touchFlipOpen.touchable = false;
+                    Timers.inst.Remove(UpClickDataTime);
+                }
             }
             else{
                 GoodsItemTipsController.ShowItemTips(_itemIdList[index]);
@@ -325,7 +350,7 @@ namespace GFGGame
 
         private void ClickPass()
         {
-            _ui.m_touchFlipOpen.touchable = false;
+            _ui.m_touchFlipOpen.touchable = true;
             Timers.inst.Add(1f, 0, UpDataTime);
         }
 

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxNewDressView.cs

@@ -167,6 +167,7 @@ namespace GFGGame
                 //if (_newRewardList.Count == 0 && _oldRewardList.Count == 0)
                 //{
                     this.Hide();
+                    EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_REWARD_SHOW);
             //    }
             //    else {
             //        _ui.m_t_open.Play();