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/UI/SystemHelpDlg.cs | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/SystemHelpDlg.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/SystemHelpDlg.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/SystemHelpDlg.cs b/Client/Assets/Scripts/XMainClient/UI/SystemHelpDlg.cs new file mode 100644 index 00000000..97d38a0c --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/SystemHelpDlg.cs @@ -0,0 +1,95 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + public class SystemHelpDlg : DlgBase, IModalDlg, IXInterface + { + public override string fileName + { + get + { + return "Common/SystemHelpDlg"; + } + } + + public override int layer + { + get + { + return 100; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public bool Deprecated { get; set; } + + public bool _bHasGrey = true; + + protected override void OnShow() + { + base.OnShow(); + } + + public void SetPanelDepth(int depth) + { + base.uiBehaviour.m_Panel.SetDepth(depth); + } + + public void LuaShow(string content, ButtonClickEventHandler handler, ButtonClickEventHandler handler2) + { + this.SetVisible(true, true); + this.SetLabelsWithSymbols(content, "OK", "Cancel"); + base.uiBehaviour.m_OKButton.RegisterClickEventHandler(handler); + } + + public void SetLabels(string mainLabel, string titleLabel, string frLabel) + { + base.uiBehaviour.m_LabelSymbol.InputText = ""; + base.uiBehaviour.m_TitleSymbol.InputText = ""; + base.uiBehaviour.m_Label.SetText(mainLabel); + base.uiBehaviour.m_Title.SetText(titleLabel); + base.uiBehaviour.m_OKButton.SetCaption(frLabel); + } + + public void SetLabelsWithSymbols(string mainLabel, string titleLabel, string frLabel) + { + base.uiBehaviour.m_LabelSymbol.InputText = mainLabel; + base.uiBehaviour.m_TitleSymbol.InputText = titleLabel; + base.uiBehaviour.m_OKButton.SetCaption(frLabel); + } + + public void SetTweenTargetAndPlay(GameObject go) + { + this.SetVisible(true, true); + base.uiBehaviour.m_PlayTween.SetTargetGameObject(go); + base.uiBehaviour.m_PlayTween.PlayTween(true, -1f); + } + + public override void RegisterEvent() + { + base.uiBehaviour.m_OKButton.RegisterClickEventHandler(new ButtonClickEventHandler(this.DoCancel)); + } + + public bool DoCancel(IXUIButton go) + { + this.SetVisible(false, true); + return true; + } + + public void DoCancel(IXUISprite sp) + { + this.SetVisible(false, true); + } + } +} -- cgit v1.1-26-g67d0