Переглянути джерело

茶话会增加转场界面,增加推送事件

huangxiaoyue 1 рік тому
батько
коміт
f3915f1887

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

@@ -36,8 +36,7 @@ namespace GFGGame
         public List<RoleContainerProto> RoleContainerList = new List<RoleContainerProto>(); // 茶会每个扮演角色坑位信息
         public long TeaPartyCloseTime = 0; // 茶话会结束时间
         public int ChooseTeaPartId = 0; // 选择的茶话会类型
-
-
+        
         public void Clear()
         {
             Type = LeagueJoinType.UnJoin;

+ 101 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_LeagueTeaPartyShowUI.cs

@@ -0,0 +1,101 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.League
+{
+    public partial class UI_LeagueTeaPartyShowUI
+    {
+        public GComponent target;
+        public GLoader m_loaBg;
+        public GButton m_btnBack;
+        public UI_comTeaPartyOverItem m_TeaPartyOverItem1;
+        public UI_comTeaPartyOverItem m_TeaPartyOverItem2;
+        public UI_comTeaPartyOverItem m_TeaPartyOverItem3;
+        public UI_comTeaPartyOverItem m_TeaPartyOverItem4;
+        public UI_comTeaPartyOverItem m_TeaPartyOverItem5;
+        public UI_comTeaPartyOverItem m_TeaPartyOverItem6;
+        public GTextField m_txtCountdown;
+        public const string URL = "ui://tw70qm9dn9lgtqq";
+        public const string PACKAGE_NAME = "League";
+        public const string RES_NAME = "LeagueTeaPartyShowUI";
+        private static UI_LeagueTeaPartyShowUI _proxy;
+
+        public static UI_LeagueTeaPartyShowUI Create(GObject gObject = null)
+        {
+            var ui = new UI_LeagueTeaPartyShowUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_LeagueTeaPartyShowUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_LeagueTeaPartyShowUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_btnBack = (GButton)comp.GetChild("btnBack");
+            m_TeaPartyOverItem1 = (UI_comTeaPartyOverItem)UI_comTeaPartyOverItem.Create(comp.GetChild("TeaPartyOverItem1"));
+            m_TeaPartyOverItem2 = (UI_comTeaPartyOverItem)UI_comTeaPartyOverItem.Create(comp.GetChild("TeaPartyOverItem2"));
+            m_TeaPartyOverItem3 = (UI_comTeaPartyOverItem)UI_comTeaPartyOverItem.Create(comp.GetChild("TeaPartyOverItem3"));
+            m_TeaPartyOverItem4 = (UI_comTeaPartyOverItem)UI_comTeaPartyOverItem.Create(comp.GetChild("TeaPartyOverItem4"));
+            m_TeaPartyOverItem5 = (UI_comTeaPartyOverItem)UI_comTeaPartyOverItem.Create(comp.GetChild("TeaPartyOverItem5"));
+            m_TeaPartyOverItem6 = (UI_comTeaPartyOverItem)UI_comTeaPartyOverItem.Create(comp.GetChild("TeaPartyOverItem6"));
+            m_txtCountdown = (GTextField)comp.GetChild("txtCountdown");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaBg = null;
+            m_btnBack = null;
+            m_TeaPartyOverItem1.Dispose();
+            m_TeaPartyOverItem1 = null;
+            m_TeaPartyOverItem2.Dispose();
+            m_TeaPartyOverItem2 = null;
+            m_TeaPartyOverItem3.Dispose();
+            m_TeaPartyOverItem3 = null;
+            m_TeaPartyOverItem4.Dispose();
+            m_TeaPartyOverItem4 = null;
+            m_TeaPartyOverItem5.Dispose();
+            m_TeaPartyOverItem5 = null;
+            m_TeaPartyOverItem6.Dispose();
+            m_TeaPartyOverItem6 = null;
+            m_txtCountdown = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_LeagueTeaPartyShowUI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fffae41d12c1ab0408bb881f954238da
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -14,6 +14,26 @@ namespace GFGGame
             await ETTask.CompletedTask;
         }
     }
+
+    //通知茶会状态
+    public class RoleContainerInfos : AMHandler<S2C_RoleContainerInfos>
+    {
+        protected override async ETTask Run(Session session, S2C_RoleContainerInfos message)
+        {
+            LeagueDataManager.Instance.RoleContainerList = message.RoleContainerList;
+            await ETTask.CompletedTask;
+        }
+    }
+
+    //通知茶会状态
+    public class LeagueScore : AMHandler<S2C_LeagueScore>
+    {
+        protected override async ETTask Run(Session session, S2C_LeagueScore message)
+        {
+            LeagueDataManager.Instance.RoleTeapartyInfoProto.LeagueScore = message.LeagueScore;
+            await ETTask.CompletedTask;
+        }
+    }
     //通知联盟解散了
     public class NoticeDisbandLeague : AMHandler<L2C_NoticeDisbandLeague>
     {

+ 1 - 2
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -1361,8 +1361,7 @@ namespace GFGGame
         }
         protected override void UpdateToCheckGuide(object param)
         {
-
-            if (!ViewManager.CheckIsTopView(this.viewCom)) return;
+            if (!ViewManager.CheckIsTopView(this.viewCom) || IsTeaPart) return;
 
             int buyClothingIndex = 0;
             int buyClothingSubIndex = 0;

+ 118 - 0
GameClient/Assets/Game/HotUpdate/Views/League/LeagueTeaPartyShowView.cs

@@ -0,0 +1,118 @@
+using ET;
+using FairyGUI;
+using Hutool;
+using System.Collections.Generic;
+using UI.League;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class LeagueTeaPartyShowView : BaseWindow
+    {
+        private UI_LeagueTeaPartyShowUI _ui;
+        private List<UI_comTeaPartyOverItem> teaPartyOverItemList = new List<UI_comTeaPartyOverItem>();
+        private List<TeapartyRoleCfg> teapartyRoleCfg;
+        private int timeIndex = 3;  //定时器时间计算
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_LeagueTeaPartyShowUI.PACKAGE_NAME;
+            _ui = UI_LeagueTeaPartyShowUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+            _ui.m_loaBg.url = ResPathUtil.GetDressUpPath("chahuibg");
+            _ui.m_btnBack.onClick.Add(OnBtnBackClick);
+
+            teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem1);
+            teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem2);
+            teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem3);
+            teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem4);
+            teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem5);
+            teaPartyOverItemList.Add(_ui.m_TeaPartyOverItem6);
+
+            teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(1); //LeagueDataManager.Instance.TeaPartyId
+        }
+
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+
+            timeIndex = 0;
+            GetRoleContainerInfos();
+            Timers.inst.Add(1, 3, UpdateTime);
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            Timers.inst.Remove(UpdateTime);
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+        }
+
+        private async void GetRoleContainerInfos()
+        {
+            bool result = await LeagueSproxy.GetRoleContainerInfos(RoleDataManager.roleId);
+            if (result)
+            {
+                var roleContainerList = LeagueDataManager.Instance.RoleContainerList;
+                for (int index = 0; index < teaPartyOverItemList.Count; index++)
+                {
+                    teaPartyOverItemList[index].m_txtRoleName.text = teapartyRoleCfg[index].name;
+                    teaPartyOverItemList[index].m_txtGuildName.text = roleContainerList[index].MaxScoreRoleName;
+                }
+            }
+        }
+
+        private void OnBtnBackClick()
+        {
+            ViewManager.GoBackFrom(typeof(LeagueView).FullName);
+        }
+
+        private void openNextView()
+        {
+            if (LeagueDataManager.Instance.RoleContainerList.Count > 0)
+            {
+                string stroyStartID = "50001";
+                ViewManager.Show<StoryDialogView>(new object[] { stroyStartID, false, new OnCompleteStoryDialogCall(OnCompletePriorStoryDialog), null, true }, null, true);
+            }
+            else
+                ViewManager.Show<LeagueTeaPartyOverView>();
+        }
+
+        private static void OnCompletePriorStoryDialog(bool isSkip, object param)
+        {
+            ViewManager.Show<LeagueTeaPartyOverView>();
+        }
+
+        private void UpdateTime(object param)
+        {
+            timeIndex -= 1;
+            _ui.m_txtCountdown.text = "将在" + timeIndex + "s后进入下一阶段";
+            if (timeIndex <= 0) {
+                openNextView();
+                Timers.inst.Remove(UpdateTime);
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/League/LeagueTeaPartyShowView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d9c06b46abba810469fd728f095288a3
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -137,20 +137,10 @@ namespace GFGGame
             bool result = await LeagueSproxy.TeapartyStartChallenge(RoleDataManager.roleId);
             if (result)
             {
-                if (LeagueDataManager.Instance.RoleContainerList.Count > 0) {
-                    string stroyStartID = "50001";
-                    ViewManager.Show<StoryDialogView>(new object[] { stroyStartID, false, new OnCompleteStoryDialogCall(OnCompletePriorStoryDialog), null, true }, null, true);
-                }
-                else
-                    ViewManager.Show<LeagueTeaPartyOverView>();
+                ViewManager.Show<LeagueTeaPartyShowView>();
             }
         }
 
-        private static void OnCompletePriorStoryDialog(bool isSkip, object param)
-        {
-            ViewManager.Show<LeagueTeaPartyOverView>();
-        }
-
         private void OnBtnRewardClick()
         {
             ViewManager.Show<LeagueTeaPartyRewardView>();

BIN
GameClient/Assets/ResIn/UI/League/League_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/League/League_atlas0.png


BIN
GameClient/Assets/ResIn/UI/League/League_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/League/League_atlas0_1.png


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