浏览代码

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

zhaoyang 2 年之前
父节点
当前提交
030e861fe7

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/ActivityDay7DataManager.cs

@@ -8,7 +8,7 @@ namespace GFGGame
         {
             //获取7日任务活动
             var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.Day7);
-            return activityInfo == null ? 0 : TimeUtil.GetDayByTime(activityInfo.StartTime, TimeHelper.ServerNow());
+            return activityInfo == null ? 0 : TimeUtil.GetDay5(activityInfo.StartTime, TimeHelper.ServerNow());
         }
 
         public long GetScore()

+ 13 - 0
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -314,5 +314,18 @@ namespace GFGGame
             }
             return false;
         }
+
+        /// <summary>
+        /// 检测背包中是否存在礼包
+        /// </summary>
+        /// <returns></returns>
+        public static bool BagIsExistGiftBag()
+        {
+            var isExistGiftBag = _dataDic.Values.Any(a =>
+                (a.itemType == ConstItemType.USEABLE && a.subType == ConstItemSubType.USEABLE_GIFT_BAG_SELECTABLE) ||
+                (a.itemType == ConstItemType.USEABLE && a.subType == ConstItemSubType.USEABLE_GIFT_BAG_RANDOM));
+
+            return isExistGiftBag;
+        }
     }
 }

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Data/LimitedTimeGiftBoxDataManager.cs

@@ -7,6 +7,10 @@ namespace GFGGame
 {
     public class LimitedTimeGiftBoxDataManager : SingletonBase<LimitedTimeGiftBoxDataManager>
     {
+        //每日特惠每次登录没有打开过就给红点
+        private bool _isOpenMeiRiTeHui = false;
+        public bool IsOpenMeiRiTeHui => _isOpenMeiRiTeHui;
+        
         //列表数据3--等级条件的数据
         private List<LimitedTimeGiftBoxItemData> _ltgGbItemData3 = new List<LimitedTimeGiftBoxItemData>();
         public List<LimitedTimeGiftBoxItemData> LtgGbItemData3 => _ltgGbItemData3;
@@ -24,6 +28,13 @@ namespace GFGGame
             _ltgGbItemData3.Clear();
             _ltgGbItemData4.Clear();
             _ltgGbItemData5.Clear();
+            _isOpenMeiRiTeHui = false;
+        }
+
+        public void SetIsOpenMeiRiTeHui()
+        {
+            _isOpenMeiRiTeHui = true;
+            EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
         }
 
         public void UpLtgGbItemData3()

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

@@ -390,5 +390,42 @@ namespace GFGGame
             }
             return false;
         }
+
+        /// <summary>
+        /// 摘星-每日特惠
+        /// </summary>
+        /// <returns></returns>
+        public bool GetMeiRiTeHuiRed()
+        {
+            return !LimitedTimeGiftBoxDataManager.Instance.IsOpenMeiRiTeHui;
+        }
+        
+        /// <summary>
+        /// 背包中存在礼包就一直给主界面 背包 红点
+        /// </summary>
+        /// <returns></returns>
+        public bool GetMainBagGiftRed()
+        {
+            return ItemDataManager.BagIsExistGiftBag();
+        }
+
+        // /// <summary>
+        // /// 背包内 是礼包物品就一直给红点
+        // /// </summary>
+        // /// <returns></returns>
+        // public bool GetBagGiftRed(int itemId)
+        // {
+        //     ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+        //     if (itemCfg.itemType == ConstItemType.USEABLE)
+        //     {
+        //         if (itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_SELECTABLE ||
+        //             itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_RANDOM)
+        //         {
+        //             return true;
+        //         }
+        //     }
+        //
+        //     return false;
+        // }
     }
 }

+ 2 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/ItemProxy.cs

@@ -108,6 +108,7 @@ namespace GFGGame
                 {
                     List<ItemData> items = ItemUtil.CreateItemDataList(response.GotItemList);
                     BonusController.TryShowBonusList(items);
+                    EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
                     return true;
                 }
             }
@@ -127,6 +128,7 @@ namespace GFGGame
                 {
                     List<ItemData> items = ItemUtil.CreateItemDataList(response.GotItemList);
                     BonusController.TryShowBonusList(items);
+                    EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
                     return true;
                 }
             }

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

@@ -212,7 +212,7 @@ namespace GFGGame
     {
         protected override async ETTask Run(Session session, L2C_NoticeJoinAnswer message)
         {
-            LeagueDataManager.Instance.ListAnsweringDatas[message.RoleId] = 0;
+            LeagueDataManager.Instance.ListAnsweringDatas[message.RoleId] = message.AnswerNum;
             EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE);
             await ETTask.CompletedTask;
         }
@@ -657,6 +657,7 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
+                    LeagueDataManager.Instance.ListAnsweringDatas.Clear();
                     for (int i = 0; i < response.RoleInfos.Count; i++)
                     {
                         LeagueDataManager.Instance.ListAnsweringDatas[response.RoleInfos[i].RoleId] = response.RoleInfos[i].Num;

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

@@ -52,6 +52,7 @@ namespace GFGGame
                     EventAgent.DispatchEvent(ConstMessage.CONTINUOUS_REBATE_GIFT_SHOP_BUY, shopCfg);
                     BonusController.TryShowBonusList(itemDatas);
                     EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);
+                    EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
                     return true;
                 }
             }

+ 19 - 4
GameClient/Assets/Game/HotUpdate/Views/Bag/BagView.cs

@@ -1,4 +1,3 @@
-
 using System.Collections.Generic;
 using ET;
 using FairyGUI;
@@ -11,7 +10,9 @@ namespace GFGGame
     public class BagView : BaseWindow
     {
         private UI_BagUI _ui;
+
         private ValueBarController _valueBarController;
+
         // private List<ItemView> _listItemViews = new List<ItemView>();
         public override void Dispose()
         {
@@ -51,14 +52,14 @@ namespace GFGGame
             _ui.m_list.onClickItem.Add(OnListItemClick);
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tc_bjbj");
-
         }
+
         protected override void AddEventListener()
         {
             base.AddEventListener();
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateList);
         }
-        
+
         protected override void OnShown()
         {
             base.OnShown();
@@ -74,15 +75,18 @@ namespace GFGGame
             {
                 _ui.m_list.ScrollToView(0);
             }
+
             _ui.m_list.numItems = 0;
 
             base.OnHide();
         }
+
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateList);
         }
+
         private void UpdateList()
         {
             _ui.m_list.numItems = BagDataManager.Instance.BagDatas.Count;
@@ -96,6 +100,18 @@ namespace GFGGame
             item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
             item.m_txtCount.SetVar("count", itemData.num.ToString()).FlushVars();
             item.target.data = itemCfg;
+            //是礼包就加入红点
+            if ((itemCfg.itemType == ConstItemType.USEABLE &&
+                 itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_SELECTABLE) ||
+                (itemCfg.itemType == ConstItemType.USEABLE &&
+                 itemCfg.subType == ConstItemSubType.USEABLE_GIFT_BAG_RANDOM))
+            {
+                RedDotController.Instance.SetComRedDot(item.target, true);
+            }
+            else
+            {
+                RedDotController.Instance.SetComRedDot(item.target, false);
+            }
         }
 
         private void OnListItemClick(EventContext context)
@@ -128,6 +144,5 @@ namespace GFGGame
         {
             ViewManager.GoBackFrom(typeof(BagView).FullName);
         }
-
     }
 }

+ 5 - 1
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/RushSaleGiftBoxView.cs

@@ -128,10 +128,14 @@ namespace GFGGame
             }
             else if (_type == ActivityType.XSLB3)
             {
-                //5
+                //5摘星里面的 每日特惠
                 var data5 = LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData5
                     .FirstOrDefault(a => a.IndexType == 1);
                 _pageIndex = data5 == null ? 0 : LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData5.IndexOf(data5);
+                if (!LimitedTimeGiftBoxDataManager.Instance.IsOpenMeiRiTeHui)
+                {
+                    LimitedTimeGiftBoxDataManager.Instance.SetIsOpenMeiRiTeHui();
+                }
             }
         }
 

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

@@ -287,6 +287,7 @@ namespace GFGGame
         private void UpdateRedDot()
         {
             RedDotController.Instance.SetComRedDot(_ui.m_btnReward, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(), "", -18, 11);
+            RedDotController.Instance.SetComRedDot(_ui.m_btnGiftBag, RedDotDataManager.Instance.GetMeiRiTeHuiRed(), "", -18, 11);
         }
 
         protected override void UpdateToCheckGuide(object param)

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

@@ -1015,7 +1015,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_btnLeague, RedDotDataManager.Instance.GetLeagueMemberJoinRed() || LeagueDataManager.Instance.Type == LeagueJoinType.UnJoin);
             RedDotController.Instance.SetComRedDot(_ui.m_btnDailyWelfare.target, RedDotDataManager.Instance.GetLimiteChargeRewardRed(), "", -10, 5);
             RedDotController.Instance.SetComRedDot(_ui.m_btnActivityLuckyBox.target, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(), "", -10, 5);
-
+            RedDotController.Instance.SetComRedDot(_btnBag, RedDotDataManager.Instance.GetMainBagGiftRed());
         }
 
         private void CheckGuide(object param)