Kaynağa Gözat

新年活动合成接入协议

huangxiaoyue 1 yıl önce
ebeveyn
işleme
92c8309d47

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

@@ -248,6 +248,7 @@ namespace GFGGame
             ChatSProxy.ReqQueryChatMsg(ChatType.League).Coroutine();
             ChatSProxy.ReqQueryChatMsg(ChatType.LeagueQuestion).Coroutine();
             LuckyBoxSProxy.ReqGetLuckyBoxInfo().Coroutine();
+            ActivityTeaSProxy.ReqGetItemSyntheticInfos(5005).Coroutine();
             LeagueSproxy.ReqGetLeagueInfo().Coroutine();
             SuitFosterProxy.SendGetSuitInfos().Coroutine();
             StudioSProxy.ReqStudioInfos().Coroutine();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Data/ActivityTeaDataManager.cs

@@ -1,12 +1,15 @@
 using ET;
 using GFGGame;
 using System.Collections;
+using System.Collections.Generic;
 using UnityEngine;
 
 namespace Assets.Game.HotUpdate.Data
 {
     public class ActivityTeaDataManager : SingletonBase<ActivityTeaDataManager>
     {
+        public List<ItemSyntheticProto> ItemSynthetics = new List<ItemSyntheticProto>(); 
+
         public bool CheckOpen()
         {
             var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.TEA);

+ 35 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/ActivityTeaSProxy.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using Assets.Game.HotUpdate.Data;
 using ET;
 
 namespace GFGGame
@@ -31,5 +32,39 @@ namespace GFGGame
             //MiniGameDateManager.Instance.NpcInfoList = response.NpcVisits;
             return true;
         }
+
+        //获取合成列表
+        public static async ETTask<bool> ReqGetItemSyntheticInfos(int activityId)
+        {
+            S2C_GetItemSyntheticInfos response = null;
+            response = (S2C_GetItemSyntheticInfos)await MessageHelper.SendToServer(new C2S_GetItemSyntheticInfos() { ActivityId = activityId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    ActivityTeaDataManager.Instance.ItemSynthetics = response.ItemSynthetics;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        //部件合成
+        public static async ETTask<bool> ReqItemSynthetic(int itemId)
+        {
+            S2C_ItemSynthetic response = null;
+            response = (S2C_ItemSynthetic)await MessageHelper.SendToServer(new C2S_ItemSynthetic() { ItemId = itemId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    ActivityTeaDataManager.Instance.ItemSynthetics = response.ItemSynthetics;
+                    BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
+                    return true;
+                }
+            }
+            return false;
+        }
+
     }
 }

+ 9 - 3
GameClient/Assets/Game/HotUpdate/Views/ActivityAfternoonTea/ActivitySyntheticView.cs

@@ -99,7 +99,7 @@ namespace GFGGame
                 if(comBox.m_btnMake.data == null)
                     comBox.m_btnMake.onClick.Add(OnClickBtnMake);
 
-                comBox.m_btnMake.data = index;
+                comBox.m_btnMake.data = _suitCfg.partsArr[index];
             }
             else { 
                 comBox.m_btnType.selectedIndex = 0;
@@ -111,9 +111,15 @@ namespace GFGGame
             UI_SyntheticItemUI.ProxyEnd();
         }
 
-        private void OnClickBtnMake()
+        private async void OnClickBtnMake(EventContext context)
         {
-
+            if (!(context.sender is GObject obj)) return;
+            int itemID = (int)obj.data;
+            bool result = await ActivityTeaSProxy.ReqItemSynthetic(itemID);
+            if (result)
+            {
+                _ui.m_listSynthetic.numItems = _suitCfg.partsArr.Length;
+            }
         }
 
         private void OnClickBtnGet()

+ 5 - 5
GameClient/Assets/Game/HotUpdate/Views/ActivityAfternoonTea/ActivityTeaMainView.cs

@@ -81,11 +81,11 @@ namespace GFGGame
 
         private void OnClickBtnMergeView()
         {
-            //if (!ActivityTeaDataManager.Instance.CheckOpenOne(ActivityType.ItemSynthetic))
-            //{
-            //    PromptController.Instance.ShowFloatTextPrompt("活动未在开启时间");
-            //    return;
-            //}
+            if (!ActivityTeaDataManager.Instance.CheckOpenOne(ActivityType.ItemSynthetic))
+            {
+                PromptController.Instance.ShowFloatTextPrompt("活动未在开启时间");
+                return;
+            }
             //合成入口
             ViewManager.Show<ActivitySyntheticView>();
         }