summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/ModalDlg2.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/ModalDlg2.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/ModalDlg2.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/ModalDlg2.cs91
1 files changed, 91 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UI/ModalDlg2.cs b/Client/Assets/Scripts/XMainClient/UI/ModalDlg2.cs
new file mode 100644
index 00000000..0eef6134
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/ModalDlg2.cs
@@ -0,0 +1,91 @@
+using System;
+using UILib;
+using XMainClient.UI.UICommon;
+
+namespace XMainClient.UI
+{
+ public class ModalDlg2 : DlgBase<ModalDlg2, ModalDlg2Behaviour>
+ {
+ public override string fileName
+ {
+ get
+ {
+ return "Common/GreyModalDlg2";
+ }
+ }
+
+ public override int layer
+ {
+ get
+ {
+ return 100;
+ }
+ }
+
+ public override bool isHideChat
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public override bool autoload
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ private ButtonClickEventHandler _bFrButtonDelegate = null;
+
+ private ButtonClickEventHandler _bSecButtonDelegate = null;
+
+ public override void RegisterEvent()
+ {
+ base.RegisterEvent();
+ base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseBtnClick));
+ base.uiBehaviour.m_Select1.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSelect1BtnClick));
+ base.uiBehaviour.m_Select2.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSelect2BtnClick));
+ }
+
+ public bool OnCloseBtnClick(IXUIButton btn)
+ {
+ this.SetVisible(false, true);
+ return true;
+ }
+
+ public bool OnSelect1BtnClick(IXUIButton btn)
+ {
+ this._bFrButtonDelegate(base.uiBehaviour.m_Select1);
+ this.SetVisible(false, true);
+ return true;
+ }
+
+ public bool OnSelect2BtnClick(IXUIButton btn)
+ {
+ this._bSecButtonDelegate(base.uiBehaviour.m_Select2);
+ this.SetVisible(false, true);
+ return true;
+ }
+
+ public void SetBtnMsg(IXUIButton btn, string price, string label)
+ {
+ IXUILabelSymbol ixuilabelSymbol = btn.gameObject.transform.Find("Price").GetComponent("XUILabelSymbol") as IXUILabelSymbol;
+ IXUILabel ixuilabel = btn.gameObject.transform.Find("Label").GetComponent("XUILabel") as IXUILabel;
+ ixuilabelSymbol.InputText = price;
+ ixuilabel.SetText(label);
+ }
+
+ public void InitShow(string text, ButtonClickEventHandler func1, ButtonClickEventHandler func2, string price1, string price2, string btnLabel1, string btnLabel2)
+ {
+ this.SetVisible(true, true);
+ this.SetBtnMsg(base.uiBehaviour.m_Select1, price1, btnLabel1);
+ this.SetBtnMsg(base.uiBehaviour.m_Select2, price2, btnLabel2);
+ base.uiBehaviour.m_Text.InputText = text;
+ this._bFrButtonDelegate = func1;
+ this._bSecButtonDelegate = func2;
+ }
+ }
+}