瀏覽代碼

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

guodong 1 年之前
父節點
當前提交
9c16555d39

+ 0 - 6
GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

@@ -683,12 +683,6 @@ namespace GFGEditor
             List<ShopCfg> storyActivityCfg = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_ACTIVITY_EXCHANGE);
             for (int i = 0; i < storyActivityCfg.Count; i++)
             {
-                // 去除未上架的活动商品
-                if (!string.IsNullOrEmpty(storyActivityCfg[i].startTime) && !TimeUtil.IsBeforeCurTime(storyActivityCfg[i].startTime) || !string.IsNullOrEmpty(storyActivityCfg[i].endTime) && !TimeUtil.IsLaterCurTime(storyActivityCfg[i].endTime))
-                {
-                    continue;
-                }
-
                 if (CheckIsHasItem(itemId, storyActivityCfg[i].itemId))
                 {
                     approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_EXCHANGE + "=" + ConstStoreSubId.STORE_ACTIVITY_EXCHANGE);

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

@@ -124,6 +124,7 @@ namespace GFGGame
         public const string OPEN_CHAT_MESSAGE = "OPEN_CHAT_MESSAGE"; //打开查看聊天信息
         public const string ACTIVE_SKILL = "ACTIVE_SKILL";//技能激活
         public const string GET_LEAGUE_INFO = "GET_LEAGUE_INFO";//获得联盟信息
+        public const string LEAGUE_ANSWER_INFO = "LEAGUE_ANSWER_INFO";//联盟答题信息请求
 
         public const string CONTINUOUS_REBATE_GIFT = "CONTINUOUS_REBATE_GIFT"; //领取连续返利礼包
         public const string CONTINUOUS_REBATE_GIFT_SHOP_BUY = "CONTINUOUS_REBATE_GIFT_SHOP_BUY";

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -355,6 +355,10 @@ namespace GFGGame
             FriendSProxy.ReqAllFriendInfos().Coroutine();
             PoemGallerySProxy.ReqGalleryTheme().Coroutine();
             TaskSProxy.GetTaskInfos();
+            ArenaDataManager.Instance.ReqArenaInfo();
+            LeagueSproxy.GetTeapartyInfos().Coroutine();
+            LeagueSproxy.GetTeapartyMatchingInfos(RoleDataManager.roleId).Coroutine();
+            LeagueSproxy.ReqJoinAnswer().Coroutine();
         }
 
         public static void GoBackToMainView()

+ 8 - 6
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -193,29 +193,31 @@ namespace GFGGame
             for (int i = 0; i < LeagueWelfareCfgArray.Instance.dataArray.Length; i++)
             {
                 LeagueWelfareCfg welfareCfg = LeagueWelfareCfgArray.Instance.dataArray[i];
-                bool isBuy = false;
+                bool hasDay = false;
                 bool isGet = false;
                 switch (welfareCfg.type)
                 {
                     case LeagueWelfareType.Day:
-                        isBuy = GetNumeriValue(LeagueNumericType.LeagueWelfareDay) == 1;
+                        hasDay = GetNumeriValue(LeagueNumericType.LeagueWelfareDay) == 1;
                         isGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueWelfareDay) == 1;
                         break;
                     case LeagueWelfareType.Week:
-                        isBuy = GetNumeriValue(LeagueNumericType.LeagueWelfareWeek) == 1;
+                        //hasDay = GetNumeriValue(LeagueNumericType.LeagueWelfareWeekLeftTimes) > 0;
+                        hasDay = GetNumeriValue(LeagueNumericType.LeagueWelfareWeek) == 1;
                         isGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueWelfareWeek) == 1;
                         break;
                     case LeagueWelfareType.SuperWeek:
-                        isBuy = GetNumeriValue(LeagueNumericType.LeagueWelfareSuperWeek) == 1;
+                        //hasDay = GetNumeriValue(LeagueNumericType.LeagueWelfareSuperLeftTimes) > 0;
+                        hasDay = GetNumeriValue(LeagueNumericType.LeagueWelfareSuperWeek) == 1;
                         isGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueWelfareSuperWeek) == 1;
                         break;
                     case LeagueWelfareType.SuperDay:
-                        isBuy = GetNumeriValue(LeagueNumericType.LeagueWelfareSuperDay) == 1;
+                        hasDay = GetNumeriValue(LeagueNumericType.LeagueWelfareSuperDay) == 1;
                         isGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueWelfareSuperDay) == 1;
                         break;
                 }
                 // ET.Log.Debug("isBuy:" + isBuy);
-                if (isBuy)
+                if (hasDay)
                 {
                     LeagueGiftGetData giftGetData = new LeagueGiftGetData();
                     giftGetData.Type = welfareCfg.type;

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

@@ -745,6 +745,7 @@ namespace GFGGame
                     LeagueDataManager.Instance.LastAnswerRoleData.RightRoleId = response.LastRightRoleId;
                     LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionId = response.QuestionId;
                     LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer = response.Ans;
+                    EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_INFO);
                     return true;
                 }
             }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs

@@ -262,7 +262,7 @@ namespace GFGGame
 
 
             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
-            com.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(cfg.res);
+            com.m_loaIcon.url = ResPathUtil.GetIconPath(cfg);
             UI_ComCostCurrency.ProxyEnd();
         }
         public static void UpdateItemNeedNum(GObject obj, int[] cost, bool checkNum = true, string color = "#716B59")

+ 0 - 3
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoDataManager.cs

@@ -30,8 +30,6 @@ namespace GFGGame
 
         public int GetCurLevel()
         {
-            //return gameinfoList.Count;
-
             int i;
             for (i = 0; i < gameinfoList.Count; i++)
             {
@@ -44,7 +42,6 @@ namespace GFGGame
             return i;
         }
 
-
         public List<GameInfoProto> gameinfoList = new List<GameInfoProto>();
     }
 }

+ 28 - 14
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoEntryView.cs

@@ -53,7 +53,7 @@ namespace GFGGame
             _ui.m_btnStart.onClick.Add(OnBtnStartClick);
             _ui.m_btnTask.onClick.Add(OnBtnTaskClick);
             _ui.m_btnShop.onClick.Add(OnBtnShopClick);
-            _ui.m_btnBack.onClick.Add(Hide);
+            _ui.m_btnBack.onClick.Add(OnBtnBackClick);
 
             AddEffect();
         }
@@ -61,18 +61,19 @@ namespace GFGGame
         protected async override void OnShown()
         {
             base.OnShown();
-            _valueBarController.OnShown();
-            _valueBarController.UpdateList(new List<int>() { ConstItemID .YUANXIAO_REWARD, ConstItemID.YUANXIAO_GAME_CONSUME});
 
             _ui.m_list.visible = false;
+            _valueBarController.OnShown();
+            _valueBarController.UpdateList(new List<int>());
             var result = await ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos();
+
             if (!isShowing || !result)
             {
-                Hide();
                 return;
             }
 
             _ui.m_list.visible = true;
+            _valueBarController.UpdateList(new List<int>() { ConstItemID.YUANXIAO_REWARD, ConstItemID.YUANXIAO_GAME_CONSUME });
             _ui.m_listShow.Play();
             _curLevel = ActivityGetYuanXiaoDataManager.Instance.GetCurLevel();
             _ui.m_list.numItems = ActivityGetYuanXiaoDataManager.Instance.gameinfoList.Count;
@@ -131,6 +132,13 @@ namespace GFGGame
 
         private void OnBtnStartClick()
         {
+            int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
+            if (activityID == 0)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
+                return;
+            }
+
             if (_ui.m_list.selectedIndex > _curLevel)
             {
                 PromptController.Instance.ShowFloatTextPrompt("请先通关前置关卡");
@@ -155,10 +163,6 @@ namespace GFGGame
         private async void StartGame()
         {
             int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
-            if (activityID == 0)
-            {
-                return;
-            }
 
             PickUpGame cfg = PickUpGameArray.Instance.dataArray[_ui.m_list.selectedIndex];
             var result = await MiniGameProxy.ReqMiniGameStart(cfg.id, cfg.type, activityID);
@@ -169,6 +173,13 @@ namespace GFGGame
 
         private void OnBtnShopClick()
         {
+            int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
+            if (activityID == 0)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
+                return;
+            }
+
             ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_ACTIVITY_EXCHANGE });
         }
 
@@ -177,8 +188,10 @@ namespace GFGGame
             int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
             if (activityID == 0)
             {
+                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
                 return;
             }
+
             ViewManager.Show<ActivityGetYuanXiaoTaskView>();
         }
 
@@ -222,12 +235,6 @@ namespace GFGGame
         {
             long curTime = TimeHelper.ServerNow();
             int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
-            if (activityID == 0)
-            {
-                Hide();
-                return;
-            }
-
             var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(activityID);
             if (activityInfo != null)
             {
@@ -235,5 +242,12 @@ namespace GFGGame
                 _ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
             }
         }
+
+        private void OnBtnBackClick()
+        {
+            ViewManager.Show<MainUIView>(null, true);
+            ViewManager.DeleteViewStackCountDown("MainUIView");
+        }
+             
     }
 }

+ 7 - 2
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoTaskView.cs

@@ -93,8 +93,13 @@ namespace GFGGame
 
             UI_taskItem item = UI_taskItem.Proxy(gObject);
             item.m_desc.text = TaskDataManager.Instance.GetTaskDesc(_cfgs[index].id);
-            item.m_txtCount.SetVar("cur", $"{TaskDataManager.Instance.GetTaskProgressById(_cfgs[index].id)}")
-                .SetVar("sum", $"{_cfgs[index].GetTargetCount()}").FlushVars();
+            long progress = TaskDataManager.Instance.GetTaskProgressById(_cfgs[index].id);
+            int sum = _cfgs[index].GetTargetCount();
+            if (progress > sum)
+            {
+                progress = sum;
+            }
+            item.m_txtCount.SetVar("cur", $"{progress}").SetVar("sum", $"{sum}").FlushVars();
             item.m_c1.selectedIndex = TaskDataManager.Instance.GetTaskStateById(_cfgs[index].id);
             item.m_c2.selectedIndex = _cfgs[index].jumpId == "" ? 1 : 0;
 

