Esempio n. 1
0
    public void OpenGUI(e_PlayerGUIWindow indexGUI)
    {
        int openedWindow = 0;

        for (short i = 0; i < ((int)e_PlayerGUIWindow.SIZE); i++)
        {
            if (i != ((int)(e_PlayerGUIWindow.Main_Menu)) && this.windows[i].IsActive && this.windows[i].IsClosable)
            {
                ++openedWindow;
            }
        }

        if (openedWindow < maximumDisplayWindowsNumber || this.windows[(int)(indexGUI)].IsActive)
        {
            this.windows[(int)(indexGUI)].IsActive = !this.windows[(int)(indexGUI)].IsActive;

            if (this.windows[(int)(indexGUI)].IsActive)
            {
                this.windows[(int)(indexGUI)].DragPosition = MultiResolutions.Rectangle(this.windows[(int)(indexGUI)].GetInitialWindowPosition());
            }
        }
        else if (!this.windows[(int)(indexGUI)].IsClosable)
        {
            this.windows[(int)(indexGUI)].IsActive = true;
        }
        else
        {
            ServiceLocator.Instance.ErrorDisplayStack.Add("You can't displays more than " + this.maximumDisplayWindowsNumber + " and main menu in the same time", e_errorDisplay.Critical);
        }
    }
Esempio n. 2
0
 public AGUIWindow <TModuleType> GetWindow(e_PlayerGUIWindow window)
 {
     return(this.windows[(int)window]);
 }