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/XCommonHelpTipView.cs | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/XCommonHelpTipView.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/XCommonHelpTipView.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/XCommonHelpTipView.cs b/Client/Assets/Scripts/XMainClient/UI/XCommonHelpTipView.cs new file mode 100644 index 00000000..6cf1bd9f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XCommonHelpTipView.cs @@ -0,0 +1,126 @@ +using System; +using UILib; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class XCommonHelpTipView : DlgBase + { + public override bool autoload + { + get + { + return true; + } + } + + public override string fileName + { + get + { + return "Common/CommonHelpTip"; + } + } + + private SystemHelpTable _systemHelpReader = null; + + private string m_title; + + private string m_content; + + public void ShowHelp(string title, string content) + { + this.m_title = title; + this.m_content = XSingleton.singleton.ReplaceReturn(content); + bool flag = !base.IsVisible(); + if (flag) + { + this.SetVisibleWithAnimation(true, null); + } + } + + public void ShowHelp(int sysID) + { + bool flag = this._systemHelpReader == null; + if (flag) + { + this._systemHelpReader = new SystemHelpTable(); + XSingleton.singleton.ReadFile("Table/SystemHelp", this._systemHelpReader); + } + SystemHelpTable.RowData bySystemID = this._systemHelpReader.GetBySystemID(sysID); + bool flag2 = bySystemID != null; + if (flag2) + { + bool flag3 = bySystemID.SystemHelp != null && bySystemID.SystemHelp.Length != 0; + if (flag3) + { + this.m_title = bySystemID.SystemHelp[0]; + } + bool flag4 = bySystemID.SystemHelp != null && bySystemID.SystemHelp.Length > 1; + if (flag4) + { + this.m_content = XSingleton.singleton.ReplaceReturn(bySystemID.SystemHelp[1]); + } + } + bool flag5 = !base.IsVisible(); + if (flag5) + { + this.SetVisibleWithAnimation(true, null); + } + } + + public void ShowHelp(XSysDefine sys) + { + this.m_title = ""; + this.m_content = ""; + bool flag = this._systemHelpReader == null; + if (flag) + { + this._systemHelpReader = new SystemHelpTable(); + XSingleton.singleton.ReadFile("Table/SystemHelp", this._systemHelpReader); + } + int key = XFastEnumIntEqualityComparer.ToInt(sys); + SystemHelpTable.RowData bySystemID = this._systemHelpReader.GetBySystemID(key); + bool flag2 = bySystemID != null; + if (flag2) + { + bool flag3 = bySystemID.SystemHelp != null && bySystemID.SystemHelp.Length != 0; + if (flag3) + { + this.m_title = bySystemID.SystemHelp[0]; + } + bool flag4 = bySystemID.SystemHelp != null && bySystemID.SystemHelp.Length > 1; + if (flag4) + { + this.m_content = XSingleton.singleton.ReplaceReturn(bySystemID.SystemHelp[1]); + } + } + bool flag5 = !base.IsVisible(); + if (flag5) + { + this.SetVisibleWithAnimation(true, null); + } + } + + protected override void OnShow() + { + base.OnShow(); + base.uiBehaviour.m_Title.SetText(this.m_title); + base.uiBehaviour.m_Content.SetText(this.m_content); + base.uiBehaviour.m_ScrollView.ResetPosition(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseBtnClicked)); + } + + private bool OnCloseBtnClicked(IXUIButton btn) + { + this.SetVisibleWithAnimation(false, null); + return false; + } + } +} -- cgit v1.1-26-g67d0