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

namespace XMainClient
{
	internal class ShowAttriData
	{
		public uint TypeID
		{
			get
			{
				return this._typeId;
			}
		}

		public string NeedLevelStr
		{
			get
			{
				return string.Format("[{0}]{1}[-] Lv{2}", XSingleton<UiUtility>.singleton.GetItemQualityColorStr((int)this._data.ItemQuality), XSingleton<UiUtility>.singleton.ChooseProfString(this._data.ItemName, (uint)this._data.Profession), this._needLevel);
			}
		}

		public bool IsPercentRange
		{
			get
			{
				return XAttributeCommon.IsPercentRange((int)this._nameId);
			}
		}

		public uint NameId
		{
			get
			{
				return this._nameId;
			}
		}

		public string Name
		{
			get
			{
				return XAttributeCommon.GetAttrStr((int)this._nameId);
			}
		}

		public string NumStr
		{
			get
			{
				bool flag = XAttributeCommon.IsPercentRange((int)this._nameId);
				string result;
				if (flag)
				{
					result = string.Format((this._num >= 0u) ? "+{0}%" : "{0}%", this._num.ToString("0.#"));
				}
				else
				{
					result = string.Format((this._num >= 0u) ? "+{0}" : "{0}", this._num).ToString();
				}
				return result;
			}
		}

		public string SkillDes
		{
			get
			{
				return XEmblemDocument.GetEmblemSkillAttrString(this._itemId);
			}
		}

		private uint _itemId;

		private uint _nameId;

		private uint _num;

		private uint _needLevel;

		private uint _typeId = 1u;

		private ItemList.RowData _data;

		public ShowAttriData(uint itemId, XItemChangeAttr attr)
		{
			this._itemId = itemId;
			this._nameId = attr.AttrID;
			this._num = attr.AttrValue;
			bool isPercentRange = this.IsPercentRange;
			if (isPercentRange)
			{
				this._typeId = 2u;
			}
			else
			{
				this._typeId = 1u;
			}
			this._data = XBagDocument.GetItemConf((int)itemId);
			bool flag = this._data != null;
			if (flag)
			{
				this._needLevel = (uint)this._data.ReqLevel;
			}
		}

		public ShowAttriData(EmblemBasic.RowData data)
		{
			this._itemId = data.EmblemID;
			this._typeId = 3u;
			this._data = XBagDocument.GetItemConf((int)data.EmblemID);
			bool flag = this._data != null;
			if (flag)
			{
				this._needLevel = (uint)this._data.ReqLevel;
			}
		}

		public void Add(uint num)
		{
			this._num += num;
		}
	}
}