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/XDramaOperate.cs | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs b/Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs new file mode 100644 index 00000000..37d15a8a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs @@ -0,0 +1,51 @@ +using System; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class XDramaOperate + { + protected XDramaDocument dramaDoc; + + public XDramaOperate() + { + this.dramaDoc = XDocuments.GetSpecificDocument(XDramaDocument.uuID); + } + + protected void _FireEvent(XDramaOperateParam param) + { + DlgBase.singleton.SetupOperate(param); + param.Recycle(); + } + + protected string _GetRandomNpcText(XNpc npc) + { + bool flag = npc == null; + string result; + if (flag) + { + result = null; + } + else + { + string[] content = (npc.Attributes as XNpcAttributes).Content; + bool flag2 = content != null && content.Length != 0; + if (flag2) + { + result = content[XSingleton.singleton.RandomInt(content.Length)]; + } + else + { + result = string.Empty; + } + } + return result; + } + + public virtual void ShowNpc(XNpc npc) + { + DlgBase.singleton.SetVisible(true, true); + } + } +} -- cgit v1.1-26-g67d0