zhaoyang 3 жил өмнө
parent
commit
80483fa9cb

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

@@ -127,5 +127,24 @@ namespace GFGGame
             }
             }
             return false;
             return false;
         }
         }
+
+        /// <summary>
+        /// 商城-礼包红点
+        /// </summary>
+        /// <returns></returns>
+        public bool GetRechargeGiftFreeRed()
+        {
+            List<GiftBagCfg> _giftCfgs = RechargeDataManager.Instance.GetGiftBagCfgs();
+            for (int i = 0; i < _giftCfgs.Count; i++)
+            {
+                GiftBagCfg cfg = _giftCfgs[i];
+                bool isUnLock = RechargeDataManager.Instance.GetGiftStateById(cfg.id);
+                int buyNum = RechargeDataManager.Instance.GetGiftBuyNumById(cfg.id);
+                bool canBuy = cfg.maxBuyNum == 0 || buyNum < cfg.maxBuyNum ? true : false;
+                if (isUnLock && canBuy && cfg.price == 0) return true;
+
+            }
+            return false;
+        }
     }
     }
 }
 }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/CommonSProxy.cs

@@ -13,7 +13,7 @@ namespace ET
             switch (message.NumericType)
             switch (message.NumericType)
             {
             {
                 case NumericType.Lvl:
                 case NumericType.Lvl:
-                    FunctionOpenDataManager.Instance.CheckHasLvFunOpen((int)message.NewValue,oldValue);//等级变化要加测是否有功能开启
+                    FunctionOpenDataManager.Instance.CheckHasLvFunOpen((int)message.NewValue, oldValue);//等级变化要加测是否有功能开启
                     RoleDataManager.RoleLvUp(oldValue);
                     RoleDataManager.RoleLvUp(oldValue);
                     break;
                     break;
                 case NumericType.Power:
                 case NumericType.Power:
@@ -21,6 +21,7 @@ namespace ET
                     break;
                     break;
             }
             }
             EventAgent.DispatchEvent(ConstMessage.NUMERIC_CHANGE, message.NumericType);
             EventAgent.DispatchEvent(ConstMessage.NUMERIC_CHANGE, message.NumericType);
+            EventAgent.DispatchEvent(ConstMessage.RED_CHANGE, message.NumericType);
             await ETTask.CompletedTask;
             await ETTask.CompletedTask;
         }
         }
     }
     }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/RechargeSProxy.cs

@@ -60,6 +60,7 @@ namespace GFGGame
                     RechargeDataManager.Instance.UpdateGiftData(response.GiftBagId, response.BuyTimes);
                     RechargeDataManager.Instance.UpdateGiftData(response.GiftBagId, response.BuyTimes);
                     BonusController.TryShowBonusList(GiftBagCfgArray.Instance.GetCfg(response.GiftBagId).itemsArr);
                     BonusController.TryShowBonusList(GiftBagCfgArray.Instance.GetCfg(response.GiftBagId).itemsArr);
                     EventAgent.DispatchEvent(ConstMessage.BUY_GIFT_SUCCESS);
                     EventAgent.DispatchEvent(ConstMessage.BUY_GIFT_SUCCESS);
+                    EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
                     return true;
                     return true;
                 }
                 }
             }
             }

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendAddView.cs

@@ -52,7 +52,7 @@ namespace GFGGame
             base.AddEventListener();
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.FRIEND_APPLY_CHANGE, UpdateApplyList);
             EventAgent.AddEventListener(ConstMessage.FRIEND_APPLY_CHANGE, UpdateApplyList);
             EventAgent.AddEventListener(ConstMessage.FRIEND_ADD, UpdateApplyList);
             EventAgent.AddEventListener(ConstMessage.FRIEND_ADD, UpdateApplyList);
-            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdaterRed);
+            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
 
 
         }
         }
         protected override void OnShown()
         protected override void OnShown()
