From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/ShowAttriData.cs | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/ShowAttriData.cs (limited to 'Client/Assets/Scripts/XMainClient/ShowAttriData.cs') 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.singleton.GetItemQualityColorStr((int)this._data.ItemQuality), XSingleton.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; + } + } +} -- cgit v1.1-26-g67d0