From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Team/XTeamCreateTeamWindow.cs | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Team/XTeamCreateTeamWindow.cs (limited to 'Client/Assets/Scripts/XMainClient/Team/XTeamCreateTeamWindow.cs') diff --git a/Client/Assets/Scripts/XMainClient/Team/XTeamCreateTeamWindow.cs b/Client/Assets/Scripts/XMainClient/Team/XTeamCreateTeamWindow.cs new file mode 100644 index 00000000..20958dae --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Team/XTeamCreateTeamWindow.cs @@ -0,0 +1,62 @@ +using System; +using KKSG; +using UILib; +using UnityEngine; + +namespace XMainClient +{ + internal class XTeamCreateTeamWindow + { + private GameObject PanelObject; + + private XTeamDocument _doc; + + private IXUIInput m_Input; + + private IXUILabel m_Title; + + public XTeamCreateTeamWindow(GameObject panelGo) + { + this.PanelObject = panelGo; + this.m_Input = (this.PanelObject.transform.Find("CreateMenu/PwdInput").GetComponent("XUIInput") as IXUIInput); + this.m_Title = (this.PanelObject.transform.Find("CreateMenu/Dungeon").GetComponent("XUILabel") as IXUILabel); + this._doc = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + this.RegisterEvent(); + } + + public void RegisterEvent() + { + IXUIButton ixuibutton = this.PanelObject.transform.Find("CreateMenu/OK").GetComponent("XUIButton") as IXUIButton; + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnOKBtnClicked)); + IXUIButton ixuibutton2 = this.PanelObject.transform.Find("CreateMenu/Cancel").GetComponent("XUIButton") as IXUIButton; + ixuibutton2.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnCancelBtnClicked)); + } + + public void Show() + { + this.PanelObject.SetActive(true); + this.m_Input.SetText(""); + this.m_Title.SetText(this._doc.currentDungeonName); + } + + public void Hide() + { + this.PanelObject.SetActive(false); + } + + private bool _OnOKBtnClicked(IXUIButton btn) + { + string text = this.m_Input.GetText(); + this._doc.password = text; + this._doc.ReqTeamOp(TeamOperate.TEAM_CREATE, 0UL, null, TeamMemberType.TMT_NORMAL, null); + this.Hide(); + return true; + } + + private bool _OnCancelBtnClicked(IXUIButton btn) + { + this.Hide(); + return true; + } + } +} -- cgit v1.1-26-g67d0