浏览代码

活动礼包红点

zhaoyang 2 年之前
父节点
当前提交
60ca0f2312

+ 12 - 1
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -319,7 +319,7 @@ namespace GFGGame
             return itemHas >= itemNeed && costHas >= costNeed;
         }
 
-        //商店-会员中心
+        //商店-充值-会员中心
         public bool GetChargeAddUpReward()
         {
             VipCfg[] vipCfgs = VipCfgArray.Instance.dataArray;
@@ -334,5 +334,16 @@ namespace GFGGame
             return GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 &&
                    RoleDataManager.vipLv > 0;
         }
+        //商店-礼包-活动礼包
+        public bool GetGiftBagReward()
+        {
+            List<ShopCfg> shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY);
+            shopCfgs = ShopDataManager.Instance.RemoveNotOpenCfg(shopCfgs);
+            for (int i = 0; i < shopCfgs.Count; i++)
+            {
+                if (shopCfgs[i].price == 0 && ShopDataManager.Instance.GetGoodsBuyNumById(shopCfgs[i].id) < shopCfgs[i].maxBuyNum) return true;
+            }
+            return false;
+        }
     }
 }

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

@@ -1008,7 +1008,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_btnTuJian,
                 RedDotDataManager.Instance.GetFieldGuideRed() || RedDotDataManager.Instance.GetTravelGuideRed());
             RedDotController.Instance.SetComRedDot(_btnHaoYou, RedDotDataManager.Instance.GetFriendRed());
-            RedDotController.Instance.SetComRedDot(_btnStore, RedDotDataManager.Instance.GetChargeAddUpReward());
+            RedDotController.Instance.SetComRedDot(_btnStore, RedDotDataManager.Instance.GetChargeAddUpReward() || RedDotDataManager.Instance.GetGiftBagReward());
             RedDotController.Instance.SetComRedDot(_ui.m_btnField.target, RedDotDataManager.Instance.GetFieldRed(), "",
                 10);
             RedDotController.Instance.SetComRedDot(_ui.m_btnStudio.target,

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

@@ -11,6 +11,7 @@ namespace GFGGame
         private UI_StoreGiftBagUI _ui;
         private ValueBarController _valueBarController;
         private List<ShopCfg> _shopCfgs;
+        private int menu2;
 
         public override void Dispose()
         {
@@ -47,7 +48,7 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            int menu2 = (int)this.viewData;
+            menu2 = (int)this.viewData;
             _shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, menu2);
             _shopCfgs = ShopDataManager.Instance.RemoveNotOpenCfg(_shopCfgs);
             _valueBarController.OnShown();
@@ -75,6 +76,7 @@ namespace GFGGame
         {
             ShopCfg shopCfg = _shopCfgs[index];
             ShopViewManager.Instance.UptadeItem(obj, shopCfg);
+            RedDotController.Instance.SetComRedDot(obj.asCom, menu2 == ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY && shopCfg.price == 0 && ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id) < shopCfg.maxBuyNum, "", 0, 70);
         }
     }
 }

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

@@ -53,6 +53,7 @@ namespace GFGGame
         {
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
+            EventAgent.AddEventListener(ConstMessage.SHOP_BUY, UpdateRedDot);
         }
         protected override void OnShown()
         {
@@ -92,6 +93,7 @@ namespace GFGGame
         {
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateRedDot);
+            EventAgent.RemoveEventListener(ConstMessage.SHOP_BUY, UpdateRedDot);
 
         }
         private void OnClickBtnBack()
@@ -200,8 +202,10 @@ namespace GFGGame
         private void UpdateRedDot()
         {
             RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn0.target, RedDotDataManager.Instance.GetChargeAddUpReward());
+            RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_CHARGE_ADDUP).asCom, RedDotDataManager.Instance.GetChargeAddUpReward() && (_ui.m_comTab.m_c1.selectedIndex == ConstStoreTabId.STORE_CHARGE));
 
-            RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_CHARGE_ADDUP).asCom, RedDotDataManager.Instance.GetChargeAddUpReward() && (_ui.m_comTab.m_c1.selectedIndex == ConstStoreSubId.STORE_CHARGE + 1));
+            RedDotController.Instance.SetComRedDot(_ui.m_comTab.m_btn2.target, RedDotDataManager.Instance.GetGiftBagReward());
+            RedDotController.Instance.SetComRedDot(_ui.m_listSubTab.GetChildAt(ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY).asCom, RedDotDataManager.Instance.GetGiftBagReward() && (_ui.m_comTab.m_c1.selectedIndex == ConstStoreTabId.STORE_GIFT_BAG));
         }
     }
 }