Browse Source

摘星添加免费红点

huangxiaoyue 1 year ago
parent
commit
a1d4fad464

+ 30 - 0
GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs

@@ -294,5 +294,35 @@ namespace GFGGame
             return 0;
         }
 
+        public bool RedBtnLeft(int curIndex)
+        {
+            int index = curIndex;
+            for (int i = index; i >= BOX_ID_2 - 1; i--)
+            {
+                int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[i];
+                long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
+                if (freeTime > 0)
+                {
+                    if (freeTime - TimeHelper.ServerNow() < 0)
+                        return true;
+                }
+            }
+            return false;
+        }
+
+        public bool RedBtnRight(int curIndex)
+        {
+            int index = curIndex + 1;
+            for (int i = index; i < BOX_ID_3; i++) {
+                int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[i];
+                long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
+                if (freeTime > 0)
+                {
+                    if (freeTime - TimeHelper.ServerNow() < 0)
+                        return true;
+                }
+            }
+            return false;
+        }
     }
 }

+ 21 - 0
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -927,5 +927,26 @@ namespace GFGGame
         {
             return LimitedRechargeDBGiftDataManager.Instance.CanGetReward();
         }
+
+        /// <summary>
+        /// 摘星免费抽奖
+        /// </summary>
+        /// <returns></returns>
+        public bool GetLuckyBoxFreeTimes()
+        {
+            long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(LuckyBoxDataManager.BOX_ID_2);
+            if (freeTime > 0)
+            {
+                if (freeTime - TimeHelper.ServerNow() < 0)
+                    return true;
+            }
+            freeTime = LuckyBoxDataManager.Instance.GetFreeTime(LuckyBoxDataManager.BOX_ID_3);
+            if (freeTime > 0)
+            {
+                if (freeTime - TimeHelper.ServerNow() < 0)
+                    return true;
+            }
+            return false;
+        }
     }
 }

+ 6 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/LuckyBox/UI_ComBox1.cs

@@ -11,8 +11,9 @@ namespace UI.LuckyBox
         public UI_ComModel m_comModel;
         public GLoader m_loaTitle;
         public GTextField m_txtTime;
-        public GGroup m_grpTime;
         public GTextField m_txtTsyTime;
+        public GGroup m_grpTime;
+        public GButton m_btnRule;
         public GGroup m_grpTitle;
         public GButton m_btnGiftBag;
         public UI_ComBagTime m_comBagTime;
@@ -73,8 +74,9 @@ namespace UI.LuckyBox
             m_comModel = (UI_ComModel)UI_ComModel.Create(comp.GetChild("comModel"));
             m_loaTitle = (GLoader)comp.GetChild("loaTitle");
             m_txtTime = (GTextField)comp.GetChild("txtTime");
-            m_grpTime = (GGroup)comp.GetChild("grpTime");
             m_txtTsyTime = (GTextField)comp.GetChild("txtTsyTime");
+            m_grpTime = (GGroup)comp.GetChild("grpTime");
+            m_btnRule = (GButton)comp.GetChild("btnRule");
             m_grpTitle = (GGroup)comp.GetChild("grpTitle");
             m_btnGiftBag = (GButton)comp.GetChild("btnGiftBag");
             m_comBagTime = (UI_ComBagTime)UI_ComBagTime.Create(comp.GetChild("comBagTime"));
@@ -92,8 +94,9 @@ namespace UI.LuckyBox
             m_comModel = null;
             m_loaTitle = null;
             m_txtTime = null;
-            m_grpTime = null;
             m_txtTsyTime = null;
+            m_grpTime = null;
+            m_btnRule = null;
             m_grpTitle = null;
             m_btnGiftBag = null;
             m_comBagTime.Dispose();

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

@@ -162,7 +162,7 @@ namespace GFGGame
             if (freeTime > 0)
             {
                 long timeDifference = freeTime - TimeHelper.ServerNow();
-                if (timeDifference> 0)
+                if (timeDifference > 0)
                 {
                     comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
                     comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = true;
@@ -174,8 +174,11 @@ namespace GFGGame
                     comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 1;
                     comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
                 }
+                RedDotController.Instance.SetComRedDot(comBox.m_comLuckBoxBtn.m_btnBuyOne, comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex == 1);
             }
 
+            RedDotController.Instance.SetComRedDot(_ui.m_btnLeft, LuckyBoxDataManager.Instance.RedBtnLeft(_curIndex));
+            RedDotController.Instance.SetComRedDot(_ui.m_btnRight, LuckyBoxDataManager.Instance.RedBtnRight(_curIndex),"",-60,70);
             UI_ComBox1.ProxyEnd();
         }
 
@@ -234,6 +237,11 @@ namespace GFGGame
             if (activityId > 0 && boxId == LuckyBoxDataManager.BOX_ID_2) {
                 comBox.m_showActivityType.selectedIndex = 1;
                 UpGiftBox(comBox);
+                if (comBox.m_btnRule.data == null)
+                {
+                    comBox.m_btnRule.onClick.Add(RuleController.ShowRuleView);
+                    comBox.m_btnRule.data = 300024;
+                }
             }
             else
                 comBox.m_showActivityType.selectedIndex = 0;
@@ -639,6 +647,9 @@ namespace GFGGame
                 comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
                 comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
             }
+            RedDotController.Instance.SetComRedDot(comBox.m_comLuckBoxBtn.m_btnBuyOne, comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex == 1);
+
+            UI_ComBox1.ProxyEnd();
         }
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -1010,7 +1010,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_ui.m_btnXiuFang.target, RedDotDataManager.Instance.GetClothingFosterRed() || RedDotDataManager.Instance.GetClothingSyntheticRed(), "", -10, 20);
             RedDotController.Instance.SetComRedDot(_ui.m_btnCiPai.target, RedDotDataManager.Instance.GetCardRed(), "", -10, 20);
 
-            RedDotController.Instance.SetComRedDot(_ui.m_btnZhaiXing.target, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy));
+            RedDotController.Instance.SetComRedDot(_ui.m_btnZhaiXing.target, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy) || RedDotDataManager.Instance.GetLuckyBoxFreeTimes());
         }
 
         private void CheckProbabilityUp()

BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes