瀏覽代碼

茶话会接入协议

huangxiaoyue 1 年之前
父節點
當前提交
00c12e886f

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_LeagueAnswerUI.cs

@@ -7,6 +7,7 @@ namespace UI.League
     public partial class UI_LeagueAnswerUI
     {
         public GComponent target;
+        public Controller m_c1;
         public GButton m_btnClose;
         public GButton m_btnRank;
         public UI_ComHeadIcon m_comHead;
@@ -14,6 +15,7 @@ namespace UI.League
         public GTextField m_txtRule;
         public GTextField m_txtTime;
         public GButton m_btnAnswer;
+        public GTextField m_txtRule_2;
         public const string URL = "ui://tw70qm9dpvb452";
         public const string PACKAGE_NAME = "League";
         public const string RES_NAME = "LeagueAnswerUI";
@@ -61,6 +63,7 @@ namespace UI.League
 
         private void Init(GComponent comp)
         {
+            m_c1 = comp.GetController("c1");
             m_btnClose = (GButton)comp.GetChild("btnClose");
             m_btnRank = (GButton)comp.GetChild("btnRank");
             m_comHead = (UI_ComHeadIcon)UI_ComHeadIcon.Create(comp.GetChild("comHead"));
@@ -68,9 +71,11 @@ namespace UI.League
             m_txtRule = (GTextField)comp.GetChild("txtRule");
             m_txtTime = (GTextField)comp.GetChild("txtTime");
             m_btnAnswer = (GButton)comp.GetChild("btnAnswer");
+            m_txtRule_2 = (GTextField)comp.GetChild("txtRule");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_c1 = null;
             m_btnClose = null;
             m_btnRank = null;
             m_comHead.Dispose();
@@ -79,6 +84,7 @@ namespace UI.League
             m_txtRule = null;
             m_txtTime = null;
             m_btnAnswer = null;
+            m_txtRule_2 = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_ComBtn.cs

@@ -34,6 +34,7 @@ namespace UI.RoleInfo
         public GButton m_btnSetLeaguNum;
         public GTextInput m_SetLeagueNumType;
         public GTextInput m_SetNum;
+        public GButton m_btnTeaPartyStart;
         public const string URL = "ui://374k3dwvlqp0dm";
         public const string PACKAGE_NAME = "RoleInfo";
         public const string RES_NAME = "ComBtn";
@@ -108,6 +109,7 @@ namespace UI.RoleInfo
             m_btnSetLeaguNum = (GButton)comp.GetChild("btnSetLeaguNum");
             m_SetLeagueNumType = (GTextInput)comp.GetChild("SetLeagueNumType");
             m_SetNum = (GTextInput)comp.GetChild("SetNum");
+            m_btnTeaPartyStart = (GButton)comp.GetChild("btnTeaPartyStart");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -138,6 +140,7 @@ namespace UI.RoleInfo
             m_btnSetLeaguNum = null;
             m_SetLeagueNumType = null;
             m_SetNum = null;
+            m_btnTeaPartyStart = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 7 - 11
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -836,10 +836,10 @@ namespace GFGGame
         }
 
         //获取玩家本期茶话会参与信息
-        public static async ETTask<bool> GetTeapartyMatchingInfos()
+        public static async ETTask<bool> GetTeapartyMatchingInfos(long roleId)
         {
             S2C_TeapartyMatchingInfos response = null;
-            response = (S2C_TeapartyMatchingInfos)await MessageHelper.SendToServer(new C2S_GetTeapartyMatchingInfos() { RoleId = RoleDataManager.roleId });
+            response = (S2C_TeapartyMatchingInfos)await MessageHelper.SendToServer(new C2S_GetTeapartyMatchingInfos() { RoleId = roleId });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
@@ -852,11 +852,11 @@ namespace GFGGame
         }
 
         //获取茶会每个扮演角色坑位信息
-        public static async ETTask<bool> GetRoleContainerInfos()
+        public static async ETTask<bool> GetRoleContainerInfos(long roleId)
         {
             S2C_GetRoleContainerInfos response = null;
 
-            response = (S2C_GetRoleContainerInfos)await MessageHelper.SendToServer(new C2S_GetRoleContainerInfos() { RoleId = RoleDataManager.roleId });
+            response = (S2C_GetRoleContainerInfos)await MessageHelper.SendToServer(new C2S_GetRoleContainerInfos() { RoleId = roleId });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
@@ -870,15 +870,15 @@ namespace GFGGame
         }
 
         //更换角色坑位以及搭配
-        public static async ETTask<bool> ChangeTeapartyDressup(long TeapartyRoleId,List<int> equipIds)
+        public static async ETTask<bool> ChangeTeapartyDressup(long roleId,int teapartyRoleId, List<int> equipIds)
         {
             S2C_ChangeTeapartyDressup response = null;
-            response = (S2C_ChangeTeapartyDressup)await MessageHelper.SendToServer(new C2S_ChangeTeapartyDressup() { RoleId = TeapartyRoleId, EquipIds  = equipIds });
+            response = (S2C_ChangeTeapartyDressup)await MessageHelper.SendToServer(new C2S_ChangeTeapartyDressup() { RoleId = roleId, TeapartyRoleId = teapartyRoleId, EquipIds  = equipIds });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    //LeagueDataManager.Instance.Type = response.PerScore;
+                    //LeagueDataManager.Instance.TeapartyRoleId = response.TeapartyRoleId;
                     return true;
                 }
             }
@@ -889,16 +889,12 @@ namespace GFGGame
         public static async ETTask<bool> TeapartyStartChallenge(long roleId)
         {
             S2C_TeapartyStartChallenge response = null;
-            ET.Log.Debug("打印测试-----ccccccccccccccccc------------");
 
             response = (S2C_TeapartyStartChallenge)await MessageHelper.SendToServer(new C2S_TeapartyStartChallenge() { RoleId = roleId });
             if (response != null)
             {
-                ET.Log.Debug("打印测试-----ttttttttttttttt---------response.Error---" + response.Error);
-
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    ET.Log.Debug("打印测试-----ttttttttttttttt------------");
                     LeagueDataManager.Instance.RoleContainerList = response.RoleContainerList;
                     return true;
                 }

+ 34 - 31
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -19,6 +19,7 @@ namespace GFGGame
         private UI_DressUpFightUI _ui;
         private int _fightID;
         private int _levelID;
+        private int _TeaPartyID;
         private float listType1X = 0;
         private float partsListX = 0;
         private float partsListScrollingPosY = 0;
@@ -119,7 +120,6 @@ namespace GFGGame
             _ui.m_partsList2.m_comboBoxRarity.visible = false;
             _ui.m_partsList2.m_imgTop.visible = true;
             _ui.m_partsList.m_imgTop.visible = false;
-
         }
 
         protected override void AddEventListener()
@@ -131,7 +131,6 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
             EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
             // EventAgent.AddEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
-
         }
 
         protected override void RemoveEventListener()
@@ -143,7 +142,6 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
             EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
             // EventAgent.RemoveEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
-
         }
 
         protected override void OnShown()
@@ -152,8 +150,10 @@ namespace GFGGame
 
             var objData = (DressUpFightType)this.viewData;
 
-            if (objData.teaPartID > 0)
+            if (objData.teaPartID > 0) { 
                 IsTeaPart = true;
+                _TeaPartyID = objData.teaPartID;
+            }
 
             _levelID = objData.levelID;
             if (!IsTeaPart)
@@ -290,13 +290,39 @@ namespace GFGGame
         private async void ChangeTeapartyDressup()
         {
             DressUpData dressUpData = MyDressUpHelper.dressUpObj.DressUpDataClone();
-            ET.Log.Debug("打印测试-------服装数据----------" + dressUpData.itemList);
-            bool result = await LeagueSproxy.ChangeTeapartyDressup(RoleDataManager.roleId, dressUpData.itemList);
+            bool result = await LeagueSproxy.ChangeTeapartyDressup(RoleDataManager.roleId, _TeaPartyID, dressUpData.itemList);
             if (result)
             {
-                this.Hide();
+                backView();
+            }
+        }
 
+        private void backView()
+        {
+            if (IsTeaPart)
+            {
+                ViewManager.Show<LeagueTeaPartyView>();
             }
+            else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType != ConstInstanceZonesSubType.Hard3)
+            {
+                ViewManager.Show(StudioDataManager.Instance.VIEW_NAME, StudioDataManager.Instance.PROPERTY_SELECT_INDEX, ViewManager.GetGoBackDatas(StudioDataManager.Instance.VIEW_NAME));
+            }
+            else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType == ConstInstanceZonesSubType.Hard3)
+            {
+                ViewManager.Show<StudioFilingView>(null, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName));
+            }
+            else if (_levelCfg.type == ConstInstanceZonesType.Field)
+            {
+                ViewManager.GoBackFrom(ViewName.DRESS_UP_FIGHT_VIEW);
+            }
+            else
+            {
+                // ViewManager.GoBackFrom(ViewName.STORY_CHAPTER_VIEW);
+                ViewManager.Show<StoryChapterView>(_levelCfg.chapterId);//, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW }
+            }
+            //MyDressUpHelper.dressUpObj.TakeOffAll();
+
+            this.Hide();
         }
 
         private void OnClickBtnBack()
@@ -304,33 +330,10 @@ namespace GFGGame
             AlertUI.Show("是否确定退出?")
             .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
             {
-                if(_levelCfg == null){ 
-                    ViewManager.Show<LeagueTeaPartyView>();
-                }
-                else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType != ConstInstanceZonesSubType.Hard3)
-                {
-                    ViewManager.Show(StudioDataManager.Instance.VIEW_NAME, StudioDataManager.Instance.PROPERTY_SELECT_INDEX, ViewManager.GetGoBackDatas(StudioDataManager.Instance.VIEW_NAME));
-                }
-                else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType == ConstInstanceZonesSubType.Hard3)
-                {
-                    ViewManager.Show<StudioFilingView>(null, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName));
-                }
-                else if (_levelCfg.type == ConstInstanceZonesType.Field)
-                {
-                    ViewManager.GoBackFrom(ViewName.DRESS_UP_FIGHT_VIEW);
-                }
-                else
-                {
-                    // ViewManager.GoBackFrom(ViewName.STORY_CHAPTER_VIEW);
-                    ViewManager.Show<StoryChapterView>(_levelCfg.chapterId);//, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW }
-                }
-                //MyDressUpHelper.dressUpObj.TakeOffAll();
-
-                this.Hide();
+                backView();
             });
 
             //ViewManager.Show<StoryChapterView>(StoryDataManager.currentChapter);
-
         }
 
         private void OnClickBtnHome()

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnswerView.cs

@@ -47,6 +47,12 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            if (this.viewData != null) {
+                var index = (int)this.viewData;
+                _ui.m_c1.selectedIndex = index;
+            }
+            else
+                _ui.m_c1.selectedIndex = 0;
 
             UpdateView();
         }

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

@@ -73,7 +73,7 @@ namespace GFGGame
 
         private async void GetRoleContainerInfos()
         {
-            bool result = await LeagueSproxy.GetRoleContainerInfos();
+            bool result = await LeagueSproxy.GetRoleContainerInfos(RoleDataManager.roleId);
             if (result)
             {
                 for (int index = 0; index < teaPartyOverItemList.Count; index++)

+ 29 - 8
GameClient/Assets/Game/HotUpdate/Views/League/LeagueTeaPartyView.cs

@@ -10,8 +10,8 @@ namespace GFGGame
     public class LeagueTeaPartyView : BaseWindow
     {
         private UI_LeagueTeaPartyUI _ui;
-        private List<UI_comTeaPartyItem> teaPartyItemList = new List<UI_comTeaPartyItem>();
         private List<TeapartyRoleCfg> teapartyRoleCfg;
+         
         public override void Dispose()
         {
             if (_ui != null)
@@ -54,9 +54,15 @@ namespace GFGGame
             itemObj.m_iconRole.onClick.Add(OnBtnIconRoleClick);
             itemObj.m_txtRoleName.text = teapartyRoleCfg[index].name;
             var roleContainerList = LeagueDataManager.Instance.RoleContainerList;
-            itemObj.m_txtMaxValue.text = roleContainerList[index].MaxScore.ToString();
-            itemObj.m_txtNumber.text = roleContainerList[index].PerNum.ToString();
-            itemObj.m_txtMaxName.text = roleContainerList[index].MaxScoreRoleName;
+            if (roleContainerList != null)
+            {
+                itemObj.m_txtMaxValue.text = roleContainerList[index].MaxScore.ToString();
+                itemObj.m_txtNumber.text = roleContainerList[index].PerNum.ToString();
+                itemObj.m_txtMaxName.text = roleContainerList[index].MaxScoreRoleName;
+            }
+            var roleTeapartyInfoProto = LeagueDataManager.Instance.RoleTeapartyInfoProto;
+            if (roleTeapartyInfoProto != null)
+                itemObj.m_imgChoose.visible = index == (roleTeapartyInfoProto.TeapartyRoleId - 1);
             UI_comTeaPartyItem.ProxyEnd();
         }
 
@@ -76,24 +82,33 @@ namespace GFGGame
             _ui.m_btnChallenge.visible = isLeader;
 
             GetRoleContainerInfos();
+            GetTeapartyMatchingInfos();
         }
 
         private void UpDataOverTime()
         {
-            ET.Log.Debug("打印测试-------挑战剩余时间----11------" + TimeInfo.Instance.ServerNow());
-            ET.Log.Debug("打印测试------挑战剩余时间-----22------" + LeagueDataManager.Instance.TeaPartyCloseTime);
             _ui.m_txtOverTime.text = "挑战剩余时间:" + TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), LeagueDataManager.Instance.TeaPartyCloseTime);
         }
 
         private async void GetRoleContainerInfos()
         {
-            bool result = await LeagueSproxy.GetRoleContainerInfos();
+            bool result = await LeagueSproxy.GetRoleContainerInfos(RoleDataManager.roleId);
             if (result)
             {
-                _ui.m_ListTeaParty.numItems = 6;
                 UpDataOverTime();
+                _ui.m_ListTeaParty.numItems = 6;
+            }
+        }
+
+        private async void GetTeapartyMatchingInfos()
+        {
+            bool result = await LeagueSproxy.GetTeapartyMatchingInfos(RoleDataManager.roleId);
+            if (result)
+            {
+                _ui.m_ListTeaParty.numItems = 6;
             }
         }
+        
 
         protected override void OnHide()
         {
@@ -112,6 +127,9 @@ namespace GFGGame
 
         private void OnBtnChallengeClick()
         {
+            if (LeagueDataManager.Instance.TeaPartyStatus != 1)
+                return;
+
             TeapartyStartChallenge();
         }
 
@@ -158,6 +176,9 @@ namespace GFGGame
 
         private void OnBtnIconRoleClick(EventContext context)
         {
+            if (LeagueDataManager.Instance.TeaPartyStatus != 1)
+                return;
+
             GObject obj = context.sender as GObject;
             LeagueDataManager.Instance.ChooseTeaPartId = (int)obj.data + 1;
             DressUpFightType dressUpFightType = new DressUpFightType();

+ 4 - 2
GameClient/Assets/Game/HotUpdate/Views/League/LeagueView.cs

@@ -116,8 +116,10 @@ namespace GFGGame
         }
         private void OnBtnPartyClick()
         {
-            //PromptController.Instance.ShowFloatTextPrompt("活动未开启");
-  
+            if (LeagueDataManager.Instance.TeaPartyStatus == 0) {
+                ViewManager.Show<LeagueAnswerView>(1);
+                return;
+            }
             ViewManager.Show<LeagueTeaPartyView>();
         }
         private void OnBtnShopClick()

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/GMPanelView.cs

@@ -47,6 +47,7 @@ namespace GFGGame
             _ui.m_btnGM.onClick.Add(OnClickBtnGM);
             _ui.m_btnAddNum.onClick.Add(OnClickBtnAddCount);
             _ui.m_btnSetNum.onClick.Add(OnClickBtnSetCount);
+            _ui.m_ComBtn.m_btnTeaPartyStart.onClick.Add(OnClickBtnTeaPartyStart);
         }
 
         private void OnClickBtnLeagueSetNum(EventContext context)
@@ -188,6 +189,11 @@ namespace GFGGame
             GMController.SendGMCommand("League|CloseQuestion", "活动结束").Coroutine();
         }
 
+        private void OnClickBtnTeaPartyStart()
+        {
+            GMController.SendGMCommand("League|TeaPartyStart", "茶话会开始").Coroutine();
+        }
+
         private async void OnClickBtnLeagueSkill()
         {
             int _type = int.Parse(_ui.m_ComBtn.m_txtskillType.text);

二進制
GameClient/Assets/ResIn/UI/League/League_fui.bytes


二進制
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_fui.bytes