|
@@ -30,8 +30,14 @@ namespace GFGGame
|
|
|
private static GComponent _alertLayer;
|
|
|
private static GComponent _debugLayer;
|
|
|
private static GComponent _floatLayer;
|
|
|
+ private static bool _nowHideOthers = false;
|
|
|
|
|
|
private static Dictionary<string, List<object[]>> _goBackDatas = new Dictionary<string, List<object[]>>();
|
|
|
+
|
|
|
+ public static void Clear()
|
|
|
+ {
|
|
|
+ _viewStack.Clear();
|
|
|
+ }
|
|
|
|
|
|
public static void Init()
|
|
|
{
|
|
@@ -123,11 +129,6 @@ namespace GFGGame
|
|
|
}
|
|
|
if (hideOthers)
|
|
|
{
|
|
|
- for (int i = _viewStack.Count - 1; i >= 0; i--)
|
|
|
- {
|
|
|
- if (_viewStack[i].name != "MainUIView")
|
|
|
- _viewStack.RemoveAt(i);
|
|
|
- }
|
|
|
HideAllView(name);
|
|
|
}
|
|
|
IUIView obj = null;
|
|
@@ -171,14 +172,21 @@ namespace GFGGame
|
|
|
viewStructure.viewData = viewData;
|
|
|
viewStructure.iUIView = obj;
|
|
|
_viewStack.Add(viewStructure);
|
|
|
-
|
|
|
- if (_viewStack.Count > 1)
|
|
|
+ if (_viewStack.Count > 1 && !hideOthers)
|
|
|
_viewStack[_viewStack.Count - 2].iUIView.Hide();
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
{
|
|
|
string name = GetName(fullViewName);
|
|
@@ -206,16 +214,30 @@ namespace GFGGame
|
|
|
|
|
|
public static void HideWin(string viewName)
|
|
|
{
|
|
|
- if (_viewStack.Count > 1) {
|
|
|
+ if (_viewStack.Count > 1 && !_nowHideOthers) {
|
|
|
ViewStructure viewStructure = _viewStack[_viewStack.Count - 1];
|
|
|
- if (viewStructure.iUIView.isReturnView && viewStructure.name == viewName)
|
|
|
+ bool hasShowingView = false;
|
|
|
+ foreach (var info in _viewDic.Keys)
|
|
|
+ {
|
|
|
+ IUIView objIsShowing = _viewDic[info];
|
|
|
+ if (objIsShowing != null && objIsShowing.isShowing)
|
|
|
+ {
|
|
|
+ hasShowingView = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!hasShowingView || (viewStructure.iUIView.isReturnView && viewStructure.name == viewName))
|
|
|
{
|
|
|
- _viewStack.RemoveAt(_viewStack.Count - 1);
|
|
|
+ for (int i = 0; i < _viewStack.Count; i++) {
|
|
|
+ ET.Log.Debug("打印测试=====关闭界面========" + _viewStack[i].name);
|
|
|
+ }
|
|
|
+ if(viewStructure.iUIView.isReturnView && viewStructure.name == viewName)
|
|
|
+ _viewStack.RemoveAt(_viewStack.Count - 1);
|
|
|
+
|
|
|
if (_viewStack.Count >= 1)
|
|
|
{
|
|
|
viewStructure = _viewStack[_viewStack.Count - 1];
|
|
|
ViewManager.Show($"GFGGame.{viewStructure.name}", viewStructure.viewData);
|
|
|
-
|
|
|
foreach (var objName in _viewDic.Keys)
|
|
|
{
|
|
|
if (objName != viewStructure.name)
|
|
@@ -313,9 +335,11 @@ namespace GFGGame
|
|
|
if (kv.Key != excludeViewName)
|
|
|
{
|
|
|
if (kv.Key == typeof(FunctionOpenView).Name) continue;//功能开启界面不能强制关闭
|
|
|
+ _nowHideOthers = true;
|
|
|
Hide(kv.Key);
|
|
|
}
|
|
|
}
|
|
|
+ _nowHideOthers = false;
|
|
|
// _viewDic.Clear();
|
|
|
// foreach (string viewName in _viewDic.Keys)
|
|
|
// {
|
|
@@ -440,13 +464,13 @@ namespace GFGGame
|
|
|
ViewManager.Show<FirstChargeBonusView>(param, goBackDatas, false);
|
|
|
break;
|
|
|
case nameof(ClothingSyntheticView):
|
|
|
- ViewManager.Show<ClothingSyntheticView>(param, goBackDatas, false);
|
|
|
+ ViewManager.Show<ClothingSyntheticView>(param, goBackDatas, hideOther);
|
|
|
break;
|
|
|
case nameof(LuckyBoxView):
|
|
|
if(param.Length > 0)
|
|
|
- ViewManager.Show<LuckyBoxView>(param[0], goBackDatas, false);
|
|
|
+ ViewManager.Show<LuckyBoxView>(param[0], goBackDatas, hideOther);
|
|
|
else
|
|
|
- ViewManager.Show<LuckyBoxView>(null, goBackDatas, false);
|
|
|
+ ViewManager.Show<LuckyBoxView>(null, goBackDatas, hideOther);
|
|
|
break;
|
|
|
default:
|
|
|
ViewManager.Show($"GFGGame.{jumpId}", null, goBackDatas, hideOther, true);
|