From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/XGoldGroupData.cs | 156 +++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XGoldGroupData.cs (limited to 'Client/Assets/Scripts/XMainClient/XGoldGroupData.cs') diff --git a/Client/Assets/Scripts/XMainClient/XGoldGroupData.cs b/Client/Assets/Scripts/XMainClient/XGoldGroupData.cs new file mode 100644 index 00000000..158e9cda --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XGoldGroupData.cs @@ -0,0 +1,156 @@ +using System; +using KKSG; +using UILib; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal struct XGoldGroupData + { + public bool bActive + { + get + { + return this.index >= 0; + } + set + { + bool flag = !value; + if (flag) + { + this.index = -1; + this.type = GoldGroupType.GGT_NONE; + } + } + } + + public GoldGroupType type; + + public int index; + + public int itemid; + + public int itemcount; + + public XTeamBriefData teamBrief; + + public static string GetName(ref SeqListRef data, int index) + { + bool flag = index < 0 || index >= data.Count; + string result; + if (flag) + { + result = string.Empty; + } + else + { + int num = (int)data[index, 0]; + int num2 = (int)data[index, 1]; + GoldGroupType goldGroupType = (GoldGroupType)num; + if (goldGroupType != GoldGroupType.GGT_DIAMOND) + { + if (goldGroupType != GoldGroupType.GGT_TICKET) + { + result = string.Empty; + } + else + { + result = XStringDefineProxy.GetString(XSingleton.singleton.StringCombine("TeamGoldGroupName2_", num2.ToString())); + } + } + else + { + result = XStringDefineProxy.GetString(XSingleton.singleton.StringCombine("TeamGoldGroupName1_", num2.ToString()), new object[] + { + data[index, 2].ToString() + }); + } + } + return result; + } + + public void SetData(TeamExtraInfo extraInfo, ExpeditionTable.RowData rowData) + { + bool flag = extraInfo == null || rowData == null || !extraInfo.costindexSpecified; + if (flag) + { + this.bActive = false; + } + else + { + int costindex = (int)extraInfo.costindex; + bool flag2 = costindex < 0 || costindex >= rowData.CostType.Count; + if (flag2) + { + this.bActive = false; + } + else + { + this.index = costindex; + this.type = (GoldGroupType)rowData.CostType[this.index, 0]; + this.itemid = (int)rowData.CostType[this.index, 1]; + this.itemcount = (int)rowData.CostType[this.index, 2]; + } + } + } + + public void SetUI(GameObject go, bool bShowFinalRewardIcon = true) + { + bool flag = !this.bActive; + if (flag) + { + go.SetActive(false); + } + else + { + go.SetActive(true); + IXUILabel ixuilabel = go.transform.Find("Label").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = go.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + bool flag2 = bShowFinalRewardIcon && this.type == GoldGroupType.GGT_TICKET; + if (flag2) + { + ixuisprite.SetSprite(XBagDocument.GetItemSmallIcon(XFastEnumIntEqualityComparer.ToInt(ItemEnum.DRAGON_COIN), 0u)); + } + else + { + ixuisprite.SetSprite(XBagDocument.GetItemSmallIcon(this.itemid, 0u)); + } + bool flag3 = this.type == GoldGroupType.GGT_TICKET; + if (flag3) + { + ixuilabel.SetText(XStringDefineProxy.GetString("GGT_TICKET")); + } + else + { + ixuilabel.SetText(this.itemcount.ToString()); + } + Transform transform = go.transform.Find("Description"); + bool flag4 = transform != null; + if (flag4) + { + IXUILabel ixuilabel2 = transform.GetComponent("XUILabel") as IXUILabel; + GoldGroupType goldGroupType = this.type; + if (goldGroupType != GoldGroupType.GGT_DIAMOND) + { + if (goldGroupType != GoldGroupType.GGT_TICKET) + { + ixuilabel2.SetText(string.Empty); + } + else + { + ixuilabel2.SetText(XStringDefineProxy.GetString(XSingleton.singleton.StringCombine("TeamGoldGroupDescription2_", this.itemid.ToString()))); + } + } + else + { + ixuilabel2.SetText(XStringDefineProxy.GetString(XSingleton.singleton.StringCombine("TeamGoldGroupDescription1_", this.itemid.ToString()), new object[] + { + (this.teamBrief == null || this.teamBrief.totalMemberCount <= 1) ? this.itemcount : (this.itemcount / (this.teamBrief.totalMemberCount - 1)) + })); + } + } + } + } + } +} -- cgit v1.1-26-g67d0