From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/MadDuckSiegeDocument.cs | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/MadDuckSiegeDocument.cs (limited to 'Client/Assets/Scripts/XMainClient/MadDuckSiegeDocument.cs') diff --git a/Client/Assets/Scripts/XMainClient/MadDuckSiegeDocument.cs b/Client/Assets/Scripts/XMainClient/MadDuckSiegeDocument.cs new file mode 100644 index 00000000..775e86cb --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/MadDuckSiegeDocument.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class MadDuckSiegeDocument : XDocComponent + { + public override uint ID + { + get + { + return MadDuckSiegeDocument.uuID; + } + } + + public static MadDuckSiegeDocument Doc + { + get + { + return XSingleton.singleton.Doc.GetXComponent(MadDuckSiegeDocument.uuID) as MadDuckSiegeDocument; + } + } + + public XThemeActivityDocument ActDoc + { + get + { + return XSingleton.singleton.Doc.GetXComponent(XThemeActivityDocument.uuID) as XThemeActivityDocument; + } + } + + public int systemID + { + get + { + return XFastEnumIntEqualityComparer.ToInt(this.sys); + } + } + + public SuperActivityTime.RowData ActInfo + { + get + { + bool flag = this._actInfo != null; + SuperActivityTime.RowData actInfo; + if (flag) + { + actInfo = this._actInfo; + } + else + { + XTempActivityDocument specificDocument = XDocuments.GetSpecificDocument(XTempActivityDocument.uuID); + this._actInfo = specificDocument.GetDataBySystemID((uint)this.systemID); + bool flag2 = this._actInfo == null; + if (flag2) + { + XSingleton.singleton.AddErrorLog("SuperActivityTime SystemID:" + this.systemID + "No Find", null, null, null, null, null); + } + actInfo = this._actInfo; + } + return actInfo; + } + } + + public List ActTask + { + get + { + bool flag = this._ActTask == null; + if (flag) + { + this._ActTask = XTempActivityDocument.Doc.GetDataByActivityType(this.ActInfo.actid); + } + return this._ActTask; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("MadDuckSiegeDocument"); + + public uint sceneID = uint.Parse(XSingleton.singleton.GetValue("MadDuckSceneID")); + + public XSysDefine sys = XSysDefine.XSys_ThemeActivity_MadDuck; + + private SuperActivityTime.RowData _actInfo = null; + + public string[] cost = XSingleton.singleton.GetValue("DuckTickets").Split(new char[] + { + '=' + }); + + private List _ActTask = null; + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_ActivityTaskUpdate, new XComponent.XEventHandler(this.OnTaskChange)); + } + + private bool OnTaskChange(XEventArgs e) + { + XActivityTaskUpdatedArgs xactivityTaskUpdatedArgs = e as XActivityTaskUpdatedArgs; + bool flag = xactivityTaskUpdatedArgs.xActID == this.ActInfo.actid; + if (flag) + { + bool flag2 = DlgBase.singleton.m_MadDuckHandler != null && DlgBase.singleton.m_MadDuckHandler.m_ActivityExchangeRewardHandler != null && DlgBase.singleton.m_MadDuckHandler.m_ActivityExchangeRewardHandler.IsVisible(); + if (flag2) + { + DlgBase.singleton.m_MadDuckHandler.m_ActivityExchangeRewardHandler.RefreshList(false); + } + } + return true; + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public bool GetRedPoint() + { + ulong itemCount = XBagDocument.BagDoc.GetItemCount(int.Parse(this.cost[0])); + return itemCount >= ulong.Parse(this.cost[1]); + } + } +} -- cgit v1.1-26-g67d0