summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/ShowAttriData.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/ShowAttriData.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/ShowAttriData.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/ShowAttriData.cs126
1 files changed, 126 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/ShowAttriData.cs b/Client/Assets/Scripts/XMainClient/ShowAttriData.cs
new file mode 100644
index 00000000..a6fef367
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/ShowAttriData.cs
@@ -0,0 +1,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;
+ }
+ }
+}