From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/UI/WeekendPartyHandler.cs | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/WeekendPartyHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/WeekendPartyHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/WeekendPartyHandler.cs b/Client/Assets/Scripts/XMainClient/UI/WeekendPartyHandler.cs new file mode 100644 index 00000000..130f40c6 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/WeekendPartyHandler.cs @@ -0,0 +1,98 @@ +using System; +using KKSG; +using UILib; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class WeekendPartyHandler : DlgHandlerBase + { + protected override string FileName + { + get + { + return "Battle/WeekendPartyBattleDlg"; + } + } + + private XWeekendPartyDocument m_Doc; + + private IXUILabel m_BlueScore; + + private IXUILabel m_RedScore; + + private IXUILabel m_ReviveTime; + + private XLeftTimeCounter m_LeftTimeCounter; + + protected override void Init() + { + base.Init(); + this.m_Doc = XDocuments.GetSpecificDocument(XWeekendPartyDocument.uuID); + this.m_Doc.WeekendPartyBattleHandler = this; + this.m_BlueScore = (base.PanelObject.transform.Find("Battle/Score/Bluenum").GetComponent("XUILabel") as IXUILabel); + this.m_RedScore = (base.PanelObject.transform.Find("Battle/Score/Rednum").GetComponent("XUILabel") as IXUILabel); + this.m_ReviveTime = (base.PanelObject.transform.Find("LeftTime").GetComponent("XUILabel") as IXUILabel); + this.m_LeftTimeCounter = new XLeftTimeCounter(this.m_ReviveTime, true); + this.m_LeftTimeCounter.SetFormat(false); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + public override void OnUnload() + { + this.m_Doc.WeekendPartyBattleHandler = null; + base.OnUnload(); + } + + protected override void OnShow() + { + base.OnShow(); + this.RefreshWeekendPartyBattleData(); + this.SetLeftTime(); + } + + private void SetLeftTime() + { + WeekEnd4v4List.RowData activityInfo = this.m_Doc.GetActivityInfo(this.m_Doc.CurrActID); + bool flag = activityInfo != null; + if (flag) + { + bool flag2 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetLeftTime(activityInfo.MaxTime, -1); + } + } + } + + public void RefreshWeekendPartyBattleData() + { + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_CRAZYBOMB || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_LIVECHALLENGE; + if (flag) + { + this.m_BlueScore.SetText(this.m_Doc.EnemyScore.ToString()); + this.m_RedScore.SetText(this.m_Doc.SelfScore.ToString()); + } + else + { + this.m_BlueScore.SetText(this.m_Doc.SelfScore.ToString()); + this.m_RedScore.SetText(this.m_Doc.EnemyScore.ToString()); + } + } + + public void ShowReviveUI(uint time) + { + this.m_LeftTimeCounter.SetLeftTime(time, -1); + } + + public override void OnUpdate() + { + this.m_LeftTimeCounter.Update(); + } + } +} -- cgit v1.1-26-g67d0