|
@@ -30,8 +30,14 @@ namespace GFGGame
|
|
private static GComponent _alertLayer;
|
|
private static GComponent _alertLayer;
|
|
private static GComponent _debugLayer;
|
|
private static GComponent _debugLayer;
|
|
private static GComponent _floatLayer;
|
|
private static GComponent _floatLayer;
|
|
|
|
+ private static bool _nowHideOthers = false;
|
|
|
|
|
|
private static Dictionary<string, List<object[]>> _goBackDatas = new Dictionary<string, List<object[]>>();
|
|
private static Dictionary<string, List<object[]>> _goBackDatas = new Dictionary<string, List<object[]>>();
|
|
|
|
+
|
|
|
|
+ public static void Clear()
|
|
|
|
+ {
|
|
|
|
+ _viewStack.Clear();
|
|
|
|
+ }
|
|
|
|
|
|
public static void Init()
|
|
public static void Init()
|
|
{
|
|
{
|
|
@@ -114,7 +120,7 @@ namespace GFGGame
|
|
/// <param name="viewData">要传递给视图的参数</param>
|
|
/// <param name="viewData">要传递给视图的参数</param>
|
|
/// <param name="goBackParams">从该视图返回的视图信息</param>
|
|
/// <param name="goBackParams">从该视图返回的视图信息</param>
|
|
/// <param name="hideOthers">是否关闭其他视图</param>
|
|
/// <param name="hideOthers">是否关闭其他视图</param>
|
|
- public static bool Show(string fullViewName, object viewData = null, object[] goBackParams = null, bool hideOthers = false, bool resetGobackParams = false)
|
|
|
|
|
|
+ public static bool Show(string fullViewName, object viewData = null, bool hideOthers = false, bool resetGobackParams = false)
|
|
{
|
|
{
|
|
string name = GetName(fullViewName);
|
|
string name = GetName(fullViewName);
|
|
if (!GameGlobal.skipCheckOpen && !FunctionOpenDataManager.Instance.CheckIsFunOpenById(name))
|
|
if (!GameGlobal.skipCheckOpen && !FunctionOpenDataManager.Instance.CheckIsFunOpenById(name))
|
|
@@ -123,11 +129,6 @@ namespace GFGGame
|
|
}
|
|
}
|
|
if (hideOthers)
|
|
if (hideOthers)
|
|
{
|
|
{
|
|
- for (int i = _viewStack.Count - 1; i >= 0; i--)
|
|
|
|
- {
|
|
|
|
- if (_viewStack[i].name != "MainUIView")
|
|
|
|
- _viewStack.RemoveAt(i);
|
|
|
|
- }
|
|
|
|
HideAllView(name);
|
|
HideAllView(name);
|
|
}
|
|
}
|
|
IUIView obj = null;
|
|
IUIView obj = null;
|
|
@@ -171,14 +172,21 @@ namespace GFGGame
|
|
viewStructure.viewData = viewData;
|
|
viewStructure.viewData = viewData;
|
|
viewStructure.iUIView = obj;
|
|
viewStructure.iUIView = obj;
|
|
_viewStack.Add(viewStructure);
|
|
_viewStack.Add(viewStructure);
|
|
-
|
|
|
|
- if (_viewStack.Count > 1)
|
|
|
|
|
|
+ if (_viewStack.Count > 1 && !hideOthers)
|
|
_viewStack[_viewStack.Count - 2].iUIView.Hide();
|
|
_viewStack[_viewStack.Count - 2].iUIView.Hide();
|
|
}
|
|
}
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //删除队列中的倒数几个
|
|
|
|
+ public static void DeleteViewStackCountDown(int count)
|
|
|
|
+ {
|
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
|
+ _viewStack.RemoveAt(_viewStack.Count-1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public static bool isViewOpen(string fullViewName)
|
|
public static bool isViewOpen(string fullViewName)
|
|
{
|
|
{
|
|
string name = GetName(fullViewName);
|
|
string name = GetName(fullViewName);
|
|
@@ -196,26 +204,38 @@ namespace GFGGame
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- public static bool Show<T>(object viewData = null, object[] goBackParams = null, bool hideOthers = false, bool resetGobackParams = false) where T : class, new()
|
|
|
|
|
|
+ public static bool Show<T>(object viewData = null, bool hideOthers = false, bool resetGobackParams = false) where T : class, new()
|
|
{
|
|
{
|
|
// string[] names = typeof(T).FullName.Split('.');
|
|
// string[] names = typeof(T).FullName.Split('.');
|
|
// string viewName = names[names.Length - 1];
|
|
// string viewName = names[names.Length - 1];
|
|
//string name = GetName(typeof(T).FullName);
|
|
//string name = GetName(typeof(T).FullName);
|
|
- return ViewManager.Show(typeof(T).FullName, viewData, null, hideOthers);
|
|
|
|
|
|
+ return ViewManager.Show(typeof(T).FullName, viewData, hideOthers);
|
|
}
|
|
}
|
|
|
|
|
|
public static void HideWin(string viewName)
|
|
public static void HideWin(string viewName)
|
|
{
|
|
{
|
|
- if (_viewStack.Count > 1) {
|
|
|
|
|
|
+ if (_viewStack.Count > 1 && !_nowHideOthers) {
|
|
ViewStructure viewStructure = _viewStack[_viewStack.Count - 1];
|
|
ViewStructure viewStructure = _viewStack[_viewStack.Count - 1];
|
|
- if (viewStructure.iUIView.isReturnView && viewStructure.name == viewName)
|
|
|
|
|
|
+ bool hasShowingView = false;
|
|
|
|
+ foreach (var info in _viewDic.Keys)
|
|
{
|
|
{
|
|
- _viewStack.RemoveAt(_viewStack.Count - 1);
|
|
|
|
|
|
+ IUIView objIsShowing = _viewDic[info];
|
|
|
|
+ if (objIsShowing != null && objIsShowing.isShowing)
|
|
|
|
+ {
|
|
|
|
+ hasShowingView = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!hasShowingView || (viewStructure.iUIView.isReturnView && viewStructure.name == viewName))
|
|
|
|
+ {
|
|
|
|
+ //关闭自己,在队列里去除
|
|
|
|
+ if(viewStructure.iUIView.isReturnView && viewStructure.name == viewName)
|
|
|
|
+ _viewStack.RemoveAt(_viewStack.Count - 1);
|
|
|
|
+
|
|
if (_viewStack.Count >= 1)
|
|
if (_viewStack.Count >= 1)
|
|
{
|
|
{
|
|
viewStructure = _viewStack[_viewStack.Count - 1];
|
|
viewStructure = _viewStack[_viewStack.Count - 1];
|
|
ViewManager.Show($"GFGGame.{viewStructure.name}", viewStructure.viewData);
|
|
ViewManager.Show($"GFGGame.{viewStructure.name}", viewStructure.viewData);
|
|
-
|
|
|
|
foreach (var objName in _viewDic.Keys)
|
|
foreach (var objName in _viewDic.Keys)
|
|
{
|
|
{
|
|
if (objName != viewStructure.name)
|
|
if (objName != viewStructure.name)
|
|
@@ -268,7 +288,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
MainDataManager.Instance.ViewType = 0;
|
|
MainDataManager.Instance.ViewType = 0;
|
|
- ViewManager.Show<MainUIView>(null, null, true);
|
|
|
|
|
|
+ ViewManager.Show<MainUIView>(null, true);
|
|
}
|
|
}
|
|
|
|
|
|
public static object[] GetGoBackDatas(string fullViewName)
|
|
public static object[] GetGoBackDatas(string fullViewName)
|
|
@@ -313,9 +333,11 @@ namespace GFGGame
|
|
if (kv.Key != excludeViewName)
|
|
if (kv.Key != excludeViewName)
|
|
{
|
|
{
|
|
if (kv.Key == typeof(FunctionOpenView).Name) continue;//功能开启界面不能强制关闭
|
|
if (kv.Key == typeof(FunctionOpenView).Name) continue;//功能开启界面不能强制关闭
|
|
|
|
+ _nowHideOthers = true;
|
|
Hide(kv.Key);
|
|
Hide(kv.Key);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ _nowHideOthers = false;
|
|
// _viewDic.Clear();
|
|
// _viewDic.Clear();
|
|
// foreach (string viewName in _viewDic.Keys)
|
|
// foreach (string viewName in _viewDic.Keys)
|
|
// {
|
|
// {
|
|
@@ -398,7 +420,7 @@ namespace GFGGame
|
|
/// 任务界面跳转
|
|
/// 任务界面跳转
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="jumpId"></param>
|
|
/// <param name="jumpId"></param>
|
|
- public static void JumpToView(string jumpId, object[] param, object[] goBackDatas, bool hideOther = false, Action onSuccess = null)
|
|
|
|
|
|
+ public static void JumpToView(string jumpId, object[] param, bool hideOther = false, Action onSuccess = null)
|
|
{
|
|
{
|
|
switch (jumpId)
|
|
switch (jumpId)
|
|
{
|
|
{
|
|
@@ -406,13 +428,13 @@ namespace GFGGame
|
|
|
|
|
|
if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
|
|
if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
|
|
{
|
|
{
|
|
- ViewManager.Show<LeagueView>(null, goBackDatas, hideOther);
|
|
|
|
|
|
+ ViewManager.Show<LeagueView>(null, hideOther);
|
|
ViewManager.Show($"GFGGame.{jumpId}");
|
|
ViewManager.Show($"GFGGame.{jumpId}");
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(nameof(LeagueView))) return;
|
|
if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(nameof(LeagueView))) return;
|
|
- ViewManager.Show<LeagueJoinView>(null, goBackDatas, hideOther, true);
|
|
|
|
|
|
+ ViewManager.Show<LeagueJoinView>(null, hideOther, true);
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -420,36 +442,36 @@ namespace GFGGame
|
|
if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(nameof(LeagueView))) return;
|
|
if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(nameof(LeagueView))) return;
|
|
if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
|
|
if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
|
|
{
|
|
{
|
|
- ViewManager.Show<LeagueView>(null, goBackDatas, hideOther);
|
|
|
|
|
|
+ ViewManager.Show<LeagueView>(null, hideOther);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- ViewManager.Show<LeagueJoinView>(null, goBackDatas, hideOther, true);
|
|
|
|
|
|
+ ViewManager.Show<LeagueJoinView>(null, hideOther, true);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case nameof(StoreView):
|
|
case nameof(StoreView):
|
|
- ViewManager.Show<StoreView>(param, goBackDatas, hideOther);
|
|
|
|
|
|
+ ViewManager.Show<StoreView>(param, hideOther);
|
|
break;
|
|
break;
|
|
case nameof(StoryChapterListView):
|
|
case nameof(StoryChapterListView):
|
|
- ViewManager.Show($"GFGGame.{jumpId}", param, goBackDatas, hideOther, true);
|
|
|
|
|
|
+ ViewManager.Show($"GFGGame.{jumpId}", param, hideOther, true);
|
|
break;
|
|
break;
|
|
case nameof(StoryChapterView):
|
|
case nameof(StoryChapterView):
|
|
- ViewManager.Show<StoryChapterView>(param[0], goBackDatas, hideOther);
|
|
|
|
|
|
+ ViewManager.Show<StoryChapterView>(param[0], hideOther);
|
|
break;
|
|
break;
|
|
case nameof(FirstChargeBonusView):
|
|
case nameof(FirstChargeBonusView):
|
|
- ViewManager.Show<FirstChargeBonusView>(param, goBackDatas, false);
|
|
|
|
|
|
+ ViewManager.Show<FirstChargeBonusView>(param, false);
|
|
break;
|
|
break;
|
|
case nameof(ClothingSyntheticView):
|
|
case nameof(ClothingSyntheticView):
|
|
- ViewManager.Show<ClothingSyntheticView>(param, goBackDatas, false);
|
|
|
|
|
|
+ ViewManager.Show<ClothingSyntheticView>(param, hideOther);
|
|
break;
|
|
break;
|
|
case nameof(LuckyBoxView):
|
|
case nameof(LuckyBoxView):
|
|
if(param.Length > 0)
|
|
if(param.Length > 0)
|
|
- ViewManager.Show<LuckyBoxView>(param[0], goBackDatas, false);
|
|
|
|
|
|
+ ViewManager.Show<LuckyBoxView>(param[0], hideOther);
|
|
else
|
|
else
|
|
- ViewManager.Show<LuckyBoxView>(null, goBackDatas, false);
|
|
|
|
|
|
+ ViewManager.Show<LuckyBoxView>(null, hideOther);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- ViewManager.Show($"GFGGame.{jumpId}", null, goBackDatas, hideOther, true);
|
|
|
|
|
|
+ ViewManager.Show($"GFGGame.{jumpId}", null, hideOther, true);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
onSuccess?.Invoke();
|
|
onSuccess?.Invoke();
|