From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/XOtherPlayerInfoDocument.cs | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XOtherPlayerInfoDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/XOtherPlayerInfoDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/XOtherPlayerInfoDocument.cs b/Client/Assets/Scripts/XMainClient/XOtherPlayerInfoDocument.cs new file mode 100644 index 00000000..5e0ef141 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XOtherPlayerInfoDocument.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XOtherPlayerInfoDocument : XDocComponent + { + public override uint ID + { + get + { + return XOtherPlayerInfoDocument.uuID; + } + } + + public XOtherPlayerInfoView OtherPlayerInfoView + { + get + { + return this._XOtherPlayerInfoView; + } + set + { + this._XOtherPlayerInfoView = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XOtherPlayerInfoDocument"); + + public UnitAppearance m_Appearance = null; + + private XOtherPlayerInfoView _XOtherPlayerInfoView = null; + + public override void PostUpdate(float fDeltaT) + { + bool hasRole = XSingleton.singleton.HasRole; + if (hasRole) + { + XEntity lastRole = XSingleton.singleton.LastRole; + bool flag = lastRole != null && lastRole.Attributes != null; + if (flag) + { + ulong roleID = lastRole.Attributes.RoleID; + XCharacterCommonMenuDocument.ReqCharacterMenuInfo(roleID, true); + } + } + } + + public List GetOtherEmblemInfoList() + { + bool flag = this.m_Appearance == null; + List result; + if (flag) + { + result = null; + } + else + { + result = this.m_Appearance.emblem; + } + return result; + } + + public List GetOtherArtifactInfoList() + { + bool flag = this.m_Appearance == null; + List result; + if (flag) + { + result = null; + } + else + { + result = this.m_Appearance.artifact; + } + return result; + } + + public void OnGetUnitAppearance(GetUnitAppearanceRes oRes) + { + bool flag = oRes.UnitAppearance == null; + if (flag) + { + XSingleton.singleton.AddLog("[XOtherPlayerInfo] unitInfo is null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + this.m_Appearance = oRes.UnitAppearance; + DlgBase.singleton.RefreshPlayerInfo(oRes.UnitAppearance); + } + } + + public void OnGetSpriteInfoReturn(GetUnitAppearanceRes oRes) + { + bool flag = oRes.UnitAppearance == null; + if (flag) + { + XSingleton.singleton.AddLog("[XOtherPlayerInfo] unitInfo is null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + this.m_Appearance = oRes.UnitAppearance; + DlgBase.singleton.RefreshSpriteInfo(oRes.UnitAppearance.level, oRes.UnitAppearance.sprites, oRes.UnitAppearance); + } + } + + public void OnGetPetInfoReturn(GetUnitAppearanceRes oRes) + { + bool flag = oRes.UnitAppearance == null; + if (flag) + { + XSingleton.singleton.AddLog("[XOtherPlayerInfo] unitInfo is null", null, null, null, null, null, XDebugColor.XDebug_None); + } + else + { + DlgBase.singleton.RefreshPetInfo(oRes.UnitAppearance); + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} -- cgit v1.1-26-g67d0