Pārlūkot izejas kodu

修改元宵活动的关卡选择UI,添加剩余时间的显示
添加元宵活动道具的获取途径
修改元宵活动拖拽的判断函数

leiyasi 1 gadu atpakaļ
vecāks
revīzija
0cc327c201

+ 35 - 1
GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

@@ -18,7 +18,7 @@ namespace GFGEditor
         public static void startScan()
         {
             ItemCfg[] dataArray = ItemCfgArray.Instance.dataArray;
-            GetApproachCall[] actions = new GetApproachCall[] { GetClothingShopApproach, GetLeaguePrayApproach, GetLeagueAnswerApproach, CheckStoreApproach, GetClothingSyntheticApproach, GetSuitGuideApproach, GetSuitSyntheticApproach, GetClothingDecomposeApproach, CheckClothingFosterApproach, CheckDailyTaskApproach, CheckWeeklyTaskApproach, GetZhaiXingApproach, GetStoryLevelApproach, GetArenaApproach,GetHeavenApproach ,GetOpenServerFightApproach };
+            GetApproachCall[] actions = new GetApproachCall[] { GetClothingShopApproach, GetLeaguePrayApproach, GetLeagueAnswerApproach, CheckStoreApproach, GetClothingSyntheticApproach, GetSuitGuideApproach, GetSuitSyntheticApproach, GetClothingDecomposeApproach, CheckClothingFosterApproach, CheckDailyTaskApproach, CheckWeeklyTaskApproach, GetZhaiXingApproach, GetStoryLevelApproach, GetArenaApproach,GetHeavenApproach ,GetOpenServerFightApproach, GetYuanXiaoGameConsumeApproach, GetYuanXiaoRewardItemApproach };
             Dictionary<SuitCfg, List<int>> suitDic = new Dictionary<SuitCfg, List<int>>();
             Dictionary<ItemCfg, List<int>> syntheticSuitDic = new Dictionary<ItemCfg, List<int>>();
             Dictionary<SuitCfg, Dictionary<string, string>> suitTagsDic = new Dictionary<SuitCfg, Dictionary<string, string>>();
@@ -408,6 +408,34 @@ namespace GFGEditor
         }
 
         /// <summary>
+        /// 尝试获取元宵小游戏消耗门票的产出途径
+        /// </summary>
+        /// <param name="itemId"></param>
+        /// <returns></returns>
+        private static string GetYuanXiaoGameConsumeApproach(int itemId)
+        {
+            if (itemId == ConstItemID.YUANXIAO_GAME_CONSUME)
+            {
+                return "ACTIVITY_GET_YUAN_XIAO_TASK";
+            }
+            return null;
+        }
+
+        /// <summary>
+        /// 尝试获取元宵小游戏奖励的产出途径
+        /// </summary>
+        /// <param name="itemId"></param>
+        /// <returns></returns>
+        private static string GetYuanXiaoRewardItemApproach(int itemId)
+        {
+            if (itemId == ConstItemID.YUANXIAO_REWARD)
+            {
+                return "ACTIVITY_GET_YUAN_XIAO";
+            }
+            return null;
+        }
+
+        /// <summary>
         /// 尝试获取剧情关卡产出途径
         /// </summary>
         /// <param name="itemId"></param>
@@ -655,6 +683,12 @@ 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);

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstFunctionId.cs

@@ -113,5 +113,10 @@ namespace GFGGame
         ///新年筹备
         /// </summary>
         public const string OPEN_SERVER_FIGHT = "OPEN_SERVER_FIGHT";
+
+        public const string ACTIVITY_GET_YUAN_XIAO_TASK = "ACTIVITY_GET_YUAN_XIAO_TASK";
+
+        public const string ACTIVITY_GET_YUAN_XIAO = "ACTIVITY_GET_YUAN_XIAO";
+
     }
 }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityGetYuanXiao/UI_ActivityGetYuanXiaoEntryUI.cs

@@ -21,6 +21,7 @@ namespace UI.ActivityGetYuanXiao
         public GComponent m_valueBar;
         public GButton m_btnBack;
         public GGraph m_btnStart;
+        public GTextField m_txtTime;
         public Transition m_t0;
         public Transition m_listShow;
         public const string URL = "ui://tguohf7uqkvg4";
@@ -84,6 +85,7 @@ namespace UI.ActivityGetYuanXiao
             m_valueBar = (GComponent)comp.GetChild("valueBar");
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_btnStart = (GGraph)comp.GetChild("btnStart");
+            m_txtTime = (GTextField)comp.GetChild("txtTime");
             m_t0 = comp.GetTransition("t0");
             m_listShow = comp.GetTransition("listShow");
         }
@@ -103,6 +105,7 @@ namespace UI.ActivityGetYuanXiao
             m_valueBar = null;
             m_btnBack = null;
             m_btnStart = null;
+            m_txtTime = null;
             m_t0 = null;
             m_listShow = null;
             if(disposeTarget && target != null)

+ 25 - 2
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoEntryView.cs

@@ -4,6 +4,7 @@ using UI.ActivityGetYuanXiao;
 using FairyGUI;
 using System.Collections.Generic;
 using System.Threading.Tasks;