@@ -63,7 +63,7 @@ namespace GFGGame
             _ui.m_btnClear.visible = false;
             _ui.m_btnClear.visible = false;
             OnBtnRefreshClick();
             OnBtnRefreshClick();
             UpdateApplyList();
             UpdateApplyList();
-            UpdaterRed();
+            UpdateRedDot();
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
@@ -75,7 +75,7 @@ namespace GFGGame
             base.RemoveEventListener();
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_APPLY_CHANGE, UpdateApplyList);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_APPLY_CHANGE, UpdateApplyList);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_ADD, UpdateApplyList);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_ADD, UpdateApplyList);
-            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdaterRed);
+            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
         }
         }
 
 
         /**************************************************好友搜索***********************************************/
         /**************************************************好友搜索***********************************************/
@@ -232,7 +232,7 @@ namespace GFGGame
             });
             });
         }
         }
 
 
-        private void UpdaterRed()
+        private void UpdateRedDot()
         {
         {
             RedDotController.Instance.SetComRedDot(_ui.m_btnTabApply, RedDotDataManager.Instance.GetFriendApplyRed());
             RedDotController.Instance.SetComRedDot(_ui.m_btnTabApply, RedDotDataManager.Instance.GetFriendApplyRed());
         }
         }

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -60,7 +60,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.FRIEND_REFRESH, RefreshView);
             EventAgent.AddEventListener(ConstMessage.FRIEND_REFRESH, RefreshView);
             EventAgent.AddEventListener(ConstMessage.FRIEND_REMOVE, RefreshRemoveFriend);
             EventAgent.AddEventListener(ConstMessage.FRIEND_REMOVE, RefreshRemoveFriend);
             EventAgent.AddEventListener(ConstMessage.FRIEND_ADD, RefreshAddFriend);
             EventAgent.AddEventListener(ConstMessage.FRIEND_ADD, RefreshAddFriend);
-            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdaterRed);
+            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
         }
         }
         protected override void OnShown()
         protected override void OnShown()
         {
         {
@@ -87,7 +87,7 @@ namespace GFGGame
             }
             }
 
 
             RefreshView();
             RefreshView();
-            UpdaterRed();
+            UpdateRedDot();
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
@@ -107,7 +107,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_REFRESH, RefreshView);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_REFRESH, RefreshView);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_REMOVE, RefreshRemoveFriend);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_REMOVE, RefreshRemoveFriend);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_ADD, RefreshAddFriend);
             EventAgent.RemoveEventListener(ConstMessage.FRIEND_ADD, RefreshAddFriend);
-            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdaterRed);
+            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
 
 
         }
         }
 
 
@@ -277,7 +277,7 @@ namespace GFGGame
             ViewManager.Show<FriendAddView>();
             ViewManager.Show<FriendAddView>();
         }
         }
 
 
-        private void UpdaterRed()
+        private void UpdateRedDot()
         {
         {
             RedDotController.Instance.SetComRedDot(_ui.m_btnAdd, RedDotDataManager.Instance.GetFriendApplyRed());
             RedDotController.Instance.SetComRedDot(_ui.m_btnAdd, RedDotDataManager.Instance.GetFriendApplyRed());
             RedDotController.Instance.SetComRedDot(_ui.m_btnSendAll, RedDotDataManager.Instance.GetFriendGiftRed());
             RedDotController.Instance.SetComRedDot(_ui.m_btnSendAll, RedDotDataManager.Instance.GetFriendGiftRed());

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

@@ -433,6 +433,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_btnYouJian, RedDotDataManager.Instance.GetMailRed());
             RedDotController.Instance.SetComRedDot(_btnYouJian, RedDotDataManager.Instance.GetMailRed());
             RedDotController.Instance.SetComRedDot(_btnTuJian, RedDotDataManager.Instance.GetFieldGuideRed());
             RedDotController.Instance.SetComRedDot(_btnTuJian, RedDotDataManager.Instance.GetFieldGuideRed());
             RedDotController.Instance.SetComRedDot(_btnHaoYou, RedDotDataManager.Instance.GetFriendRed());
             RedDotController.Instance.SetComRedDot(_btnHaoYou, RedDotDataManager.Instance.GetFriendRed());
+            RedDotController.Instance.SetComRedDot(_btnStore, RedDotDataManager.Instance.GetRechargeGiftFreeRed());
         }
         }
 
 
         private void CheckGuide(object param)
         private void CheckGuide(object param)

