From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XYorozuyaDocument.cs | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XYorozuyaDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/XYorozuyaDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/XYorozuyaDocument.cs b/Client/Assets/Scripts/XMainClient/XYorozuyaDocument.cs new file mode 100644 index 00000000..c65d78be --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XYorozuyaDocument.cs @@ -0,0 +1,107 @@ +using System; +using System.Reflection; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XYorozuyaDocument : XDocComponent + { + public override uint ID + { + get + { + return XYorozuyaDocument.uuID; + } + } + + public byte SelectID { get; set; } + + public static XYorozuyaDocument Doc + { + get + { + return XSingleton.singleton.Doc.GetXComponent(XYorozuyaDocument.uuID) as XYorozuyaDocument; + } + } + + public YorozuyaTable YorozuyaTab + { + get + { + return XYorozuyaDocument.m_yorozuyaTab; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XYorozuyaDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static YorozuyaTable m_yorozuyaTab = new YorozuyaTable(); + + public static void Execute(OnLoadedCallback callback = null) + { + XYorozuyaDocument.AsyncLoader.AddTask("Table/Yorozuya", XYorozuyaDocument.m_yorozuyaTab, false); + XYorozuyaDocument.AsyncLoader.Execute(callback); + } + + public static void OnTableLoaded() + { + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + public override void OnDetachFromHost() + { + base.OnDetachFromHost(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + } + + public void ReqEnterScene(int id) + { + RpcC2G_EnterLeisureScene rpcC2G_EnterLeisureScene = new RpcC2G_EnterLeisureScene(); + rpcC2G_EnterLeisureScene.oArg.index = id; + XSingleton.singleton.Send(rpcC2G_EnterLeisureScene); + } + + public YorozuyaTable.RowData GetRowData(byte id) + { + return XYorozuyaDocument.m_yorozuyaTab.GetByID(id); + } + + public void OnReqBack(EnterLeisureSceneRes oRes) + { + bool flag = oRes.errorcode == ErrorCode.ERR_INVALID_REQUEST; + if (flag) + { + string fullName = MethodBase.GetCurrentMethod().ReflectedType.FullName; + XSingleton.singleton.OnGetInvalidRequest(fullName); + } + else + { + bool flag2 = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + } + } + } +} -- cgit v1.1-26-g67d0