From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../UI/XWelfareKingdomPrivilegeRenewView.cs | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/XWelfareKingdomPrivilegeRenewView.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/XWelfareKingdomPrivilegeRenewView.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/XWelfareKingdomPrivilegeRenewView.cs b/Client/Assets/Scripts/XMainClient/UI/XWelfareKingdomPrivilegeRenewView.cs new file mode 100644 index 00000000..e5a23e84 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XWelfareKingdomPrivilegeRenewView.cs @@ -0,0 +1,102 @@ +using System; +using KKSG; +using UILib; +using XMainClient.UI.UICommon; +using XUpdater; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class XWelfareKingdomPrivilegeRenewView : DlgBase + { + public override bool autoload + { + get + { + return true; + } + } + + public override string fileName + { + get + { + return "GameSystem/Welfare/KingdomPrivilegeRenew"; + } + } + + private PayMemberTable.RowData payInfo; + + public void Show(PayMemberTable.RowData info, bool suc = false, int leftTime = 0) + { + bool flag = !base.IsVisible(); + if (flag) + { + this.SetVisibleWithAnimation(true, null); + } + this.payInfo = info; + base.uiBehaviour.m_Title.SetText(suc ? XSingleton.singleton.GetString("PAY_KINGDOM_RENEW_TITLE") : XSingleton.singleton.GetString("PAY_KINGDOM_BUY_AGAIN")); + base.uiBehaviour.m_Name.SetText(info.Name); + base.uiBehaviour.m_Icon.SetTexturePath(info.Icon); + base.uiBehaviour.m_Time.SetVisible(!suc); + base.uiBehaviour.m_Time.SetText(string.Format("{0}{1}", info.Days, XSingleton.singleton.GetString("DAY_DUARATION"))); + float num = (float)info.Price / 100f; + base.uiBehaviour.m_Price.SetText(XStringDefineProxy.GetString("PAY_UNIT", new object[] + { + num + })); + base.uiBehaviour.m_Price.SetVisible(!suc); + base.uiBehaviour.m_RenewSucTip.SetVisible(suc); + base.uiBehaviour.m_Buy.SetVisible(!suc); + if (suc) + { + int days = info.Days; + int num2 = leftTime / 86400; + base.uiBehaviour.m_RenewSucTip.SetText(XStringDefineProxy.GetString("PAY_KINGDOM_RENEW", new object[] + { + days, + num2 + })); + } + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseBtnClicked)); + base.uiBehaviour.m_Buy.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnBuyBtnClicked)); + } + + protected override void OnHide() + { + base.OnHide(); + base.uiBehaviour.m_Icon.SetTexturePath(""); + } + + private bool OnCloseBtnClicked(IXUIButton btn) + { + this.SetVisibleWithAnimation(false, null); + return false; + } + + private bool OnBuyBtnClicked(IXUIButton btn) + { + XRechargeDocument specificDocument = XDocuments.GetSpecificDocument(XRechargeDocument.uuID); + bool flag = XSingleton.singleton.XPlatform.Platfrom() == XPlatformType.Android; + if (flag) + { + specificDocument.SDKSubscribe(this.payInfo.Price, 1, this.payInfo.ServiceCode, this.payInfo.Name, this.payInfo.ParamID, PayParamType.PAY_PARAM_MEMBER); + } + else + { + bool flag2 = XSingleton.singleton.XPlatform.Platfrom() == XPlatformType.IOS; + if (flag2) + { + specificDocument.SDKSubscribe(this.payInfo.Price, this.payInfo.Days, this.payInfo.ServiceCode, this.payInfo.Name, this.payInfo.ParamID, PayParamType.PAY_PARAM_MEMBER); + } + } + this.SetVisibleWithAnimation(false, null); + return true; + } + } +} -- cgit v1.1-26-g67d0