summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs90
1 files changed, 90 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs b/Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs
new file mode 100644
index 00000000..af9a5581
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/PressTipsDlg.cs
@@ -0,0 +1,90 @@
+using System;
+using UnityEngine;
+using XMainClient.UI.UICommon;
+using XUtliPoolLib;
+
+namespace XMainClient.UI
+{
+ internal class PressTipsDlg : DlgBase<PressTipsDlg, PressTipsBehaviour>
+ {
+ public override string fileName
+ {
+ get
+ {
+ return "Common/PressTipDlg";
+ }
+ }
+
+ public override bool isHideChat
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ private string _contentKey;
+
+ private Vector3 _offset;
+
+ private Vector3 _pos;
+
+ public void Setup(bool show, string key, Vector3 pos, Vector3 offset)
+ {
+ if (show)
+ {
+ this._contentKey = key;
+ this._offset = offset;
+ this._pos = pos;
+ bool flag = !base.IsVisible();
+ if (flag)
+ {
+ this._Show();
+ }
+ else
+ {
+ this.RefreshData();
+ }
+ }
+ else
+ {
+ bool flag2 = base.IsVisible();
+ if (flag2)
+ {
+ this._Close();
+ }
+ }
+ }
+
+ protected override void OnShow()
+ {
+ base.OnShow();
+ this.RefreshData();
+ }
+
+ private void RefreshData()
+ {
+ bool flag = string.IsNullOrEmpty(this._contentKey);
+ if (flag)
+ {
+ this._Close();
+ }
+ else
+ {
+ base.uiBehaviour.transform.position = this._pos;
+ base.uiBehaviour.transform.localPosition += this._offset;
+ base.uiBehaviour._ContentValue.SetText(XSingleton<UiUtility>.singleton.ReplaceReturn(XStringDefineProxy.GetString(this._contentKey)));
+ }
+ }
+
+ private void _Close()
+ {
+ this.SetVisibleWithAnimation(false, null);
+ }
+
+ private void _Show()
+ {
+ this.SetVisibleWithAnimation(true, null);
+ }
+ }
+}