summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XOtherPlayerInfoDocument.cs
blob: 5e0ef1413402b1541e5aec336662269f64ac1e34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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<XCommon>.singleton.XHash("XOtherPlayerInfoDocument");

		public UnitAppearance m_Appearance = null;

		private XOtherPlayerInfoView _XOtherPlayerInfoView = null;

		public override void PostUpdate(float fDeltaT)
		{
			bool hasRole = XSingleton<XInput>.singleton.HasRole;
			if (hasRole)
			{
				XEntity lastRole = XSingleton<XInput>.singleton.LastRole;
				bool flag = lastRole != null && lastRole.Attributes != null;
				if (flag)
				{
					ulong roleID = lastRole.Attributes.RoleID;
					XCharacterCommonMenuDocument.ReqCharacterMenuInfo(roleID, true);
				}
			}
		}

		public List<Item> GetOtherEmblemInfoList()
		{
			bool flag = this.m_Appearance == null;
			List<Item> result;
			if (flag)
			{
				result = null;
			}
			else
			{
				result = this.m_Appearance.emblem;
			}
			return result;
		}

		public List<Item> GetOtherArtifactInfoList()
		{
			bool flag = this.m_Appearance == null;
			List<Item> 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<XDebug>.singleton.AddLog("[XOtherPlayerInfo] unitInfo is null", null, null, null, null, null, XDebugColor.XDebug_None);
			}
			else
			{
				this.m_Appearance = oRes.UnitAppearance;
				DlgBase<XOtherPlayerInfoView, XOtherPlayerInfoBehaviour>.singleton.RefreshPlayerInfo(oRes.UnitAppearance);
			}
		}

		public void OnGetSpriteInfoReturn(GetUnitAppearanceRes oRes)
		{
			bool flag = oRes.UnitAppearance == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddLog("[XOtherPlayerInfo] unitInfo is null", null, null, null, null, null, XDebugColor.XDebug_None);
			}
			else
			{
				this.m_Appearance = oRes.UnitAppearance;
				DlgBase<XOtherPlayerInfoView, XOtherPlayerInfoBehaviour>.singleton.RefreshSpriteInfo(oRes.UnitAppearance.level, oRes.UnitAppearance.sprites, oRes.UnitAppearance);
			}
		}

		public void OnGetPetInfoReturn(GetUnitAppearanceRes oRes)
		{
			bool flag = oRes.UnitAppearance == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddLog("[XOtherPlayerInfo] unitInfo is null", null, null, null, null, null, XDebugColor.XDebug_None);
			}
			else
			{
				DlgBase<XOtherPlayerInfoView, XOtherPlayerInfoBehaviour>.singleton.RefreshPetInfo(oRes.UnitAppearance);
			}
		}

		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
		}
	}
}