From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/XBackFlowLevelUpHandler.cs | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XBackFlowLevelUpHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/XBackFlowLevelUpHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/XBackFlowLevelUpHandler.cs b/Client/Assets/Scripts/XMainClient/XBackFlowLevelUpHandler.cs new file mode 100644 index 00000000..265fb482 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XBackFlowLevelUpHandler.cs @@ -0,0 +1,72 @@ +using System; +using UILib; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XBackFlowLevelUpHandler : DlgHandlerBase + { + protected override string FileName + { + get + { + return "Hall/BfLevelUpHandler"; + } + } + + private IXUIButton _gotoBtn = null; + + private IXUILabel _levelUpLabel = null; + + protected override void Init() + { + base.Init(); + this._gotoBtn = (base.transform.Find("BtnGo").GetComponent("XUIButton") as IXUIButton); + this._gotoBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGotoLevelUp)); + this._levelUpLabel = (base.transform.Find("Label").GetComponent("XUILabel") as IXUILabel); + } + + private bool OnGotoLevelUp(IXUIButton button) + { + XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + for (int i = 0; i < specificDocument.TaskRecord.Tasks.Count; i++) + { + XTaskInfo xtaskInfo = specificDocument.TaskRecord.Tasks[i]; + TaskTableNew.RowData tableData = xtaskInfo.TableData; + bool flag = tableData.TaskType == 8u; + if (flag) + { + uint id = XSingleton.singleton.ChooseProfData(tableData.BeginTaskNPCID, 0u); + XSingleton.singleton.LastNpc = XSingleton.singleton.GetNpc(id); + DlgBase.singleton.SetVisible(false, true); + break; + } + } + return true; + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnShow() + { + base.OnShow(); + string @string = XStringDefineProxy.GetString("LevelUpDegreeGift"); + this._levelUpLabel.SetText(string.Format(@string, XBackFlowDocument.Doc.GetLevelUpDegree())); + } + + protected override void OnHide() + { + base.OnHide(); + } + + public override void OnUnload() + { + base.OnUnload(); + } + } +} -- cgit v1.1-26-g67d0