diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/UI/XDramaOperate.cs | 51 |
1 files changed, 51 insertions, 0 deletions
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>(XDramaDocument.uuID);
+ }
+
+ protected void _FireEvent(XDramaOperateParam param)
+ {
+ DlgBase<DramaDlg, DramaDlgBehaviour>.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<XCommon>.singleton.RandomInt(content.Length)];
+ }
+ else
+ {
+ result = string.Empty;
+ }
+ }
+ return result;
+ }
+
+ public virtual void ShowNpc(XNpc npc)
+ {
+ DlgBase<DramaDlg, DramaDlgBehaviour>.singleton.SetVisible(true, true);
+ }
+ }
+}
|