From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs b/Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs new file mode 100644 index 00000000..71822a51 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs @@ -0,0 +1,62 @@ +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; + } + } +} -- cgit v1.1-26-g67d0