using System; using UILib; using XMainClient.UI.UICommon; using XUtliPoolLib; namespace XMainClient.UI { internal class PPTCheckMgr : XSingleton { private ButtonClickEventHandler mGoStillHandler; public bool CheckMyPPT(int needPPT) { XMainInterfaceDocument xmainInterfaceDocument = XSingleton.singleton.Doc.GetXComponent(XMainInterfaceDocument.uuID) as XMainInterfaceDocument; int playerPPT = xmainInterfaceDocument.GetPlayerPPT(); return playerPPT >= needPPT; } public void ShowPPTNotEnoughDlg(ulong btnID, ButtonClickEventHandler goBattleHandle) { this.mGoStillHandler = goBattleHandle; DlgBase.singleton.Load(); DlgBase.singleton.SetSingleButtonMode(false); DlgBase.singleton.SetVisible(false, true); DlgBase.singleton.SetLabelsWithSymbols(XStringDefineProxy.GetString("LEVEL_POWERLOWER"), XStringDefineProxy.GetString("LEVEL_POWERUP"), XStringDefineProxy.GetString("LEVEL_CONTINUE")); DlgBase.singleton.uiBehaviour.m_CancelButton.ID = btnID; DlgBase.singleton.SetModalCallback(new ButtonClickEventHandler(this.GoPowerUp), new ButtonClickEventHandler(this.GoStill)); DlgBase.singleton.SetTweenTargetAndPlay(DlgBase.singleton.uiBehaviour.gameObject); } private bool GoStill(IXUIButton go) { DlgBase.singleton.SetVisible(false, true); bool flag = this.mGoStillHandler != null; if (flag) { this.mGoStillHandler(go); } this.mGoStillHandler = null; return true; } private bool GoPowerUp(IXUIButton go) { DlgBase.singleton.SetVisible(false, true); bool flag = !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Strong); bool result; if (flag) { XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("StrengthNotOpen"), "fece00"); result = true; } else { XSingleton.singleton.ClearUIinStack(); XSingleton.singleton.OpenSystem(XFastEnumIntEqualityComparer.ToInt(XSysDefine.XSys_Strong)); result = true; } return result; } } }