Selaa lähdekoodia

茶话会接入部分协议

huangxiaoyue 1 vuosi sitten
vanhempi
commit
5c037cd6b7

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

@@ -116,6 +116,7 @@ namespace GFGGame
             await RoleInfoSProxy.ReqPersonalInfo();
             await ActivityGlobalSProxy.GetActivityInfo();
             await LuckyBoxSProxy.ReqGetLuckyBoxRotatingInfo();
+            await LeagueSproxy.GetTeapartyInfos();
 
             GameGlobal.lastLoginTime = StorageDataManager.Instance.GetStorageValue(ConstStorageId.LAST_LOGIN_TIME);
             long lastTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.OnlineTimeSecs);

+ 4 - 1
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -30,6 +30,10 @@ namespace GFGGame
         public LeagueLastAnswerRoleData LastAnswerRoleData = new LeagueLastAnswerRoleData();//上题回答数据
         public Dictionary<long, int> ListAnsweringDatas = new Dictionary<long, int>();//当前答题玩家数据,roleId,答题数量。
         public Dictionary<int, List<LeagueAnswerData>> ListAnswerRankDatas = new Dictionary<int, List<LeagueAnswerData>>();//答题排行榜数据,int:type//0:周排行 1:上周排行
+        public int TeaPartyId= 0; //茶会期数 --未开启则期数为0
+        public int TeaPartyStatus = 0; // 0未开启 1集结中 2已集结
+        public RoleTeapartyInfoProto RoleTeapartyInfoProto = new RoleTeapartyInfoProto(); // 玩家本期茶话会参与信息
+        public List<RoleContainerProto> RoleContainerList = new List<RoleContainerProto>(); // 茶会每个扮演角色坑位信息
 
 
         public void Clear()
@@ -254,7 +258,6 @@ namespace GFGGame
                 giftBuyDatas.Add(giftBuyData);
             }
             return giftBuyDatas;
-
         }
     }
 }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_ButtonModle5.cs

@@ -7,6 +7,7 @@ namespace UI.League
     public partial class UI_ButtonModle5
     {
         public GButton target;
+        public Controller m_showText;
         public GGraph m_holder;
         public GGraph m_holder1;
         public GLoader m_icon1;
@@ -59,6 +60,7 @@ namespace UI.League
 
         private void Init(GComponent comp)
         {
+            m_showText = comp.GetController("showText");
             m_holder = (GGraph)comp.GetChild("holder");
             m_holder1 = (GGraph)comp.GetChild("holder1");
             m_icon1 = (GLoader)comp.GetChild("icon1");
@@ -67,6 +69,7 @@ namespace UI.League
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_showText = null;
             m_holder = null;
             m_holder1 = null;
             m_icon1 = null;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_LeagueTeaPartyUI.cs

@@ -20,6 +20,7 @@ namespace UI.League
         public UI_comTeaPartyItem m_teaPartyItem5;
         public UI_comTeaPartyItem m_teaPartyItem6;
         public UI_TeaPartyItemTips m_teaPartyItemTips;
+        public GButton m_btnRule;
         public const string URL = "ui://tw70qm9dchwotpk";
         public const string PACKAGE_NAME = "League";
         public const string RES_NAME = "LeagueTeaPartyUI";
@@ -80,6 +81,7 @@ namespace UI.League
             m_teaPartyItem5 = (UI_comTeaPartyItem)UI_comTeaPartyItem.Create(comp.GetChild("teaPartyItem5"));
             m_teaPartyItem6 = (UI_comTeaPartyItem)UI_comTeaPartyItem.Create(comp.GetChild("teaPartyItem6"));
             m_teaPartyItemTips = (UI_TeaPartyItemTips)UI_TeaPartyItemTips.Create(comp.GetChild("teaPartyItemTips"));
+            m_btnRule = (GButton)comp.GetChild("btnRule");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -103,6 +105,7 @@ namespace UI.League
             m_teaPartyItem6 = null;
             m_teaPartyItemTips.Dispose();
             m_teaPartyItemTips = null;
+            m_btnRule = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

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

@@ -818,5 +818,70 @@ namespace GFGGame
             return logData;
         }
 
+        //茶话会获取本期信息
+        public static async ETTask<bool> GetTeapartyInfos()
+        {
+            S2C_GetTeapartyInfos response = null;
+            response = (S2C_GetTeapartyInfos)await MessageHelper.SendToServer(new C2S_GetTeapartyInfos() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.TeaPartyId = response.TeapartyId;
+                    LeagueDataManager.Instance.TeaPartyStatus = response.Status;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        //获取玩家本期茶话会参与信息
+        public static async ETTask<bool> GetTeapartyMatchingInfos()
+        {
+            S2C_TeapartyMatchingInfos response = null;
+            response = (S2C_TeapartyMatchingInfos)await MessageHelper.SendToServer(new C2S_GetTeapartyMatchingInfos() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.RoleTeapartyInfoProto = response.RoleTeapartyInfo;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        //获取茶会每个扮演角色坑位信息
+        public static async ETTask<bool> GetRoleContainerInfos()
+        {
+            S2C_GetRoleContainerInfos response = null;
+            response = (S2C_GetRoleContainerInfos)await MessageHelper.SendToServer(new C2S_GetRoleContainerInfos() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.RoleContainerList = response.RoleContainerList;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        //更换角色坑位以及搭配
+        public static async ETTask<bool> ChangeTeapartyDressup(int TeapartyRoleId,List<int> equipIds)
+        {
+            S2C_ChangeTeapartyDressup response = null;
+            response = (S2C_ChangeTeapartyDressup)await MessageHelper.SendToServer(new C2S_ChangeTeapartyDressup() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    //LeagueDataManager.Instance.Type = response.PerScore;
+                    return true;
+                }
+            }
+            return false;
+        }
+
     }
 }

+ 21 - 3
GameClient/Assets/Game/HotUpdate/Views/League/LeagueTeaPartyView.cs

@@ -45,10 +45,9 @@ namespace GFGGame
 
             _ui.m_teaPartyItemTips.target.onClick.Add(OnTeaPartyItemTipsClick);
 
-            int index = 0;
-            int teaPartyType = 1;
-            List<TeapartyRoleCfg> teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(teaPartyType);
 
+            List<TeapartyRoleCfg> teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(1); //LeagueDataManager.Instance.TeaPartyId
+            int index = 0;
             foreach (var itemObj in teaPartyItemList) {
                 itemObj.m_btnDetail.onClick.Add(OnBtnDetailClick);
                 itemObj.m_iconRole.onClick.Add(OnBtnIconRoleClick);
@@ -65,7 +64,26 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            GetRoleContainerInfos();
+            var openCfg = TeapartyOpenCfgArray.Instance.GetCfg(1);//LeagueDataManager.Instance.TeaPartyId
+            _ui.m_txtTeaName.text = openCfg.name;
+            _ui.m_btnRule.onClick.Add(RuleController.ShowRuleView);
+            _ui.m_btnRule.data = 300022;
         }
+
+        private async void GetRoleContainerInfos()
+        {
+            bool result = await LeagueSproxy.GetRoleContainerInfos();
+            if (result)
+            {
+                var roleContainerList = LeagueDataManager.Instance.RoleContainerList;
+                for (int index = 0; index < roleContainerList.Count; index++){
+                    teaPartyItemList[index].m_txtMaxValue.text = roleContainerList[index].MaxScore.ToString();
+
+                }
+            }
+        }
+
         protected override void OnHide()
         {
             base.OnHide();

+ 22 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeagueView.cs

@@ -60,6 +60,7 @@ namespace GFGGame
             _ui.m_btnChangeNotice.visible = myPos == LeaguePos.Owner || myPos == LeaguePos.SubOwner;
             UpdateView();
             UpdateRedDot();
+            UpdateTeaPartyShowText();
             ChatSProxy.ReqQueryChatMsg(ChatType.League).Coroutine();
             ChatSProxy.ReqQueryChatMsg(ChatType.LeagueQuestion).Coroutine();
         }
@@ -116,7 +117,7 @@ namespace GFGGame
         private void OnBtnPartyClick()
         {
             //PromptController.Instance.ShowFloatTextPrompt("活动未开启");
-
+  
             ViewManager.Show<LeagueTeaPartyView>();
         }
         private void OnBtnShopClick()
@@ -191,6 +192,26 @@ namespace GFGGame
                 _ui.m_btnAnswer.m_txtTime.text = "进行中";
             }
         }
+
+        private void UpdateTeaPartyShowText()
+        {
+            // 0未开启 1集结中 2已集结
+            _ui.m_btnParty.m_showText.selectedIndex = 0;
+            string text = "";
+            if (LeagueDataManager.Instance.TeaPartyStatus == 0)
+            {
+                text = "未开启";
+                _ui.m_btnParty.m_showText.selectedIndex = 1;
+            }
+            else if (LeagueDataManager.Instance.TeaPartyStatus == 1)
+            {
+                text = "集结中";
+                _ui.m_btnParty.m_showText.selectedIndex = 1;
+            }
+
+            _ui.m_btnParty.m_txtTime.text = text;
+        }
+
         private void UpdateRedDot()
         {
             RedDotController.Instance.SetComRedDot(_ui.m_btnMember.target, RedDotDataManager.Instance.GetLeagueMemberJoinRed());

BIN
GameClient/Assets/ResIn/UI/League/League_fui.bytes