Beispiel #1
0
 public static void ResetWindos(string keyName)
 {
     if (mBackWindos.Count != 0)
     {
         WindosUIData wud = mBackWindos[mBackWindos.Count - 1];
         if (wud.keyWindosName == keyName)
         {
             for (int i = wud.nextUIData.Count - 1; i >= 0; i--)
             {
                 ShowWindos(wud.nextUIData[i].windosName, wud.nextUIData[i].showType, wud.nextUIData[i].arg);
             }
             ShowWindos(wud.windosName, wud.showType, wud.arg);
             mBackWindos.Remove(wud);
         }
         else
         {
             BasePlane bp = GetActiveWindos(keyName);
             if (bp != null && !GetIsCloseOther(bp.nUiType))
             {
                 ClearBackWindos();
             }
         }
     }
 }
Beispiel #2
0
        internal static void _CloseWindos(string name = "", string curOpenName = "", WinShowType type = WinShowType.WT_Normal)
        {
            if (name == "" && curOpenName == "")
            {
                ClearBackWindos();
            }

            bool isFirst = true;

            for (int i = mActivePlane.Count - 1; i >= 0; i--)
            {
                if (name == "" || mActivePlane[i].HandleID == name)
                {
                    BasePlane up = mActivePlane[i];
                    if (GetAutoIsByClose(up.nUiType) || name != "")
                    {
                        //卸载代码
                        if (IsHaveSameWinType(type, WinShowType.WT_Back))
                        {
                            WindosUIData w = new WindosUIData();
                            w.keyWindosName = curOpenName;
                            w.windosName    = up.PoolName;
                            w.showType      = up.mWinShowType;
                            w.arg           = up.mArgs;
                            if (isFirst)
                            {
                                mBackWindos.Add(w);
                                isFirst = false;
                            }
                            else
                            {
                                if (mBackWindos.Count > 0)
                                {
                                    WindosUIData widn = mBackWindos[mBackWindos.Count - 1];
                                    widn.nextUIData.Add(w);
                                }
                            }
                        }
                        mActivePlane.RemoveAt(i);

                        up.SetDelayEvent(() =>
                        {
                            if (IsHaveSameWinType(type, WinShowType.WT_Pool))
                            {
                                PushUIPool(up);
                            }
                            else
                            {
                                up.CloseClear();
                                FEngineManager.DeletObject(up);
                            }

                            if (IsHaveSameWinType(type, WinShowType.WT_Reset))
                            {
                                if (mActivePlane.Count > 0)
                                {
                                    BasePlane rplane = null;
                                    for (int p = mActivePlane.Count - 1; p >= 0; p--)
                                    {
                                        var plane = mActivePlane[p];
                                        if (plane.nUiType == UIWIND_TYPE.UI_NORMAL)
                                        {
                                            rplane = plane;
                                            break;
                                        }
                                    }

                                    if (rplane != null)
                                    {
                                        _CloseWindos(rplane.HandleID);
                                        var lastWinShow = rplane.mWinShowType;
                                        var newPlane    = ShowWindos(rplane.PoolName, WinShowType.WT_NoClose, rplane.mArgs);
                                        if (newPlane != null)
                                        {
                                            newPlane.mWinShowType = lastWinShow;
                                        }
                                    }
                                }
                            }
                        }, name != "");
                    }
                }
            }
        }