예제 #1
0
        public void EnterMainMenuRoot()
        {
            Debug.Log("Entering Main Menu");
            UiState = UiInputState.MainMenu;
            // TODO: pull this debug text into the main menu manager
            if (PrintScreenSizeDebugText)
            {
                DebugTextbox.SetActive(true);
            }
            TransitionToUIElements(
                UiElementTransitionType.Fresh,
                UIElements.MainMenu
                );
            CameraTransition(CameraRoles.MainMenuAndOrrery
                             | CameraRoles.FixedUi);

            DebugCheckMainMenuCamera();
        }
예제 #2
0
 public void EnteringMultiplayerGame(string hostIP)
 {
     Debug.Log("Entering Multiplayer Game");
     // TODO: change to start in ship selection
     UiState = UiInputState.InGame;
     //TransitionToUIElements(
     //    UiElementTransitionType.Fresh,
     //    UIElements.GameplayUI
     //);
     //CameraTransition(CameraRoles.FixedUi);
     if ((ActiveUIElements & UIElements.PingDisplay) > 0)
     {
         Debug.Log("Activating Ping Tester");
         PingTester PingTester
             = ComponentRegistry
               .RetrieveManager <PingTester>(UIElements.PingDisplay);
         PingTester.TestingIPAddress = hostIP;
         PingTester.ShouldTest       = true;
     }
 }
예제 #3
0
 public void EnteringOrrery()
 {
     UiState = UiInputState.Orrery;
 }
예제 #4
0
        TransitionToUIElements
            (UiElementTransitionType transitionType,
            UIElements newUIElements)
        {
            if (UITransitionsOnHold)
            {
                // Queue this to be played later,
                // then exit early
                DelayedTransitions.Enqueue(
                    new UiElementTransition(transitionType, newUIElements)
                    );
                return;
            }
            // Add current active elements as a new history element
            if (transitionType == UiElementTransitionType.Tracked)
            {
                UITransitionHistory.Push(ActiveUIElements);
            }

            // Deactivate current UIElements
            if (transitionType == UiElementTransitionType.Fresh ||
                transitionType == UiElementTransitionType.Tracked)
            {
                //Debug.Log("TransitionToUIElements hiding elements " + ActiveUIElements);
                // Avoid deactivating persistent elements
                UIElements ElementsToDeactivate = ActiveUIElements;
                showUIElementFromFlags(false, ElementsToDeactivate);
                ActiveUIElements = UIElements.None;
            }

            // Deactivate newUIElements
            if (transitionType == UiElementTransitionType.Subtractive)
            {
                showUIElementFromFlags(false, newUIElements);
                // Remove deactivated elements from ActiveUIElements
                UIElements DeactivatedComponents
                    = newUIElements & ActiveUIElements;
                ActiveUIElements ^= DeactivatedComponents;
            }
            // Activate new UIElements
            else // transitionType != UiElementTransitionType.Subtractive
            {
                //Debug.Log("TransitionToUIElements showing elements " + newUIElements);
                showUIElementFromFlags(true, newUIElements);
                ActiveUIElements |= newUIElements;
            }

            // Clear history
            if (transitionType == UiElementTransitionType.Fresh)
            {
                UITransitionHistory.Clear();
            }

            // Set input state
            // There's a hard priority here so higher elements
            // will take precedence

            // if gameplay UI is active
            if ((ActiveUIElements & UIElements.GameplayUI) > 0)
            {
                UiState = UiInputState.InGame;
            }
            // if orrery UI is active
            else if ((ActiveUIElements & UIElements.OrreryUI) > 0)
            {
                UiState = UiInputState.Orrery;
            }
            // if main menu UI is active
            else if ((ActiveUIElements & UIElements.MainMenu) > 0)
            {
                UiState = UiInputState.MainMenu;
            }
        }