From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XMultiPkLoadingView.cs | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XMultiPkLoadingView.cs (limited to 'Client/Assets/Scripts/XMainClient/XMultiPkLoadingView.cs') diff --git a/Client/Assets/Scripts/XMainClient/XMultiPkLoadingView.cs b/Client/Assets/Scripts/XMainClient/XMultiPkLoadingView.cs new file mode 100644 index 00000000..4827d7df --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XMultiPkLoadingView.cs @@ -0,0 +1,128 @@ +using System; +using KKSG; +using UILib; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XMultiPkLoadingView : DlgBase + { + public override string fileName + { + get + { + return "Common/PkLoadingDlg2"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public bool IsLoadingOver + { + get + { + return this._isLoadingOver; + } + } + + public override bool needOnTop + { + get + { + return true; + } + } + + private XQualifyingDocument _doc = null; + + private bool _isLoadingOver = false; + + protected override void Init() + { + base.Init(); + this._isLoadingOver = false; + this._doc = XDocuments.GetSpecificDocument(XQualifyingDocument.uuID); + } + + public void ShowPkLoading() + { + this.SetVisible(true, true); + } + + protected override void OnShow() + { + base.OnShow(); + XSingleton.singleton.SetTimer(1f, new XTimerMgr.ElapsedEventHandler(this.LoadingOver), null); + this.SetRoleInfo(); + } + + protected override void OnHide() + { + base.OnHide(); + for (int i = 0; i < base.uiBehaviour.m_HalfPic.Length; i++) + { + base.uiBehaviour.m_HalfPic[i].SetTexturePath(""); + } + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + private void LoadingOver(object o) + { + this._isLoadingOver = true; + } + + private void SetRoleInfo() + { + int num = 0; + while (num < this._doc.PkInfoList.Count && num < 4) + { + base.uiBehaviour.m_Name[num].SetText(this._doc.PkInfoList[num].brief.roleName); + base.uiBehaviour.m_Score[num].SetText(this._doc.PkInfoList[num].point.ToString()); + int num2 = (int)this._doc.PkInfoList[num].brief.roleProfession; + bool flag = XAttributes.GetCategory(this._doc.PkInfoList[num].brief.roleID) > EntityCategory.Category_Role; + if (flag) + { + num2 %= 10; + } + base.uiBehaviour.m_Prefession[num].SetSprite(XSingleton.singleton.GetProfIcon(num2)); + string halfPic = XSingleton.singleton.GetHalfPic(this._doc.PkInfoList[num].brief.roleProfession % 10u); + base.uiBehaviour.m_HalfPic[num].SetTexturePath("atlas/UI/common/2DAvatar/" + halfPic); + num++; + } + } + + public void HidePkLoading() + { + bool flag = !base.IsVisible(); + if (!flag) + { + base.uiBehaviour.m_PkLoadingTween.PlayTween(true, -1f); + base.uiBehaviour.m_PkLoadingTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnPkLoadingTweenFinish)); + } + } + + private void OnPkLoadingTweenFinish(IXUITweenTool tween) + { + this.SetVisible(false, true); + } + } +} -- cgit v1.1-26-g67d0