From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/UI/GuildInheritDlg.cs | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/GuildInheritDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/GuildInheritDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/GuildInheritDlg.cs b/Client/Assets/Scripts/XMainClient/UI/GuildInheritDlg.cs new file mode 100644 index 00000000..5eec78fd --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/GuildInheritDlg.cs @@ -0,0 +1,114 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient.UI +{ + internal class GuildInheritDlg : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildInheritDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + private XGuildInheritDocument _Doc; + + protected override void Init() + { + base.Init(); + this._Doc = XDocuments.GetSpecificDocument(XGuildInheritDocument.uuID); + base.uiBehaviour.WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnItemUpdateHandler)); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.OverLook.RegisterClickEventHandler(new ButtonClickEventHandler(this.CloseClick)); + base.uiBehaviour.Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.CloseClick)); + base.uiBehaviour.NotAccept.RegisterClickEventHandler(new ButtonClickEventHandler(this.OverLookClick)); + } + + protected override void OnShow() + { + base.OnShow(); + this._Doc.SendInheritList(); + } + + public void RefreshData() + { + base.uiBehaviour.WrapContent.SetContentCount(this._Doc.InheritList.Count, false); + base.uiBehaviour.ScrollView.ResetPosition(); + } + + private bool OverLookClick(IXUIButton btn) + { + this._Doc.SendDelInherit(); + this.SetVisibleWithAnimation(false, null); + return false; + } + + private bool CloseClick(IXUIButton btn) + { + this.SetVisibleWithAnimation(false, null); + return false; + } + + private void OnItemUpdateHandler(Transform t, int index) + { + bool flag = index >= this._Doc.InheritList.Count; + if (!flag) + { + IXUILabelSymbol ixuilabelSymbol = t.Find("Name").GetComponent("XUILabelSymbol") as IXUILabelSymbol; + IXUILabel ixuilabel = t.Find("Level").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel2 = t.Find("Position").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = t.Find("LastLoginTime").GetComponent("XUILabel") as IXUILabel; + IXUIButton ixuibutton = t.Find("BtnReceive").GetComponent("XUIButton") as IXUIButton; + GuildInheritInfo guildInheritInfo = this._Doc.InheritList[index]; + ixuibutton.ID = (ulong)((long)index); + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickReceive)); + ixuilabel.SetText(guildInheritInfo.GetLevelString()); + ixuilabel2.SetText(guildInheritInfo.GetSceneName()); + ixuilabel3.SetText(guildInheritInfo.GetTimeString()); + ixuilabelSymbol.InputText = guildInheritInfo.name; + } + } + + private bool OnClickReceive(IXUIButton btn) + { + bool flag = btn.ID >= 0UL; + if (flag) + { + this._Doc.SendAccpetInherit((int)btn.ID); + } + return true; + } + } +} -- cgit v1.1-26-g67d0