+ 10 - 0
GameClient/Assets/Game/HotUpdate/Views/RechargeStore/RechargeStoreView.cs

@@ -55,6 +55,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.BUY_RECHARGE_SUCCESS, UpdateList);
             EventAgent.AddEventListener(ConstMessage.BUY_RECHARGE_SUCCESS, UpdateList);
             EventAgent.AddEventListener(ConstMessage.BUY_EXCHANGE_SUCCESS, UpdateExchangeList);
             EventAgent.AddEventListener(ConstMessage.BUY_EXCHANGE_SUCCESS, UpdateExchangeList);
             EventAgent.AddEventListener(ConstMessage.BUY_GIFT_SUCCESS, UpdateGiftBagList);
             EventAgent.AddEventListener(ConstMessage.BUY_GIFT_SUCCESS, UpdateGiftBagList);
+            EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
         }
         }
         protected override void OnShown()
         protected override void OnShown()
         {
         {
@@ -85,6 +86,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.BUY_RECHARGE_SUCCESS, UpdateList);
             EventAgent.RemoveEventListener(ConstMessage.BUY_RECHARGE_SUCCESS, UpdateList);
             EventAgent.RemoveEventListener(ConstMessage.BUY_EXCHANGE_SUCCESS, UpdateExchangeList);
             EventAgent.RemoveEventListener(ConstMessage.BUY_EXCHANGE_SUCCESS, UpdateExchangeList);
             EventAgent.RemoveEventListener(ConstMessage.BUY_GIFT_SUCCESS, UpdateGiftBagList);
             EventAgent.RemoveEventListener(ConstMessage.BUY_GIFT_SUCCESS, UpdateGiftBagList);
+            EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
         }
         }
         private void OnClickBtnBack()
         private void OnClickBtnBack()
         {
         {
@@ -110,6 +112,7 @@ namespace GFGGame
         {
         {
             _giftCfgs = RechargeDataManager.Instance.GetGiftBagCfgs();
             _giftCfgs = RechargeDataManager.Instance.GetGiftBagCfgs();
             _ui.m_listGift.numItems = _giftCfgs.Count;
             _ui.m_listGift.numItems = _giftCfgs.Count;
+            UpdateRedDot();
         }
         }
         private void UpdateExchangeList()
         private void UpdateExchangeList()
         {
         {
@@ -222,6 +225,9 @@ namespace GFGGame
                 item.target.onClick.Add(OnBtnBuyClick);
                 item.target.onClick.Add(OnBtnBuyClick);
             }
             }
             item.target.data = cfg.id;
             item.target.data = cfg.id;
+            bool isRed = item.m_c1.selectedIndex == 0 && item.m_c2.selectedIndex == 0 && cfg.price == 0;
+
+            RedDotController.Instance.SetComRedDot(item.target, isRed, "", -6, 100);
             UI_ListGiftItem.ProxyEnd();
             UI_ListGiftItem.ProxyEnd();
         }
         }
         private void OnBtnBuyClick(EventContext context)
         private void OnBtnBuyClick(EventContext context)
@@ -289,5 +295,9 @@ namespace GFGGame
             ViewManager.Show<ItemExchangeView>(cfg.id);
             ViewManager.Show<ItemExchangeView>(cfg.id);
         }
         }
 
 
+        private void UpdateRedDot()
+        {
+            RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn1.target, RedDotDataManager.Instance.GetRechargeGiftFreeRed());
+        }
     }
     }
 }
 }