Example #1
0
        protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling)
        {
            if (addedToHierarchy)
            {
                showBackButton = true;
                SetTitle("Counters+");

                persistentScenes = GSMPersistentScenes(ref gameScenesManager); // Get our hashset of persistent scenes
                mainSettings     = SFCMainSettingsModel(ref settingsFlowCoordinator);

                persistentScenes.Add("MenuViewControllers"); // Make sure our menu persists through the transition
                persistentScenes.Add("MenuCore");
                persistentScenes.Add("Menu");

                var tutorialSceneSetup = MTHTutorialScenesSetup(ref menuTransitionsHelper); // Grab the scene transition setup data
                tutorialSceneSetup.Init();

                // We're actually transitioning to the Tutorial sequence, but disabling the tutorial itself from starting.
                gameScenesManager.PushScenes(tutorialSceneSetup, 0.25f, null, (_) =>
                {
        public void DoSceneTransition(Action callback = null)
        {
            if (hasTransitioned)
            {
                return;
            }

            hasTransitioned = true;

            persistentScenes = GSMPersistentScenes(ref gameScenesManager); // Get our hashset of persistent scenes
            mainSettings     = SFCMainSettingsModel(ref settingsFlowCoordinator);

            // Make sure our menu persists through the transition
            persistentScenes.Add("MenuCore");

            var tutorialSceneSetup = MTHTutorialScenesSetup(ref menuTransitionsHelper); // Grab the scene transition setup data

            tutorialSceneSetup.Init(playerDataModel.playerData.playerSpecificSettings);

            menuEnvironmentManager.ShowEnvironmentType(MenuEnvironmentManager.MenuEnvironmentType.None);

            // We're actually transitioning to the Tutorial sequence, but disabling the tutorial itself from starting.
            gameScenesManager.PushScenes(tutorialSceneSetup, 0.25f, null, (_) =>
            {
        protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling)
        {
            if (addedToHierarchy)
            {
                showBackButton = true;
                SetTitle("Counters+");

                persistentScenes = GSMPersistentScenes(ref gameScenesManager); // Get our hashset of persistent scenes
                mainSettings     = SFCMainSettingsModel(ref settingsFlowCoordinator);

                persistentScenes.Add("MenuViewControllers"); // Make sure our menu persists through the transition
                persistentScenes.Add("MenuCore");
                persistentScenes.Add("Menu");

                var tutorialSceneSetup = MTHTutorialScenesSetup(ref menuTransitionsHelper); // Grab the scene transition setup data
                tutorialSceneSetup.Init();

                // We're actually transitioning to the Tutorial sequence, but disabling the tutorial itself from starting.
                gameScenesManager.PushScenes(tutorialSceneSetup, 0.25f, null, (_) =>
                {
                    // god this makes me want to retire from beat saber modding
                    void DisableAllNonImportantObjects(Transform original, Transform source, IEnumerable <string> importantObjects)
                    {
                        foreach (Transform child in source)
                        {
                            if (importantObjects.Contains(child.name))
                            {
                                Transform loopback = child;
                                while (loopback != original)
                                {
                                    loopback.gameObject.SetActive(true);
                                    loopback = loopback.parent;
                                }
                            }
                            else
                            {
                                child.gameObject.SetActive(false);
                                DisableAllNonImportantObjects(original, child, importantObjects);
                            }
                        }
                    }


                    // Disable the tutorial from actually starting. I dont think there's a better way to do this...
                    Transform tutorial = GameObject.Find("TutorialGameplay").transform;

                    if (mainSettings.screenDisplacementEffectsEnabled)
                    {
                        // Disable menu shockwave to forget about rendering order problems
                        menuShockwave.gameObject.SetActive(false);
                    }

                    // Reset menu audio to original state.
                    songPreviewPlayer.CrossfadeToDefault();

                    // When not in FPFC, disable the Menu input, and re-enable the Tutorial menu input
                    if (!Environment.GetCommandLineArgs().Any(x => x.ToLower() == "fpfc"))
                    {
                        vrInputModule.gameObject.SetActive(false);

                        DisableAllNonImportantObjects(tutorial, tutorial, new string[]
                        {
                            "EventSystem",
                            "ControllerLeft",
                            "ControllerRight"
                        });
                    }
                    else // If we're in FPFC, just disable everything as usual.
                    {
                        DisableAllNonImportantObjects(tutorial, tutorial, Array.Empty <string>());
                    }
                });
            }

            //fadeInOutController.FadeIn(1f, () => FadeInCallback(MenuEnvironmentManager.MenuEnvironmentType.Lobby));

            PushViewControllerToNavigationController(mainScreenNavigation, blank);
            PushViewControllerToNavigationController(settingsSelection, horizontalSettingsList);

            ProvideInitialViewControllers(mainScreenNavigation, credits, null, settingsSelection);

            RefreshAllMockCounters();
        }