+using ET;
 
 namespace GFGGame
 {
@@ -77,12 +78,17 @@ namespace GFGGame
             _ui.m_list.selectedIndex = Mathf.Min(_curLevel, ActivityGetYuanXiaoDataManager.Instance.gameinfoList.Count - 1);
             AutoLocationCurLevel();
             UpdateRedDots();
+
+            UpdateTime(null);
+            Timers.inst.Remove(UpdateTime);
+            Timers.inst.Add(1, 0, UpdateTime);
         }
 
         protected override void OnHide()
         {
             base.OnHide();
             _valueBarController.OnHide();
+            Timers.inst.Remove(UpdateTime);
         }
 
         protected override void AddEventListener()
@@ -137,7 +143,7 @@ namespace GFGGame
 
             if (ActivityGetYuanXiaoDataManager.Instance.HaveNewLevelCanPlay() == false)
             {
-                PromptController.Instance.ShowFloatTextPrompt("消耗不足");
+                PromptController.Instance.ShowFloatTextPrompt("游园门票不足,请查看任务列表");
                 return;
             }
 
@@ -172,7 +178,7 @@ namespace GFGGame
             {
                 return;
             }
-            ViewManager.Show<ActivityGetYuanXiaoTaskView>(activityID);
+            ViewManager.Show<ActivityGetYuanXiaoTaskView>();
         }
 
         private void UpdateRedDots()
@@ -210,5 +216,22 @@ namespace GFGGame
         {
             _ui.m_list.ScrollToView(Mathf.Min(_curLevel, ActivityGetYuanXiaoDataManager.Instance.gameinfoList.Count - 1));
         }
+
+        private void UpdateTime(object param)
+        {
+            long curTime = TimeHelper.ServerNow();
+            int activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
+            if (activityID == 0)
+            {
+                return;
+            }
+
+            var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(activityID);
+            if (activityInfo != null)
+            {
+                long endTime = activityInfo.EndTime;
+                _ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
+            }
+        }
     }
 }

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/ActivityGetYuanXiao/ActivityGetYuanXiaoTaskView.cs

@@ -43,7 +43,12 @@ namespace GFGGame
         {
             base.OnShown();
 
-            _activityID = (int)viewData;
+            _activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
+            if (_activityID == 0)
+            {
+                return;
+            }
+
             UpdateTask();
             _ui.m_itemList.scrollPane.ScrollTop();
         }

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

@@ -236,7 +236,7 @@ namespace GFGGame
         {
             _ui.m_catcher.target.visible = true;
             _ui.m_catcher.target.draggable = true;
-            _ui.m_catcher.target.dragBounds = new Rect(-_ui.m_catcher.target.width / 2, _ui.m_catcher.target.y, Screen.width + _ui.m_catcher.target.width, 0);
+            _ui.m_catcher.target.dragBounds = new Rect(-_ui.m_catcher.target.width / 2, _ui.m_catcher.target.y, Stage.inst.width + _ui.m_catcher.target.width, 0);
         }
 
         private void StartGame()
@@ -303,13 +303,13 @@ namespace GFGGame
             _ui.m_catcher.target.visible = false;
             HideGameView();
 
-            ViewManager.Show<ModalStatusView>("加载中...");
-            // 请求游戏结束协议
-            await MiniGameProxy.ReqMiniGameEnd(_cfg.id, _cfg.type, 0, win, _activityID, false);
-            ViewManager.Hide<ModalStatusView>();
-
             if (win)
             {
+                ViewManager.Show<ModalStatusView>("加载中...");
+                // 请求游戏结束协议
+                await MiniGameProxy.ReqMiniGameEnd(_cfg.id, _cfg.type, 0, true, _activityID, false);
+                ViewManager.Hide<ModalStatusView>();
+
                 ViewManager.Show<ActivityGetYuanXiaoSuccessView>(_cfg);
             }
             else

+ 7 - 0
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachView.cs

@@ -152,6 +152,7 @@ namespace GFGGame
             GObject btnGo = context.sender as GObject;
             string[] infos = btnGo.data as string[];
             string functionId = infos[0];
+            GameFunctionCfg gameFunctionCfg = GameFunctionCfgArray.Instance.GetCfg(functionId);
 
             long hasNum = ItemDataManager.GetItemNum(_itemId);
             long needCount = 0;
@@ -369,6 +370,12 @@ namespace GFGGame
                 case ConstFunctionId.OPEN_SERVER_FIGHT:
                     ViewManager.Show<OpenServerFightView>(ConstLimitTimeActivityType.ActLimitStlyc);
                     break;
+                case ConstFunctionId.ACTIVITY_GET_YUAN_XIAO_TASK:
+                    ViewManager.Show($"GFGGame.{gameFunctionCfg.functionId}");
+                    break;
+                case ConstFunctionId.ACTIVITY_GET_YUAN_XIAO:                   
+                    ViewManager.Show($"GFGGame.{gameFunctionCfg.functionId}");
+                    break;
             }
             if (isJump)
             {

BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0.png


BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/ActivityGetYuanXiao/ActivityGetYuanXiao_fui.bytes