summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XEquipItemDrawer.cs
blob: a7bb6e0db96d9aae78d1536ebc696de6d26c1b98 (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
using System;
using UnityEngine;
using XMainClient.UI;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XEquipItemDrawer : XItemDrawer
	{
		public override void DrawItem(GameObject go, XItem realItem, bool bForceShowNum = false)
		{
			this._GetUI(go);
			bool flag = realItem == null;
			if (flag)
			{
				this.DrawEmpty();
				this._ClearVariables();
			}
			else
			{
				base._GetItemData(realItem.itemID);
				this._SetupIcon();
				this._SetupAttrIcon(realItem);
				this._SetupName(realItem);
				this._SetupNum(realItem);
				this._SetupNumTop(realItem);
				XEquipItem xequipItem = realItem as XEquipItem;
				base._SetupLeftDownCorner(base._GetBindingState(realItem));
				base._SetupLeftUpCorner(xequipItem.forgeAttrInfo.ForgeAttr.Count > 0, "");
				base._SetupRightDownCorner(false);
				base._SetupRightUpCorner(realItem.Type == ItemType.FRAGMENT);
				base._SetUpProf(false);
				base._SetupMask();
				this._ClearVariables();
			}
		}

		protected override void _SetupName(XItem equip)
		{
			bool flag = this.itemdata == null;
			if (flag)
			{
				base._SetNameUI(null, 1);
			}
			else
			{
				XEquipItem xequipItem = equip as XEquipItem;
				string text = XSingleton<UiUtility>.singleton.ChooseProfString(this.itemdata.ItemName, XItemDrawerMgr.Param.Profession);
				bool flag2 = xequipItem.enhanceInfo.EnhanceLevel > 0u;
				if (flag2)
				{
					base._SetNameUI(string.Format("{0}+{1}", text, xequipItem.enhanceInfo.EnhanceLevel), (int)this.itemdata.ItemQuality);
				}
				else
				{
					base._SetNameUI(text, (int)this.itemdata.ItemQuality);
				}
			}
		}

		protected override void _SetupNum(XItem equip)
		{
			XEquipItem xequipItem = equip as XEquipItem;
			bool flag = xequipItem.enhanceInfo.EnhanceLevel > 0u;
			if (flag)
			{
				base._SetNumUI("[cfff0d]+" + xequipItem.enhanceInfo.EnhanceLevel);
			}
			else
			{
				base._SetNumUI(null);
			}
		}

		protected override void _SetupAttrIcon(XItem equip)
		{
			XEquipItem xequipItem = equip as XEquipItem;
			AttrType attrType = xequipItem.attrType;
			if (attrType != AttrType.Physics)
			{
				if (attrType != AttrType.Magic)
				{
					base._SetAttrIcon(null, null);
				}
				else
				{
					base._SetAttrIcon("f_01", "common/Universal");
				}
			}
			else
			{
				base._SetAttrIcon("r_01", "common/Universal");
			}
		}
	}
}