summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/UICommon
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/UICommon')
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs750
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs.meta12
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs130
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs.meta12
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs60
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs.meta12
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs586
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs.meta12
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs139
-rw-r--r--Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs.meta12
10 files changed, 1725 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs
new file mode 100644
index 00000000..234b0f2c
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs
@@ -0,0 +1,750 @@
+using System;
+using UILib;
+using UnityEngine;
+using XUpdater;
+using XUtliPoolLib;
+
+namespace XMainClient.UI.UICommon
+{
+ public abstract class DlgBase<TDlgClass, TUIBehaviour> : IXUIDlg, IDlgHandlerMgr where TDlgClass : IXUIDlg, new() where TUIBehaviour : DlgBehaviourBase
+ {
+ public static TDlgClass singleton
+ {
+ get
+ {
+ bool flag = DlgBase<TDlgClass, TUIBehaviour>.s_instance == null;
+ if (flag)
+ {
+ object obj = DlgBase<TDlgClass, TUIBehaviour>.s_objLock;
+ lock (obj)
+ {
+ bool flag2 = DlgBase<TDlgClass, TUIBehaviour>.s_instance == null;
+ if (flag2)
+ {
+ DlgBase<TDlgClass, TUIBehaviour>.s_instance = Activator.CreateInstance<TDlgClass>();
+ }
+ }
+ }
+ return DlgBase<TDlgClass, TUIBehaviour>.s_instance;
+ }
+ }
+
+ public IXUIBehaviour uiBehaviourInterface
+ {
+ get
+ {
+ return this.m_uiBehaviour;
+ }
+ }
+
+ public TUIBehaviour uiBehaviour
+ {
+ get
+ {
+ return this.m_uiBehaviour;
+ }
+ }
+
+ public virtual string fileName
+ {
+ get
+ {
+ return "";
+ }
+ }
+
+ public string luaFileName
+ {
+ get
+ {
+ bool flag = this.fileName.Length > 1 && this.fileName.Contains("/");
+ string result;
+ if (flag)
+ {
+ result = this.fileName.Substring(this.fileName.LastIndexOf('/') + 1);
+ }
+ else
+ {
+ result = this.fileName;
+ }
+ return result;
+ }
+ }
+
+ public virtual int layer
+ {
+ get
+ {
+ return 2;
+ }
+ }
+
+ public virtual int group
+ {
+ get
+ {
+ return 0;
+ }
+ }
+
+ public virtual bool exclusive
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual bool autoload
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual bool isHideChat
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public virtual bool hideMainMenu
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual bool pushstack
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual bool isMainUI
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual bool isHideTutorial
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual int sysid
+ {
+ get
+ {
+ return 0;
+ }
+ }
+
+ public virtual bool fullscreenui
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public bool Prepared
+ {
+ get
+ {
+ return null != this.m_uiBehaviour;
+ }
+ }
+
+ public virtual bool isPopup
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual bool needOnTop
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public DlgHandlerMgr HandlerMgr
+ {
+ get
+ {
+ return this.m_DlgHandlerMgr;
+ }
+ }
+
+ private LoadUIFinishedEventHandler _loadUICb = null;
+
+ protected int m_dummPool = -1;
+
+ private IXNGUICallback panelCB = null;
+
+ protected TUIBehaviour m_uiBehaviour = default(TUIBehaviour);
+
+ private static TDlgClass s_instance = default(TDlgClass);
+
+ private static object s_objLock = new object();
+
+ private bool m_bVisible = false;
+
+ protected bool m_bLoaded = false;
+
+ private float m_fDepthZ = 0f;
+
+ private bool m_bBindedReverse = false;
+
+ private Transform m_DlgController = null;
+
+ private bool m_bCacheVisible = false;
+
+ private DlgBase<TDlgClass, TUIBehaviour>.OnAnimationOver m_animationOver;
+
+ private IXUIDlg m_RelatedDlg;
+
+ private DlgHandlerMgr m_DlgHandlerMgr = new DlgHandlerMgr();
+
+ public delegate void OnAnimationOver();
+
+ public DlgBase()
+ {
+ this._loadUICb = new LoadUIFinishedEventHandler(this.OnLoadUIFinishedEventHandler);
+ }
+
+ public virtual void OnUpdate()
+ {
+ this.HandlerMgr.OnUpdate();
+ }
+
+ public virtual void OnPostUpdate()
+ {
+ }
+
+ public void SetVisiblePure(bool bVisible)
+ {
+ bool flag = !this.m_bLoaded && this.autoload;
+ if (flag)
+ {
+ this.Load();
+ }
+ else
+ {
+ bool flag2 = !this.m_bLoaded && !this.autoload;
+ if (flag2)
+ {
+ return;
+ }
+ }
+ this.uiBehaviour.SetVisible(bVisible);
+ this.m_bVisible = bVisible;
+ this.OnSetVisiblePure(bVisible);
+ bool flag3 = this.m_RelatedDlg != null;
+ if (flag3)
+ {
+ this.m_RelatedDlg.SetRelatedVisible(this.m_bVisible);
+ }
+ }
+
+ public virtual void SetVisible(bool bIsVisible, bool bEnableAuto = true)
+ {
+ bool bLoaded = this.m_bLoaded;
+ if (!bLoaded)
+ {
+ bool flag = this.autoload && bEnableAuto;
+ if (!flag)
+ {
+ return;
+ }
+ this.Load();
+ }
+ bool flag2 = bIsVisible && !this._CanShow();
+ if (!flag2)
+ {
+ bool prepared = this.Prepared;
+ if (prepared)
+ {
+ bool flag3 = this.m_bVisible != bIsVisible;
+ if (flag3)
+ {
+ this.uiBehaviour.SetVisible(bIsVisible);
+ this.m_bVisible = bIsVisible;
+ if (bIsVisible)
+ {
+ XSingleton<UIManager>.singleton.OnDlgShow(DlgBase<TDlgClass, TUIBehaviour>.s_instance);
+ ILuaEngine xluaEngine = XSingleton<XUpdater.XUpdater>.singleton.XLuaEngine;
+ bool flag4 = !xluaEngine.hotfixMgr.TryFixRefresh(HotfixMode.BEFORE, this.luaFileName, this.uiBehaviour.gameObject);
+ if (flag4)
+ {
+ this.OnShow();
+ xluaEngine.hotfixMgr.TryFixRefresh(HotfixMode.AFTER, this.luaFileName, this.uiBehaviour.gameObject);
+ }
+ bool flag5 = this.fullscreenui && XSingleton<XScene>.singleton.GameCamera != null && XSingleton<XScene>.singleton.GameCamera.UnityCamera != null;
+ if (flag5)
+ {
+ XSingleton<XScene>.singleton.GameCamera.UnityCamera.enabled = false;
+ }
+ }
+ else
+ {
+ this.OnHide();
+ XSingleton<UIManager>.singleton.OnDlgHide(DlgBase<TDlgClass, TUIBehaviour>.s_instance);
+ ILuaEngine xluaEngine2 = XSingleton<XUpdater.XUpdater>.singleton.XLuaEngine;
+ xluaEngine2.hotfixMgr.TryFixRefresh(HotfixMode.HIDE, this.luaFileName, this.uiBehaviour.gameObject);
+ bool flag6 = XSingleton<UIManager>.singleton.GetFullScreenUICount() == 0 && XSingleton<XScene>.singleton.GameCamera != null && XSingleton<XScene>.singleton.GameCamera.UnityCamera != null;
+ if (flag6)
+ {
+ XSingleton<XScene>.singleton.GameCamera.UnityCamera.enabled = true;
+ }
+ }
+ bool flag7 = this.m_RelatedDlg != null;
+ if (flag7)
+ {
+ this.m_RelatedDlg.SetVisible(this.m_bVisible, true);
+ }
+ }
+ }
+ }
+ }
+
+ public virtual void SetVisibleWithAnimation(bool bVisible, DlgBase<TDlgClass, TUIBehaviour>.OnAnimationOver AnimationOverDelegate)
+ {
+ bool flag = !this.m_bLoaded;
+ if (flag)
+ {
+ this.Load();
+ }
+ bool flag2 = bVisible && !this._CanShow();
+ if (!flag2)
+ {
+ int fullScreenUICount = XSingleton<UIManager>.singleton.GetFullScreenUICount();
+ bool flag3 = (bVisible && fullScreenUICount > 0) || (!bVisible && ((this.fullscreenui && fullScreenUICount > 1) || (!this.fullscreenui && fullScreenUICount > 0)));
+ if (flag3)
+ {
+ this.SetVisible(bVisible, true);
+ bool flag4 = AnimationOverDelegate != null;
+ if (flag4)
+ {
+ AnimationOverDelegate();
+ }
+ }
+ else
+ {
+ this.SetVisible(bVisible, true);
+ this.m_bCacheVisible = bVisible;
+ this.m_animationOver = AnimationOverDelegate;
+ bool flag5 = AnimationOverDelegate != null;
+ if (flag5)
+ {
+ AnimationOverDelegate();
+ }
+ }
+ }
+ }
+
+ protected void OnShowAnimationFinish(IXUITweenTool tween)
+ {
+ bool fullscreenui = this.fullscreenui;
+ if (fullscreenui)
+ {
+ XSingleton<XScene>.singleton.GameCamera.UnityCamera.enabled = false;
+ }
+ }
+
+ protected void OnCloseAnimationFinish(IXUITweenTool tween)
+ {
+ this.SetVisible(false, true);
+ bool flag = this.m_animationOver != null;
+ if (flag)
+ {
+ this.m_animationOver();
+ }
+ }
+
+ protected virtual void OnShow()
+ {
+ }
+
+ protected virtual void OnHide()
+ {
+ }
+
+ protected virtual void OnLoad()
+ {
+ }
+
+ protected virtual void OnUnload()
+ {
+ this.UnRegisterEvent();
+ }
+
+ public bool IsVisible()
+ {
+ bool bLoaded = this.m_bLoaded;
+ return bLoaded && this.uiBehaviour.IsVisible();
+ }
+
+ public void SetDepthZ(int nDepthZ)
+ {
+ this.m_fDepthZ = (float)(nDepthZ * 10);
+ bool prepared = this.Prepared;
+ if (prepared)
+ {
+ Vector3 localPosition = this.uiBehaviour.transform.localPosition;
+ localPosition.z = this.m_fDepthZ;
+ this.uiBehaviour.transform.localPosition = localPosition;
+ }
+ }
+
+ public virtual void Reset()
+ {
+ }
+
+ public virtual void StackRefresh()
+ {
+ bool flag = this.HandlerMgr != null;
+ if (flag)
+ {
+ this.HandlerMgr.StackRefresh();
+ }
+ }
+
+ public virtual void LeaveStackTop()
+ {
+ bool flag = this.HandlerMgr != null;
+ if (flag)
+ {
+ this.HandlerMgr.LeaveStackTop();
+ }
+ }
+
+ protected virtual void OnSetVisiblePure(bool bShow)
+ {
+ }
+
+ protected virtual void Init()
+ {
+ }
+
+ private void InnerInit()
+ {
+ this.m_uiBehaviour.Init();
+ Vector3 localPosition = this.uiBehaviour.transform.localPosition;
+ localPosition.z = this.m_fDepthZ;
+ this.uiBehaviour.transform.localPosition = localPosition;
+ this.m_DlgController = this.uiBehaviour.transform.Find("DlgController");
+ }
+
+ public void Load()
+ {
+ bool flag = !this.m_bLoaded;
+ if (flag)
+ {
+ this.m_bLoaded = true;
+ XSingleton<UIManager>.singleton.LoadUI(this.fileName, this._loadUICb);
+ XSingleton<UIManager>.singleton.AddDlg(DlgBase<TDlgClass, TUIBehaviour>.s_instance);
+ this.OnLoad();
+ }
+ }
+
+ public bool IsLoaded()
+ {
+ return this.m_bLoaded;
+ }
+
+ public void UnLoad(bool bTransfer = false)
+ {
+ bool bLoaded = this.m_bLoaded;
+ if (bLoaded)
+ {
+ if (bTransfer)
+ {
+ this.SetVisible(false, false);
+ }
+ else
+ {
+ ILuaEngine xluaEngine = XSingleton<XUpdater.XUpdater>.singleton.XLuaEngine;
+ xluaEngine.hotfixMgr.TryFixRefresh(HotfixMode.UNLOAD, this.luaFileName, this.uiBehaviour.gameObject);
+ this.OnUnload();
+ this.HandlerMgr.Unload();
+ XSingleton<UIManager>.singleton.RemoveDlg(DlgBase<TDlgClass, TUIBehaviour>.s_instance);
+ XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroy(this.uiBehaviour.gameObject, false, true);
+ this.m_uiBehaviour = default(TUIBehaviour);
+ this.m_uiBehaviour = default(TUIBehaviour);
+ this.m_bLoaded = false;
+ bool flag = !XSingleton<XGame>.singleton.switchScene;
+ if (flag)
+ {
+ bool flag2 = XSingleton<UIManager>.singleton.unloadUICount >= 10;
+ if (flag2)
+ {
+ Resources.UnloadUnusedAssets();
+ XSingleton<UIManager>.singleton.unloadUICount = 0;
+ }
+ else
+ {
+ XSingleton<UIManager>.singleton.unloadUICount++;
+ }
+ }
+ }
+ }
+ }
+
+ public void SetAlpha(float a)
+ {
+ IXUIPanel ixuipanel = this.uiBehaviour.gameObject.GetComponent("XUIPanel") as IXUIPanel;
+ bool flag = ixuipanel != null;
+ if (flag)
+ {
+ ixuipanel.SetAlpha(a);
+ }
+ }
+
+ public float GetAlpha()
+ {
+ IXUIPanel ixuipanel = this.uiBehaviour.gameObject.GetComponent("XUIPanel") as IXUIPanel;
+ bool flag = ixuipanel != null;
+ float result;
+ if (flag)
+ {
+ result = ixuipanel.GetAlpha();
+ }
+ else
+ {
+ result = 1f;
+ }
+ return result;
+ }
+
+ public void RegCallBack()
+ {
+ this.panelCB = (this.uiBehaviour.gameObject.GetComponent("NGUIAssetCallBack") as IXNGUICallback);
+ bool flag = this.panelCB != null;
+ if (flag)
+ {
+ this.panelCB.RegisterClickEventHandler(new IXNGUIClickEventHandler(this.OnXNGUIClick));
+ }
+ }
+
+ public virtual void OnXNGUIClick(GameObject obj, string path)
+ {
+ XSingleton<XDebug>.singleton.AddLog(obj.name, " ", path, null, null, null, XDebugColor.XDebug_None);
+ }
+
+ protected GameObject SetXUILable(string name, string content)
+ {
+ bool flag = this.uiBehaviour.transform == null;
+ GameObject result;
+ if (flag)
+ {
+ result = null;
+ }
+ else
+ {
+ bool flag2 = string.IsNullOrEmpty(content);
+ if (flag2)
+ {
+ content = string.Empty;
+ }
+ IXUILabel ixuilabel = this.uiBehaviour.transform.Find(name).GetComponent("XUILabel") as IXUILabel;
+ bool flag3 = ixuilabel == null;
+ if (flag3)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("SetXUILable ", name, " ", content, null, null);
+ result = null;
+ }
+ else
+ {
+ ixuilabel.SetText(content);
+ result = ixuilabel.gameObject;
+ }
+ }
+ return result;
+ }
+
+ private void OnLoadUIFinishedEventHandler(string location)
+ {
+ GameObject gameObject = XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab("UI/" + location, true, false) as GameObject;
+ bool flag = null != gameObject;
+ if (flag)
+ {
+ gameObject.transform.parent = XSingleton<UIManager>.singleton.UIRoot;
+ gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
+ gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
+ this.m_uiBehaviour = gameObject.AddComponent<TUIBehaviour>();
+ this.m_uiBehaviour.uiDlgInterface = this;
+ bool flag2 = !this.m_bBindedReverse;
+ if (flag2)
+ {
+ this.Init();
+ this.InnerInit();
+ this.RegisterEvent();
+ this.RegCallBack();
+ this.uiBehaviour.SetVisible(false);
+ this.m_bVisible = false;
+ }
+ }
+ }
+
+ public bool BindReverse(IXUIBehaviour iXUIBehaviour)
+ {
+ TUIBehaviour tuibehaviour = iXUIBehaviour as TUIBehaviour;
+ bool flag = null == tuibehaviour;
+ bool result;
+ if (flag)
+ {
+ result = false;
+ }
+ else
+ {
+ this.m_bLoaded = true;
+ this.m_uiBehaviour = tuibehaviour;
+ this.m_uiBehaviour.uiDlgInterface = this;
+ this.RegisterEvent();
+ this.InnerInit();
+ this.Init();
+ this.m_bBindedReverse = true;
+ result = true;
+ }
+ return result;
+ }
+
+ public virtual void RegisterEvent()
+ {
+ }
+
+ protected virtual void UnRegisterEvent()
+ {
+ }
+
+ public virtual void SetRelatedDlg(IXUIDlg dlg)
+ {
+ this.m_RelatedDlg = dlg;
+ }
+
+ protected virtual void OnRelatedShow()
+ {
+ }
+
+ protected virtual void OnRelatedHide()
+ {
+ }
+
+ public void SetRelatedVisible(bool bVisible)
+ {
+ bool bLoaded = this.m_bLoaded;
+ if (bLoaded)
+ {
+ this.SetVisiblePure(bVisible);
+ if (bVisible)
+ {
+ this.OnRelatedShow();
+ }
+ else
+ {
+ this.OnRelatedHide();
+ }
+ }
+ }
+
+ private bool _CanShow()
+ {
+ bool flag = this.isPopup && XSingleton<XTutorialMgr>.singleton.InTutorial;
+ bool result;
+ if (flag)
+ {
+ this.OnPopupBlocked();
+ result = false;
+ }
+ else
+ {
+ result = true;
+ }
+ return result;
+ }
+
+ protected virtual void OnPopupBlocked()
+ {
+ }
+
+ public virtual int[] GetTitanBarItems()
+ {
+ return null;
+ }
+
+ protected void Alloc3DAvatarPool(string user)
+ {
+ bool flag = this.m_dummPool < 0;
+ if (flag)
+ {
+ this.m_dummPool = XSingleton<X3DAvatarMgr>.singleton.AllocDummyPool(user, 1);
+ }
+ }
+
+ protected void Return3DAvatarPool()
+ {
+ XSingleton<X3DAvatarMgr>.singleton.ReturnDummyPool(this.m_dummPool);
+ this.m_dummPool = -1;
+ }
+
+ public static Transform FindChildRecursively(string childName)
+ {
+ TDlgClass singleton = DlgBase<TDlgClass, TUIBehaviour>.singleton;
+ TUIBehaviour tuibehaviour = singleton.uiBehaviourInterface as TUIBehaviour;
+ bool flag = !tuibehaviour.IsVisible();
+ Transform result;
+ if (flag)
+ {
+ result = null;
+ }
+ else
+ {
+ Transform transform = XSingleton<XCommon>.singleton.FindChildRecursively(tuibehaviour.transform, childName);
+ result = transform;
+ }
+ return result;
+ }
+
+ public static Vector3 GetChildWorldPos(string childName)
+ {
+ TDlgClass singleton = DlgBase<TDlgClass, TUIBehaviour>.singleton;
+ TUIBehaviour tuibehaviour = singleton.uiBehaviourInterface as TUIBehaviour;
+ bool flag = !tuibehaviour.IsVisible();
+ Vector3 result;
+ if (flag)
+ {
+ result = Vector3.zero;
+ }
+ else
+ {
+ Transform transform = XSingleton<XCommon>.singleton.FindChildRecursively(tuibehaviour.transform, childName);
+ bool flag2 = transform != null;
+ if (flag2)
+ {
+ result = transform.position;
+ }
+ else
+ {
+ result = Vector3.zero;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs.meta b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs.meta
new file mode 100644
index 00000000..a0c60016
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBase.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: b88aeb92feab8b24eaca74836f7b7ce3
+timeCreated: 1611404405
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs
new file mode 100644
index 00000000..82af93d4
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs
@@ -0,0 +1,130 @@
+using System;
+using UILib;
+using UnityEngine;
+
+namespace XMainClient.UI.UICommon
+{
+ public class DlgBehaviourBase : MonoBehaviour, IXUIBehaviour, IXUIObject
+ {
+ public IXUIObject parent
+ {
+ get
+ {
+ return null;
+ }
+ set
+ {
+ }
+ }
+
+ public ulong ID
+ {
+ get
+ {
+ return this.m_id;
+ }
+ set
+ {
+ this.m_id = value;
+ }
+ }
+
+ public bool Exculsive
+ {
+ get
+ {
+ return this.m_bExculsive;
+ }
+ set
+ {
+ this.m_bExculsive = value;
+ }
+ }
+
+ public IXUIDlg uiDlgInterface
+ {
+ get
+ {
+ return this.m_uiDlgInterface;
+ }
+ set
+ {
+ this.m_uiDlgInterface = value;
+ }
+ }
+
+ public IXUIObject[] uiChilds
+ {
+ get
+ {
+ return this.m_uiChilds;
+ }
+ }
+
+ private IXUIDlg m_uiDlgInterface = null;
+
+ private IXUIObject[] m_uiChilds = null;
+
+ private ulong m_id;
+
+ private bool m_bExculsive = false;
+
+ public bool IsVisible()
+ {
+ return base.gameObject.activeInHierarchy;
+ }
+
+ public void SetVisible(bool bVisible)
+ {
+ base.gameObject.SetActive(bVisible);
+ }
+
+ public IXUIObject GetUIObject(string strName)
+ {
+ Transform transform = base.transform.Find(strName);
+ bool flag = null != transform;
+ IXUIObject result;
+ if (flag)
+ {
+ result = transform.GetComponent<XUIObjectBase>();
+ }
+ else
+ {
+ result = null;
+ }
+ return result;
+ }
+
+ public void OnPress()
+ {
+ this.OnFocus();
+ }
+
+ public void OnFocus()
+ {
+ }
+
+ public virtual void Init()
+ {
+ IXUIObject[] componentsInChildren = base.GetComponentsInChildren<XUIObjectBase>();
+ this.m_uiChilds = componentsInChildren;
+ for (int i = 0; i < this.m_uiChilds.Length; i++)
+ {
+ XUIObjectBase xuiobjectBase = this.m_uiChilds[i] as XUIObjectBase;
+ xuiobjectBase.Init();
+ }
+ }
+
+ public virtual void Highlight(bool bTrue)
+ {
+ }
+
+ GameObject IXUIObject.gameObject
+ {
+ get
+ {
+ return base.gameObject;
+ }
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs.meta b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs.meta
new file mode 100644
index 00000000..e0064525
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/DlgBehaviourBase.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 093a7d627ed1d7245be463c2fa874487
+timeCreated: 1611403150
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs b/Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs
new file mode 100644
index 00000000..9877b620
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using UILib;
+using UnityEngine;
+
+namespace XMainClient.UI.UICommon
+{
+ internal class TabHandleBase<T, V> : DlgBase<T, V>, IDlgHandlerMgr where T : IXUIDlg, new() where V : DlgBehaviourBase
+ {
+ private Dictionary<XSysDefine, DlgHandlerBase> m_handles = new Dictionary<XSysDefine, DlgHandlerBase>();
+
+ protected XSysDefine m_select;
+
+ public virtual void RefreshData()
+ {
+ DlgHandlerBase dlgHandlerBase;
+ bool flag = this.m_handles.TryGetValue(this.m_select, out dlgHandlerBase) && dlgHandlerBase.IsVisible();
+ if (flag)
+ {
+ dlgHandlerBase.RefreshData();
+ }
+ }
+
+ protected void SetHandleVisible(XSysDefine define, bool isVisible)
+ {
+ DlgHandlerBase dlgHandlerBase;
+ bool flag = this.m_handles.TryGetValue(define, out dlgHandlerBase);
+ if (flag)
+ {
+ dlgHandlerBase.SetVisible(isVisible);
+ if (isVisible)
+ {
+ this.m_select = define;
+ }
+ }
+ }
+
+ protected void RegisterHandler<C>(XSysDefine define, GameObject g, bool show = false) where C : DlgHandlerBase, new()
+ {
+ bool flag = !this.m_handles.ContainsKey(define);
+ if (flag)
+ {
+ C c = default(C);
+ c = DlgHandlerBase.EnsureCreate<C>(ref c, g, this, false);
+ this.m_handles.Add(define, c);
+ }
+ }
+
+ protected void RemoveHandler(XSysDefine define)
+ {
+ DlgHandlerBase dlgHandlerBase;
+ bool flag = this.m_handles.TryGetValue(define, out dlgHandlerBase);
+ if (flag)
+ {
+ DlgHandlerBase.EnsureUnload<DlgHandlerBase>(ref dlgHandlerBase);
+ this.m_handles.Remove(define);
+ }
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs.meta b/Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs.meta
new file mode 100644
index 00000000..fc6bb5f0
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/TabHandleBase.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: e4570d8459fc126439209e57f1539a48
+timeCreated: 1611404737
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs b/Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs
new file mode 100644
index 00000000..0daba0f9
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs
@@ -0,0 +1,586 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using UILib;
+using UnityEngine;
+using XUpdater;
+using XUtliPoolLib;
+
+namespace XMainClient.UI.UICommon
+{
+ internal class UIManager : XSingleton<UIManager>
+ {
+ public Transform UIRoot
+ {
+ get
+ {
+ return this.m_uiRoot;
+ }
+ set
+ {
+ this.m_uiRoot = value;
+ }
+ }
+
+ private Dictionary<string, IXUIDlg> m_dicDlgs = new Dictionary<string, IXUIDlg>();
+
+ private Dictionary<int, List<IXUIDlg>> m_dicUILayer = new Dictionary<int, List<IXUIDlg>>();
+
+ private List<IXUIDlg> m_iterDlgs = new List<IXUIDlg>();
+
+ private Transform m_uiRoot = null;
+
+ private Dictionary<int, IXUIDlg> m_GroupDlg = new Dictionary<int, IXUIDlg>();
+
+ private List<IXUIDlg> m_ShowedDlg = new List<IXUIDlg>();
+
+ private int m_TutorialClashUICount = 0;
+
+ private List<IXUIDlg> m_ToBeUnloadDlg = new List<IXUIDlg>();
+
+ private XLFU<IXUIDlg> m_LFU = new XLFU<IXUIDlg>(5);
+
+ private List<IXUIDlg> m_CachedExculsiveUI = new List<IXUIDlg>();
+
+ private Stack<IXUIDlg> m_ShowUIStack = new Stack<IXUIDlg>();
+
+ private List<IXUIDlg> m_StoreUIList = new List<IXUIDlg>();
+
+ private List<IXUIDlg> m_AvatarStack = new List<IXUIDlg>();
+
+ public int unloadUICount = 0;
+
+ public void OnEnterScene()
+ {
+ this.m_LFU.Clear();
+ this.m_ShowedDlg.Clear();
+ this.m_TutorialClashUICount = 0;
+ this.m_CachedExculsiveUI.Clear();
+ this.m_ShowUIStack.Clear();
+ this.m_ToBeUnloadDlg.Clear();
+ this.m_StoreUIList.Clear();
+ this.unloadUICount = 0;
+ }
+
+ public void OnLeaveScene(bool transfer)
+ {
+ for (int i = this.m_iterDlgs.Count - 1; i >= 0; i--)
+ {
+ bool flag = i < this.m_iterDlgs.Count && this.m_iterDlgs[i] != null;
+ if (flag)
+ {
+ this.m_iterDlgs[i].UnLoad(transfer);
+ }
+ }
+ this.m_AvatarStack.Clear();
+ this.unloadUICount = 0;
+ }
+
+ public override bool Init()
+ {
+ RuntimePlatform platform = Application.platform;
+ int @int;
+ if ((int)platform != 8)
+ {
+ if ((int)platform != 11)
+ {
+ @int = XSingleton<XGlobalConfig>.singleton.GetInt("UIUnloadLFUSizeDefault");
+ }
+ else
+ {
+ @int = XSingleton<XGlobalConfig>.singleton.GetInt("UIUnloadLFUSizeAndroid");
+ }
+ }
+ else
+ {
+ @int = XSingleton<XGlobalConfig>.singleton.GetInt("UIUnloadLFUSizeIPhone");
+ }
+ this.m_LFU = new XLFU<IXUIDlg>(@int);
+ return true;
+ }
+
+ public override void Uninit()
+ {
+ }
+
+ public void LoadUI(string strUIFile, LoadUIFinishedEventHandler eventHandler)
+ {
+ bool flag = eventHandler != null;
+ if (flag)
+ {
+ eventHandler(strUIFile);
+ }
+ }
+
+ public void Update(float fDeltaT)
+ {
+ int i = 0;
+ while (i < this.m_iterDlgs.Count)
+ {
+ IXUIDlg ixuidlg = this.m_iterDlgs[i];
+ bool flag = ixuidlg != null;
+ if (flag)
+ {
+ bool flag2 = ixuidlg.uiBehaviourInterface == null || ixuidlg.uiBehaviourInterface.gameObject == null;
+ if (flag2)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("UI missing: ", ixuidlg.fileName, null, null, null, null);
+ }
+ else
+ {
+ bool activeInHierarchy = ixuidlg.uiBehaviourInterface.gameObject.activeInHierarchy;
+ if (activeInHierarchy)
+ {
+ ixuidlg.OnUpdate();
+ }
+ }
+ }
+ IL_78:
+ i++;
+ continue;
+ goto IL_78;
+ }
+ }
+
+ public void PostUpdate(float fDeltaT)
+ {
+ for (int i = 0; i < this.m_iterDlgs.Count; i++)
+ {
+ bool flag = this.m_iterDlgs[i] != null;
+ if (flag)
+ {
+ this.m_iterDlgs[i].OnPostUpdate();
+ }
+ }
+ bool flag2 = this.m_ToBeUnloadDlg.Count > 0;
+ if (flag2)
+ {
+ for (int j = 0; j < this.m_ToBeUnloadDlg.Count; j++)
+ {
+ this.m_ToBeUnloadDlg[j].UnLoad(false);
+ }
+ this.m_ToBeUnloadDlg.Clear();
+ }
+ }
+
+ public bool IsUIShowed()
+ {
+ bool flag = this.m_ShowUIStack.Count > 0;
+ bool result;
+ if (flag)
+ {
+ result = true;
+ }
+ else
+ {
+ bool flag2 = DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.IsLoaded() && DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.IsVisible();
+ if (flag2)
+ {
+ result = true;
+ }
+ else
+ {
+ bool flag3 = DlgBase<XOtherPlayerInfoView, XOtherPlayerInfoBehaviour>.singleton.IsVisible();
+ if (flag3)
+ {
+ result = true;
+ }
+ else
+ {
+ bool flag4 = XSingleton<XUpdater.XUpdater>.singleton.XLuaEngine.luaUIManager.IsUIShowed();
+ result = flag4;
+ }
+ }
+ }
+ return result;
+ }
+
+ public bool IsHideTutorial()
+ {
+ return this.m_TutorialClashUICount != 0;
+ }
+
+ public int GetUIStackCount()
+ {
+ return this.m_ShowUIStack.Count;
+ }
+
+ public int GetFullScreenUICount()
+ {
+ int num = 0;
+ foreach (IXUIDlg ixuidlg in this.m_ShowUIStack)
+ {
+ bool fullscreenui = ixuidlg.fullscreenui;
+ if (fullscreenui)
+ {
+ num++;
+ }
+ }
+ return num;
+ }
+
+ public void RemoveDlg(IXUIDlg dlg)
+ {
+ List<IXUIDlg> list = null;
+ bool flag = this.m_dicUILayer.TryGetValue(dlg.layer, out list);
+ if (flag)
+ {
+ list.Remove(dlg);
+ }
+ bool flag2 = this.m_dicDlgs.ContainsKey(dlg.fileName);
+ if (flag2)
+ {
+ this.m_dicDlgs.Remove(dlg.fileName);
+ this.m_iterDlgs.Remove(dlg);
+ }
+ bool flag3 = this.m_GroupDlg.ContainsKey(dlg.group);
+ if (flag3)
+ {
+ this.m_GroupDlg.Remove(dlg.group);
+ }
+ bool flag4 = this.m_ShowedDlg.Contains(dlg);
+ if (flag4)
+ {
+ bool isHideTutorial = dlg.isHideTutorial;
+ if (isHideTutorial)
+ {
+ this.ChangeTutorialClashUI(false);
+ }
+ this.m_ShowedDlg.Remove(dlg);
+ }
+ this.m_LFU.Remove(dlg);
+ this.m_AvatarStack.Remove(dlg);
+ }
+
+ public bool AddDlg(IXUIDlg dlg)
+ {
+ bool flag = this.m_dicDlgs.ContainsKey(dlg.fileName);
+ bool result;
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddLog("true == m_dicDlgs.ContainsKey(dlg.fileName): ", dlg.fileName, null, null, null, null, XDebugColor.XDebug_None);
+ result = false;
+ }
+ else
+ {
+ this.m_dicDlgs.Add(dlg.fileName, dlg);
+ this.m_iterDlgs.Add(dlg);
+ List<IXUIDlg> list = null;
+ bool flag2 = this.m_dicUILayer.TryGetValue(dlg.layer, out list);
+ if (flag2)
+ {
+ list.Add(dlg);
+ }
+ else
+ {
+ list = new List<IXUIDlg>();
+ list.Add(dlg);
+ this.m_dicUILayer.Add(dlg.layer, list);
+ }
+ result = true;
+ }
+ return result;
+ }
+
+ protected void CacheExclusiveUI()
+ {
+ this.m_CachedExculsiveUI.Clear();
+ for (int i = 0; i < this.m_ShowedDlg.Count; i++)
+ {
+ this.m_CachedExculsiveUI.Add(this.m_ShowedDlg[i]);
+ }
+ }
+
+ public void CloseAllUI()
+ {
+ this.ClearUIinStack();
+ List<IXUIDlg> list = new List<IXUIDlg>();
+ for (int i = 0; i < this.m_ShowedDlg.Count; i++)
+ {
+ bool flag = !this.m_ShowedDlg[i].isMainUI;
+ if (flag)
+ {
+ list.Add(this.m_ShowedDlg[i]);
+ }
+ }
+ for (int j = 0; j < list.Count; j++)
+ {
+ list[j].SetVisible(false, true);
+ }
+ }
+
+ public void OnDlgShow(IXUIDlg dlg)
+ {
+ bool exclusive = dlg.exclusive;
+ if (exclusive)
+ {
+ this.CloseAllUI();
+ this.CacheExclusiveUI();
+ for (int i = 0; i < this.m_CachedExculsiveUI.Count; i++)
+ {
+ this.m_CachedExculsiveUI[i].uiBehaviourInterface.uiDlgInterface.SetVisiblePure(false);
+ }
+ this.ChangeTutorialClashUI(true);
+ }
+ else
+ {
+ bool flag = !this.m_ShowedDlg.Contains(dlg);
+ if (flag)
+ {
+ this.m_ShowedDlg.Add(dlg);
+ bool isHideTutorial = dlg.isHideTutorial;
+ if (isHideTutorial)
+ {
+ this.ChangeTutorialClashUI(true);
+ }
+ }
+ bool flag2 = !dlg.needOnTop;
+ if (flag2)
+ {
+ this.m_AvatarStack.Remove(dlg);
+ this.m_AvatarStack.Add(dlg);
+ }
+ else
+ {
+ Vector3 localPosition = dlg.uiBehaviourInterface.gameObject.transform.localPosition;
+ localPosition.z = 0f;
+ dlg.uiBehaviourInterface.gameObject.transform.localPosition = localPosition;
+ }
+ float num = 0f;
+ for (int j = this.m_AvatarStack.Count - 1; j >= 0; j--)
+ {
+ IXUIDlg ixuidlg = this.m_AvatarStack[j];
+ Vector3 localPosition2 = ixuidlg.uiBehaviourInterface.gameObject.transform.localPosition;
+ localPosition2.z = num;
+ ixuidlg.uiBehaviourInterface.gameObject.transform.localPosition = localPosition2;
+ num += 800f;
+ }
+ }
+ bool pushstack = dlg.pushstack;
+ if (pushstack)
+ {
+ IXUIDlg ixuidlg2 = this.m_LFU.Add(dlg);
+ bool flag3 = ixuidlg2 != null;
+ if (flag3)
+ {
+ this.m_ToBeUnloadDlg.Add(ixuidlg2);
+ XSingleton<XDebug>.singleton.AddGreenLog("Auto Unload UI: ", ixuidlg2.fileName, " while opening ", dlg.fileName, null, null);
+ }
+ XSingleton<XVirtualTab>.singleton.Cancel();
+ }
+ bool hideMainMenu = dlg.hideMainMenu;
+ if (hideMainMenu)
+ {
+ this.UIBlurEffect(true);
+ }
+ bool pushstack2 = dlg.pushstack;
+ if (pushstack2)
+ {
+ XMainInterfaceDocument specificDocument = XDocuments.GetSpecificDocument<XMainInterfaceDocument>(XMainInterfaceDocument.uuID);
+ bool flag4 = this.m_ShowUIStack.Count > 0;
+ if (flag4)
+ {
+ IXUIDlg ixuidlg3 = this.m_ShowUIStack.Peek();
+ ixuidlg3.LeaveStackTop();
+ ixuidlg3.uiBehaviourInterface.uiDlgInterface.SetVisiblePure(false);
+ Stack<IXUIDlg> stack = new Stack<IXUIDlg>();
+ IXUIDlg ixuidlg4 = this.m_ShowUIStack.Pop();
+ while (ixuidlg4 != dlg && this.m_ShowUIStack.Count > 0)
+ {
+ stack.Push(ixuidlg4);
+ ixuidlg4 = this.m_ShowUIStack.Pop();
+ }
+ bool flag5 = ixuidlg4 != dlg;
+ if (flag5)
+ {
+ this.m_ShowUIStack.Push(ixuidlg4);
+ }
+ while (stack.Count > 0)
+ {
+ this.m_ShowUIStack.Push(stack.Pop());
+ }
+ }
+ this.m_ShowUIStack.Push(dlg);
+ specificDocument.OnTopUIRefreshed(dlg);
+ }
+ DlgBase<XChatView, XChatBehaviour>.singleton.TryCloseChat(dlg);
+ }
+
+ public void UIBlurEffect(bool bOn)
+ {
+ bool flag = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsLoaded();
+ if (flag)
+ {
+ DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.FakeShowSelf(!bOn);
+ }
+ }
+
+ public void OnDlgHide(IXUIDlg dlg)
+ {
+ bool exclusive = dlg.exclusive;
+ if (exclusive)
+ {
+ for (int i = 0; i < this.m_CachedExculsiveUI.Count; i++)
+ {
+ this.m_CachedExculsiveUI[i].uiBehaviourInterface.uiDlgInterface.SetVisiblePure(true);
+ }
+ this.ChangeTutorialClashUI(false);
+ }
+ else
+ {
+ this.m_ShowedDlg.Remove(dlg);
+ bool isHideTutorial = dlg.isHideTutorial;
+ if (isHideTutorial)
+ {
+ this.ChangeTutorialClashUI(false);
+ }
+ this.m_AvatarStack.Remove(dlg);
+ }
+ bool pushstack = dlg.pushstack;
+ if (pushstack)
+ {
+ this.m_LFU.MarkCanPop(dlg, true);
+ }
+ bool hideMainMenu = dlg.hideMainMenu;
+ if (hideMainMenu)
+ {
+ this.UIBlurEffect(false);
+ }
+ bool flag = dlg.pushstack && this.m_ShowUIStack.Count > 0;
+ if (flag)
+ {
+ IXUIDlg ixuidlg = this.m_ShowUIStack.Peek();
+ bool flag2 = ixuidlg != dlg;
+ if (flag2)
+ {
+ XSingleton<XDebug>.singleton.AddLog("Not hide top of ui stack!:", dlg.fileName, null, null, null, null, XDebugColor.XDebug_None);
+ Stack<IXUIDlg> stack = new Stack<IXUIDlg>();
+ for (IXUIDlg ixuidlg2 = this.m_ShowUIStack.Pop(); ixuidlg2 != dlg; ixuidlg2 = this.m_ShowUIStack.Pop())
+ {
+ stack.Push(ixuidlg2);
+ bool flag3 = this.m_ShowUIStack.Count == 0;
+ if (flag3)
+ {
+ StringBuilder sharedStringBuilder = XSingleton<XCommon>.singleton.GetSharedStringBuilder();
+ sharedStringBuilder.Length = 0;
+ sharedStringBuilder.Append("Hide UI not in stack!!!! : ").Append(dlg.fileName);
+ sharedStringBuilder.Append("; UIs in stack: ");
+ foreach (IXUIDlg ixuidlg3 in stack)
+ {
+ sharedStringBuilder.Append(ixuidlg3.fileName).Append(" ");
+ }
+ XSingleton<XDebug>.singleton.AddErrorLog(sharedStringBuilder.ToString(), null, null, null, null, null);
+ break;
+ }
+ }
+ while (stack.Count > 0)
+ {
+ this.m_ShowUIStack.Push(stack.Pop());
+ }
+ bool flag4 = this.m_ShowUIStack.Count > 0;
+ if (flag4)
+ {
+ IXUIDlg ixuidlg4 = this.m_ShowUIStack.Peek();
+ bool hideMainMenu2 = ixuidlg4.hideMainMenu;
+ if (hideMainMenu2)
+ {
+ this.UIBlurEffect(true);
+ }
+ }
+ }
+ else
+ {
+ this.m_ShowUIStack.Pop();
+ XMainInterfaceDocument specificDocument = XDocuments.GetSpecificDocument<XMainInterfaceDocument>(XMainInterfaceDocument.uuID);
+ bool flag5 = this.m_ShowUIStack.Count > 0;
+ if (flag5)
+ {
+ IXUIDlg ixuidlg5 = this.m_ShowUIStack.Peek();
+ ixuidlg5.uiBehaviourInterface.uiDlgInterface.SetVisiblePure(true);
+ ixuidlg5.StackRefresh();
+ specificDocument.OnTopUIRefreshed(ixuidlg5);
+ bool hideMainMenu3 = ixuidlg5.hideMainMenu;
+ if (hideMainMenu3)
+ {
+ this.UIBlurEffect(true);
+ }
+ }
+ else
+ {
+ specificDocument.OnTopUIRefreshed(null);
+ }
+ }
+ }
+ }
+
+ public List<IXUIDlg> GetShowedUI()
+ {
+ return this.m_ShowedDlg;
+ }
+
+ public void ClearUIinStack()
+ {
+ while (this.m_ShowUIStack.Count > 0)
+ {
+ IXUIDlg ixuidlg = this.m_ShowUIStack.Peek();
+ bool flag = ixuidlg != null;
+ if (flag)
+ {
+ ixuidlg.SetVisiblePure(true);
+ ixuidlg.SetVisible(false, true);
+ }
+ }
+ this.UIBlurEffect(false);
+ }
+
+ public void HideAllUIWithOutCall()
+ {
+ for (int i = 0; i < this.m_ShowedDlg.Count; i++)
+ {
+ bool flag = this.m_ShowedDlg[i] == DlgBase<XShowGetItemView, XShowGetItemBehaviour>.singleton || this.m_ShowedDlg[i] == DlgBase<XChatMaqueeView, XChatMaqueeBehaviour>.singleton || this.m_ShowedDlg[i] == DlgBase<XSystemTipView, XSystemTipBehaviour>.singleton;
+ if (!flag)
+ {
+ bool flag2 = this.m_ShowedDlg[i].IsVisible();
+ if (flag2)
+ {
+ this.m_StoreUIList.Add(this.m_ShowedDlg[i]);
+ this.m_ShowedDlg[i].SetVisiblePure(false);
+ }
+ }
+ }
+ }
+
+ public void RestoreAllUIWithOutCall()
+ {
+ for (int i = 0; i < this.m_StoreUIList.Count; i++)
+ {
+ bool flag = this.m_StoreUIList[i] != null;
+ if (flag)
+ {
+ this.m_StoreUIList[i].SetVisiblePure(true);
+ }
+ }
+ this.m_StoreUIList.Clear();
+ }
+
+ private void ChangeTutorialClashUI(bool isAdd)
+ {
+ if (isAdd)
+ {
+ this.m_TutorialClashUICount++;
+ XSingleton<XDebug>.singleton.AddGreenLog("TutorialClashUICount++:" + this.m_TutorialClashUICount, null, null, null, null, null);
+ }
+ else
+ {
+ this.m_TutorialClashUICount--;
+ XSingleton<XDebug>.singleton.AddGreenLog("TutorialClashUICount--:" + this.m_TutorialClashUICount, null, null, null, null, null);
+ bool flag = this.m_TutorialClashUICount < 0;
+ if (flag)
+ {
+ this.m_TutorialClashUICount = 0;
+ XSingleton<XDebug>.singleton.AddErrorLog("TutorialClashUICount Error", null, null, null, null, null);
+ }
+ }
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs.meta b/Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs.meta
new file mode 100644
index 00000000..479bd1c0
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/UIManager.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0fd49ef83c692c14989b481f9d306410
+timeCreated: 1611403214
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs b/Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs
new file mode 100644
index 00000000..679b3431
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs
@@ -0,0 +1,139 @@
+using System;
+using UILib;
+using UnityEngine;
+using XUtliPoolLib;
+
+namespace XMainClient.UI.UICommon
+{
+ internal class VirtualJoystick : DlgBase<VirtualJoystick, VirtualJoystickBehaviour>
+ {
+ public override string fileName
+ {
+ get
+ {
+ return "Common/VirtualJoyStick";
+ }
+ }
+
+ public override int layer
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ public override bool autoload
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ private bool _bLogicalVisible;
+
+ protected override void Init()
+ {
+ this.Hide();
+ }
+
+ protected void Hide()
+ {
+ bool flag = !base.IsLoaded();
+ if (!flag)
+ {
+ base.uiBehaviour.m_Panel.gameObject.transform.localPosition = new Vector3((float)XGameUI._far_far_away, (float)XGameUI._far_far_away, 0f);
+ this._bLogicalVisible = false;
+ }
+ }
+
+ public void ShowPanel(bool bShow, Vector2 screenPos = default(Vector2))
+ {
+ Debug.Log("screenPos=" + screenPos);
+ if (bShow)
+ {
+ bool flag = !base.IsVisible();
+ if (flag)
+ {
+ this.SetVisible(true, true);
+ }
+ Vector3 vector = XSingleton<XGameUI>.singleton.UICamera.ScreenToWorldPoint(screenPos);
+ Vector3 vec = this.m_uiBehaviour.transform.InverseTransformPoint(vector);
+ Vector3 finalPos = /*this.LimitPosition(*/vec/*)*/;
+ Debug.Log("Virtual Joystick Pos = " + finalPos);
+ base.uiBehaviour.m_Panel.gameObject.transform.localPosition = finalPos;
+ bool flag2 = !this._bLogicalVisible;
+ if (flag2)
+ {
+ IXUITweenTool ixuitweenTool = base.uiBehaviour.m_Direction.GetComponent("XUIPlayTween") as IXUITweenTool;
+ ixuitweenTool.PlayTween(true, -1f);
+ }
+ this._bLogicalVisible = true;
+ }
+ else
+ {
+ this.Hide();
+ }
+ }
+
+ public void SetJoystickPos(float radius, float angle)
+ {
+ float num = this.GetPanelRadius() + this.GetJoystickRadius();
+ float num2 = (radius > num) ? num : radius;
+ float num3 = angle / 180f * 3.14159274f;
+ float num4 = Mathf.Cos(num3) * num2;
+ float num5 = -Mathf.Sin(num3) * num2;
+ base.uiBehaviour.m_Direction.gameObject.transform.localPosition = new Vector3(num4, num5, 0f);
+ }
+
+ public float GetPanelRadius()
+ {
+ bool flag = !this.m_bLoaded && this.autoload;
+ if (flag)
+ {
+ base.Load();
+ }
+ return (float)(base.uiBehaviour.m_Panel.spriteWidth / 2);
+ }
+
+ public float GetJoystickRadius()
+ {
+ bool flag = !this.m_bLoaded && this.autoload;
+ if (flag)
+ {
+ base.Load();
+ }
+ return (float)(base.uiBehaviour.m_Joystick.spriteWidth / 2 - 15);
+ }
+
+ protected Vector3 LimitPosition(Vector3 vec)
+ {
+ Vector3 result = vec;
+ int base_UI_Width = XSingleton<XGameUI>.singleton.Base_UI_Width;
+ int base_UI_Height = XSingleton<XGameUI>.singleton.Base_UI_Height;
+ float num = this.GetPanelRadius() + this.GetJoystickRadius() * 2f;
+ bool flag = vec.x - num < (float)(-(float)base_UI_Width / 2);
+ if (flag)
+ {
+ result.x = (float)(-(float)base_UI_Width / 2) + num;
+ }
+ bool flag2 = vec.x + num > (float)(base_UI_Width / 2);
+ if (flag2)
+ {
+ result.x = (float)(base_UI_Width / 2) - num;
+ }
+ bool flag3 = vec.y + num > (float)(base_UI_Height / 2);
+ if (flag3)
+ {
+ result.y = (float)(base_UI_Height / 2) - num;
+ }
+ bool flag4 = vec.y - num < (float)(-(float)base_UI_Height / 2);
+ if (flag4)
+ {
+ result.y = (float)(-(float)base_UI_Height / 2) + num;
+ }
+ return result;
+ }
+ }
+}
diff --git a/Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs.meta b/Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs.meta
new file mode 100644
index 00000000..66e596b5
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/UI/UICommon/VirtualJoystick.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0731ce81c4a25cd40b1d3e2bca49bf54
+timeCreated: 1611402967
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: