Exemplo n.º 1
0
    /// <summary>
    /// Go to the Previous Menu of the Hierarchy
    /// </summary>
    public void GotoPrevious()
    {
        FluxMenu PrevMenu = MenuStack.Count > 0 ? MenuStack.Pop() : null;
        FluxMenu TopMenu  = MenuStack.Count > 0 ? MenuStack.Peek() : null;

        if (TopMenu && PrevMenu)
        {
            if (CurrentMenu && CurrentMenu.IsOpen &&
                (TopMenu.GetAnimationState() == FluxMenu.AnimationState.CloseIdle && !PrevMenu.Popup) ||
                (TopMenu.GetAnimationState() == FluxMenu.AnimationState.OpenIdle && PrevMenu.Popup))
            {
                if (MenuStack.Count > 0)
                {
                    ShowMenu(TopMenu);
                }
                else
                {
                    ShowMenu(null);
                }
            }
            else
            {
                MenuStack.Push(PrevMenu);
            }
        }
        else
        {
            MenuStack.Push(PrevMenu);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Adds a Stacked Menu to the Hierarchy 
    /// </summary>
    /// <param name="menu">FluxMenu to Add to the Hierarchy</param>
    public void AddStackedMenu(FluxMenu menu)
    {
        if (CurrentMenu == menu)
            return;

        if (CurrentMenu && !CurrentMenu.IsOpen || menu.GetAnimationState() != FluxMenu.AnimationState.CloseIdle)
            return;

        if (!menu.Popup)
        {
            foreach (FluxMenu prevMenu in MenuStack)
            {
                HideMenu(prevMenu);
            }
        }

        if (CurrentMenu && CurrentMenu.Popup)
        {
            HideMenu(MenuStack.Pop());
            CurrentMenu = null;
        }

        MenuStack.Push(menu);

        ShowMenu(menu);
    }
Exemplo n.º 3
0
    /// <summary>
    /// Adds a Stacked Menu to the Hierarchy
    /// </summary>
    /// <param name="menu">FluxMenu to Add to the Hierarchy</param>
    public void AddStackedMenu(FluxMenu menu)
    {
        if (CurrentMenu == menu)
        {
            return;
        }

        if (CurrentMenu && !CurrentMenu.IsOpen || menu.GetAnimationState() != FluxMenu.AnimationState.CloseIdle)
        {
            return;
        }

        if (!menu.Popup)
        {
            foreach (FluxMenu prevMenu in MenuStack)
            {
                HideMenu(prevMenu);
            }
        }

        if (CurrentMenu && CurrentMenu.Popup)
        {
            HideMenu(MenuStack.Pop());
            CurrentMenu = null;
        }

        MenuStack.Push(menu);

        ShowMenu(menu);
    }
Exemplo n.º 4
0
    /// <summary>
    /// Removes all the Previous Hierarachy and Adds a Stacked Menu
    /// </summary>
    /// <param name="menu">FluxMenu to Add to the Hierarchy</param>
    public void SetCurrentMenu(FluxMenu menu)
    {
        if (CurrentMenu == menu)
        {
            return;
        }

        if (CurrentMenu && !CurrentMenu.IsOpen || menu.GetAnimationState() != FluxMenu.AnimationState.CloseIdle)
        {
            return;
        }

        foreach (FluxMenu prevMenu in MenuStack)
        {
            HideMenu(prevMenu);
        }

        CurrentMenu = null;

        MenuStack.Clear();

        AddStackedMenu(menu);
    }
Exemplo n.º 5
0
    /// <summary>
    /// Removes all the Previous Hierarachy and Adds a Stacked Menu
    /// </summary>
    /// <param name="menu">FluxMenu to Add to the Hierarchy</param>
    public void SetCurrentMenu(FluxMenu menu)
    {
        if (CurrentMenu == menu)
            return;

        if (CurrentMenu && !CurrentMenu.IsOpen || menu.GetAnimationState() != FluxMenu.AnimationState.CloseIdle)
            return;

        foreach (FluxMenu prevMenu in MenuStack)
        {
            HideMenu(prevMenu);
        }

        CurrentMenu = null;

        MenuStack.Clear();

        AddStackedMenu(menu);
    }