+ 4 - 1
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoView.cs

@@ -506,7 +506,10 @@ namespace GFGGame
             if (!ActivityGetYuanXiaoDataManager.Instance.CheckOpen())
             {
                 _ui.m_catcher.target.visible = false;
-                Hide();
+
+                // 活动结束时强行退回主界面
+                ViewManager.Show<MainUIView>(null, true);
+                ViewManager.DeleteViewStackCountDown("MainUIView");
             }
         }
     }

+ 35 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachView.cs

@@ -65,9 +65,43 @@ namespace GFGGame
             {
                 if (string.IsNullOrEmpty(approachStr)) continue;
                 string[] infos = approachStr.Split('=');
-                _approachDatas.Add(infos);
+
+                if(infos[0] == ConstFunctionId.STORE)
+                {
+                    if (CheckStoreItem(infos))
+                    {
+                        _approachDatas.Add(infos);
+                    }
+                }
+                else
+                {
+                    _approachDatas.Add(infos);
+                }
             }
         }
+
+        /// <summary>
+        /// 去除未上架的商品
+        /// </summary>
+        /// <param name="infos"></param>
+        /// <returns></returns>
+        private bool CheckStoreItem(string[] infos)
+        {
+            int storeTabId = int.Parse(infos[1]);
+            int storeSubId = int.Parse(infos[2]);
+            List<ShopCfg> storyActivityCfg = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(storeTabId, storeSubId);
+            storyActivityCfg = ShopDataManager.Instance.RemoveNotOpenCfg(storyActivityCfg);
+            foreach (var v in storyActivityCfg)
+            {
+                if (v.itemId == _itemId)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
         private void UpdateView()
         {
             _ui.m_txtNone.visible = _approachDatas.Count == 0;

+ 14 - 14
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnsweringView.cs

@@ -64,6 +64,7 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateJoinList);
             EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE, UpdateJoinList);
             EventAgent.AddEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
+            EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_INFO, ReferInfo);
         }
 
         protected override void RemoveEventListener()
@@ -74,23 +75,14 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateJoinList);
             EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE, UpdateJoinList);
             EventAgent.RemoveEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
+            EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_INFO, ReferInfo);
             base.RemoveEventListener();
         }
-        
-        protected override async void OnShown()
+
+        protected override void OnShown()
         {
             base.OnShown();
-
-            bool result = await LeagueSproxy.ReqJoinAnswer();
-            if (!isShowing)
-                return;
-            if (result)
-            {
-                UpdateJoinList();
-            }
-            UpdateQuestionState();
-            UpdateChatList();
-            Timers.inst.Add(1, 0, UpdateActiveTime);
+            LeagueSproxy.ReqJoinAnswer().Coroutine();
         }
 
         protected override void OnHide()
@@ -101,7 +93,15 @@ namespace GFGGame
             Timers.inst.Remove(UpdateActiveTime);
             _ui.m_holderHead.visible = false;
         }
-        
+
+        private void ReferInfo()
+        {
+            UpdateJoinList();
+            UpdateQuestionState();
+            UpdateChatList();
+            Timers.inst.Add(1, 0, UpdateActiveTime);
+        }
+
         private void OnBtnBackClick()
         {
             if (LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.Ending)

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

@@ -263,21 +263,29 @@ namespace GFGGame
 
         private async void UpdateButtons()
         {
+            // 刚进游戏请求数据
             if (!MainDataManager.Instance.needUpdateProxyData)
             {
-                return;
-            }
-            MainDataManager.Instance.needUpdateProxyData = false;
-            var result = await NewYearRedEnvelopeSProxy.ReqGetRedPacketInfo();
-            if (result) {
-                RefreshBtnNewYearRedEnvelope();
-            }
+                MainDataManager.Instance.needUpdateProxyData = false;
+                var result = await NewYearRedEnvelopeSProxy.ReqGetRedPacketInfo();
+                if (result)
+                {
+                    RefreshBtnNewYearRedEnvelope();
+                }
 
-            result = await ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos();
-            if (result)
+                result = await ActivityGetYuanXiaoProxy.ReqGetActivityGameInfos();
+                if (result)
+                {
+                    RefreshBtnYuanXiaoActivity();
+                }
+            }
+            // 后续活动按钮的刷新检测
+            else
             {
+                RefreshBtnNewYearRedEnvelope();
                 RefreshBtnYuanXiaoActivity();
             }
+
         }
 
         private void RefreshBtnNewYearRedEnvelope()

二進制
GameClient/Assets/ResIn/UI/ClothingFoster/ClothingFoster_fui.bytes