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(); } } }