From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/Team/XTeamBonusHandler.cs | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Team/XTeamBonusHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/Team/XTeamBonusHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/Team/XTeamBonusHandler.cs b/Client/Assets/Scripts/XMainClient/Team/XTeamBonusHandler.cs new file mode 100644 index 00000000..40755590 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Team/XTeamBonusHandler.cs @@ -0,0 +1,106 @@ +using System; +using UILib; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XTeamBonusHandler : DlgHandlerBase + { + private XUIPool m_AttrPool = new XUIPool(XSingleton.singleton.m_uiTool); + + private XTeamDocument _TeamDoc; + + private IXUIButton m_Root; + + private GameObject m_TitleActive; + + private GameObject m_TitleDisactive; + + private GameObject m_AttrActive; + + private GameObject m_AttrDisactive; + + protected override void Init() + { + base.Init(); + this.m_Root = (base.PanelObject.GetComponent("XUIButton") as IXUIButton); + this.m_TitleActive = base.PanelObject.transform.Find("TitleActive").gameObject; + this.m_TitleDisactive = base.PanelObject.transform.Find("TitleDisactive").gameObject; + Transform transform = base.PanelObject.transform.Find("AttrActive"); + Transform transform2 = base.PanelObject.transform.Find("AttrDisactive"); + this.m_AttrActive = transform.gameObject; + this.m_AttrDisactive = transform2.gameObject; + this._TeamDoc = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + string[] array = XSingleton.singleton.GetValue("TeamGuildBuff").Split(XGlobalConfig.SequenceSeparator); + int num = int.Parse(array[0]); + int num2 = int.Parse(array[1]); + BuffTable.RowData buffData = XSingleton.singleton.GetBuffData(num, num2); + bool flag = buffData == null; + if (flag) + { + XSingleton.singleton.AddErrorLog(string.Format("TeamGuildBuff: Buff data not found: [{0} {1}]", num, num2), null, null, null, null, null); + } + else + { + IXUILabel ixuilabel = transform.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel2 = transform.Find("Value").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = transform2.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel4 = transform2.Find("Value").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(buffData.BuffName); + ixuilabel2.SetText(string.Empty); + ixuilabel3.SetText(buffData.BuffName); + ixuilabel4.SetText(string.Empty); + } + } + + public void Refresh() + { + bool flag = !this._TeamDoc.bInTeam; + if (flag) + { + this._Enable(false); + } + else + { + XTeamMember myData = this._TeamDoc.MyTeam.myData; + bool flag2 = myData == null || myData.guildID == 0UL; + if (flag2) + { + this._Enable(false); + } + else + { + bool flag3 = false; + for (int i = 0; i < this._TeamDoc.MyTeam.members.Count; i++) + { + XTeamMember xteamMember = this._TeamDoc.MyTeam.members[i]; + bool flag4 = xteamMember != myData && xteamMember.guildID == myData.guildID; + if (flag4) + { + flag3 = true; + break; + } + } + bool flag5 = !flag3; + if (flag5) + { + this._Enable(false); + } + else + { + this._Enable(true); + } + } + } + } + + private void _Enable(bool bEnable) + { + this.m_TitleActive.SetActive(bEnable); + this.m_TitleDisactive.SetActive(!bEnable); + this.m_AttrActive.SetActive(bEnable); + this.m_AttrDisactive.SetActive(!bEnable); + } + } +} -- cgit v1.1-26-g67d0