diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/UI/PPTCheckMgr.cs | 62 |
1 files changed, 62 insertions, 0 deletions
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<PPTCheckMgr>
+ {
+ private ButtonClickEventHandler mGoStillHandler;
+
+ public bool CheckMyPPT(int needPPT)
+ {
+ XMainInterfaceDocument xmainInterfaceDocument = XSingleton<XGame>.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<ModalDlg, ModalDlgBehaviour>.singleton.Load();
+ DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetSingleButtonMode(false);
+ DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetVisible(false, true);
+ DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetLabelsWithSymbols(XStringDefineProxy.GetString("LEVEL_POWERLOWER"), XStringDefineProxy.GetString("LEVEL_POWERUP"), XStringDefineProxy.GetString("LEVEL_CONTINUE"));
+ DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.uiBehaviour.m_CancelButton.ID = btnID;
+ DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetModalCallback(new ButtonClickEventHandler(this.GoPowerUp), new ButtonClickEventHandler(this.GoStill));
+ DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetTweenTargetAndPlay(DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.uiBehaviour.gameObject);
+ }
+
+ private bool GoStill(IXUIButton go)
+ {
+ DlgBase<ModalDlg, ModalDlgBehaviour>.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<ModalDlg, ModalDlgBehaviour>.singleton.SetVisible(false, true);
+ bool flag = !XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_Strong);
+ bool result;
+ if (flag)
+ {
+ XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("StrengthNotOpen"), "fece00");
+ result = true;
+ }
+ else
+ {
+ XSingleton<UIManager>.singleton.ClearUIinStack();
+ XSingleton<XGameSysMgr>.singleton.OpenSystem(XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_Strong));
+ result = true;
+ }
+ return result;
+ }
+ }
+}
|