summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XRollDocument.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/XRollDocument.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XRollDocument.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/XRollDocument.cs95
1 files changed, 95 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/XRollDocument.cs b/Client/Assets/Scripts/XMainClient/XRollDocument.cs
new file mode 100644
index 00000000..36032d2a
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/XRollDocument.cs
@@ -0,0 +1,95 @@
+using System;
+using KKSG;
+using UnityEngine;
+using XMainClient.UI.UICommon;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class XRollDocument : XDocComponent
+ {
+ public override uint ID
+ {
+ get
+ {
+ return XRollDocument.uuID;
+ }
+ }
+
+ public uint RollItemID
+ {
+ get
+ {
+ bool flag = this._current_roll_info == null;
+ uint result;
+ if (flag)
+ {
+ result = 0u;
+ }
+ else
+ {
+ result = this._current_roll_info.id;
+ }
+ return result;
+ }
+ }
+
+ public uint RollItemCount
+ {
+ get
+ {
+ bool flag = this._current_roll_info == null;
+ uint result;
+ if (flag)
+ {
+ result = 0u;
+ }
+ else
+ {
+ result = this._current_roll_info.count;
+ }
+ return result;
+ }
+ }
+
+ public float LastRollTime
+ {
+ get
+ {
+ return this._last_roll_time;
+ }
+ }
+
+ public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("RollDocument");
+
+ private EnemyDoodadInfo _current_roll_info;
+
+ public int ClientRollTime = 0;
+
+ private float _last_roll_time = 0f;
+
+ public void SendRollReq(int type)
+ {
+ RpcC2G_ChooseRollReq rpcC2G_ChooseRollReq = new RpcC2G_ChooseRollReq();
+ rpcC2G_ChooseRollReq.oArg.info = this._current_roll_info;
+ rpcC2G_ChooseRollReq.oArg.chooseType = type;
+ XSingleton<XClientNetwork>.singleton.Send(rpcC2G_ChooseRollReq);
+ }
+
+ public void SetRollItem(EnemyDoodadInfo info)
+ {
+ bool flag = this.ClientRollTime == 0;
+ if (flag)
+ {
+ this.ClientRollTime = XSingleton<XGlobalConfig>.singleton.GetInt("ClientRollTime");
+ }
+ this._last_roll_time = Time.time;
+ this._current_roll_info = info;
+ DlgBase<RollDlg, RollDlgBehaviour>.singleton.ShowRollInfo();
+ }
+
+ protected override void OnReconnected(XReconnectedEventArgs arg)
+ {
+ }
+ }
+}