Esempio n. 1
0
 internal BeatSaberUtilities(MainSettingsModelSO mainSettingsModel, PlayerDataModel playerDataModel, Settings settings, IVRPlatformHelper vrPlatformHelper)
 {
     _mainSettingsModel = mainSettingsModel;
     _playerDataModel   = playerDataModel;
     _settings          = settings;
     _vrPlatformHelper  = vrPlatformHelper;
 }
        IEnumerator IEInstantiateAudioSource()
        {
            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().Any()));

            MainSettingsModelSO mainSettings = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();

            _maxPreviewVolume = mainSettings.volume * 0.5f;

            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().Any()));

            _songPreviewPlayer = Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().FirstOrDefault();
            _songPreviewPlayer.FadeOut(1);

            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <BeatmapLevelsModel>().Any()));

            BeatmapLevelsModel           levelsModel      = Resources.FindObjectsOfTypeAll <BeatmapLevelsModel>().FirstOrDefault();
            BeatmapLevelPackCollectionSO packCollectionSO = levelsModel.ostAndExtrasPackCollection;

            BeatmapLevelPackSO[]     levelPack         = packCollectionSO.GetField <BeatmapLevelPackSO[]>("_beatmapLevelPacks");
            BeatmapLevelCollectionSO levelCollectionSO = levelPack[5].GetField <BeatmapLevelCollectionSO>("_beatmapLevelCollection");

            BeatmapLevelSO[] levels = levelCollectionSO.GetField <BeatmapLevelSO[]>("_beatmapLevels");

            AudioClip clip = levels[1].GetField <AudioClip>("_audioClip");

            _audioSource              = new GameObject("SSAudSource").AddComponent <AudioSource>();
            _audioSource.clip         = clip;
            _audioSource.spatialBlend = 0;
            _audioSource.loop         = true;
            _audioSource.volume       = 0;
            _audioSource.time         = 20f;
            _audioSource.Play();
        }
 public CamerasController(ILoggerProvider loggerProvider, Settings settings, GameScenesManager gameScenesManager, MainSettingsModelSO mainSettingsModel)
 {
     _logger            = loggerProvider.CreateLogger <CamerasController>();
     _settings          = settings;
     _gameScenesManager = gameScenesManager;
     _mainSettingsModel = mainSettingsModel;
 }
        static void Postfix(MainSettingsModelSO ____mainSettingsModel)
        {
            useDepthTexture = ____mainSettingsModel.smokeGraphicsSettings;

            if (!isInited)
            {
                if (CamManager.baseCullingMask == 0)
                {
                    CamManager.baseCullingMask = Camera.main.cullingMask;
                }

                isInited = true;

                Plugin.Log.Notice("Game is ready, Initializing...");

                CamManager.Init();
            }
            else
            {
                foreach (var cam in CamManager.cams.Values)
                {
                    cam.UpdateDepthTextureActive();
                }
            }
        }
Esempio n. 5
0
        private void BSEvents_earlMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
        {
            settingsFlowCoordinator = Resources.FindObjectsOfTypeAll <SettingsFlowCoordinator>().FirstOrDefault();
            setting = settingsFlowCoordinator.GetPrivateField <MainSettingsModelSO>("_mainSettingsModel");

            setting.smoothCameraEnabled.didChangeEvent -= this.SmoothCameraEnabled_didChangeEvent;
            setting.smoothCameraEnabled.didChangeEvent += this.SmoothCameraEnabled_didChangeEvent;
        }
Esempio n. 6
0
 private AvatarTailor(ILoggerProvider loggerProvider, MainSettingsModelSO mainSettingsModel, PlayerDataModel playerDataModel, Settings settings, CalibrationData calibrationData, TrackedDeviceManager trackedDeviceManager)
 {
     _logger               = loggerProvider.CreateLogger <AvatarTailor>();
     _mainSettingsModel    = mainSettingsModel;
     _playerDataModel      = playerDataModel;
     _settings             = settings;
     _calibrationData      = calibrationData;
     _trackedDeviceManager = trackedDeviceManager;
 }
Esempio n. 7
0
        public void Construct(ILogger <CustomAvatarsSmoothCameraController> logger, Settings settings, MainSettingsModelSO mainSettingsModel)
        {
            _logger            = logger;
            _settings          = settings;
            _mainSettingsModel = mainSettingsModel;

            _smoothCamera = GetComponent <SmoothCamera>();
            _camera       = GetComponent <Camera>();
        }
 private void Inject(MainSettingsModelSO mainSettingsModel, ILoggerProvider loggerProvider, IAvatarInput input, SpawnedAvatar spawnedAvatar, VRPlatformHelper vrPlatformHelper, AvatarTailor tailor)
 {
     _mainSettingsModel = mainSettingsModel;
     _logger            = loggerProvider.CreateLogger <AvatarTracking>(spawnedAvatar.avatar.descriptor.name);
     _input             = input;
     _spawnedAvatar     = spawnedAvatar;
     _vrPlatformHelper  = vrPlatformHelper;
     _tailor            = tailor;
 }
        internal static bool ImportFromGame()
        {
            // Get reference to MainSettingsModelSO
            MainSettingsModelSO mainSettings = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();

            if (mainSettings == null)
            {
                Logger.log.Error("ImportFromGame: Unable to get a handle on MainSettingsModelSO. Exiting...");
                return(false);
            }

            // Check for position/rotation settings
            if (mainSettings.controllerPosition == null)
            {
                Logger.log.Error("ImportFromGame: Settings for controller position not found. Exiting...");
                return(false);
            }

            if (mainSettings.controllerRotation == null)
            {
                Logger.log.Error("ImportFromGame: Settings for controller rotation not found. Exiting...");
                return(false);
            }

            Vector3SO ctrlPos = mainSettings.controllerPosition;
            Vector3SO ctrlRot = mainSettings.controllerRotation;

            Configuration.GripCfg.PosLeft = new Int3()
            {
                x = -(int)ctrlPos.value.x * 1000,
                y = (int)ctrlPos.value.y * 1000,
                z = (int)ctrlPos.value.z * 1000
            };

            Configuration.GripCfg.RotLeft = new Int3()
            {
                x = (int)ctrlRot.value.x,
                y = -(int)ctrlRot.value.y,
                z = (int)ctrlRot.value.z
            };

            Configuration.GripCfg.PosRight = new Int3()
            {
                x = -(int)ctrlPos.value.x * 1000,
                y = (int)ctrlPos.value.y * 1000,
                z = (int)ctrlPos.value.z * 1000
            };

            Configuration.GripCfg.RotRight = new Int3()
            {
                x = (int)ctrlRot.value.x,
                y = -(int)ctrlRot.value.y,
                z = (int)ctrlRot.value.z
            };

            return(true);
        }
        private void Awake()
        {
            this.mainSettingsModel = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();

            AssetBundle assetBundle = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("AlternativePlay.Resources.alternativeplaymodels"));

            this.trackerPrefab = assetBundle.LoadAsset <GameObject>("APTracker");
            this.saberPrefab   = assetBundle.LoadAsset <GameObject>("APSaber");
            assetBundle.Unload(false);
        }
        private void Awake()
        {
            this.saberManager        = FindObjectOfType <SaberManager>();
            this.mainSettingsModel   = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();
            this.previousForwardHand = Configuration.instance.ConfigurationData.UseLeftSpear ? this.rightController : this.leftController;

            var pauseAnimationController = UnityEngine.Object.FindObjectOfType <PauseAnimationController>();

            if (pauseAnimationController != null)
            {
                pauseAnimationController.resumeFromPauseAnimationDidFinishEvent += this.ResumeFromPauseAnimationDidFinishEvent;
            }
        }
        private void Awake()
        {
            this.playerController    = FindObjectOfType <PlayerController>();
            this.mainSettingsModel   = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();
            this.previousForwardHand = ConfigOptions.instance.UseLeftSpear ? XRNode.RightHand : XRNode.LeftHand;

            var pauseAnimationController = Object.FindObjectOfType <PauseAnimationController>();

            if (pauseAnimationController != null)
            {
                pauseAnimationController.resumeFromPauseAnimationDidFinishEvent += this.ResumeFromPauseAnimationDidFinishEvent;
            }
        }
        internal static bool ExportToGame(out string statusMsg)
        {
            bool exportable = true;

            statusMsg = "";

            exportable = CheckGripCompatibility(out statusMsg);

            if (exportable)
            {
                try
                {
                    // Get reference to MainSettingsModelSO
                    MainSettingsModelSO mainSettings = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();
                    if (mainSettings == null)
                    {
                        Logger.log.Error("ImportFromGame: Unable to get a handle on MainSettingsModelSO. Exiting...");
                        return(false);
                    }

                    // Set new position vector
                    mainSettings.controllerPosition.value = new Vector3(
                        Configuration.GripCfg.PosRight.x / 1000f,
                        Configuration.GripCfg.PosRight.y / 1000f,
                        Configuration.GripCfg.PosRight.z / 1000f);

                    // Set new rotation vector. Base game settings are clamped to -180,+180 on load, hence the extra work
                    mainSettings.controllerRotation.value = new Vector3(
                        NormalizeAngle(Configuration.GripCfg.RotRight.x),
                        NormalizeAngle(Configuration.GripCfg.RotRight.y),
                        NormalizeAngle(Configuration.GripCfg.RotRight.z));

                    mainSettings.Save();
                    mainSettings.Load(true);

                    statusMsg = "Export successful.";
                }
                catch (Exception ex)
                {
                    Logger.log.Error("Error trying to export SaberTailor grip config to base game settings.");
                    Logger.log.Error(ex.ToString());
                    statusMsg = "<color=#fb484e>Unable to export to base game: Unknown error.</color>";
                }
            }
            return(exportable);
        }
Esempio n. 14
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, (_) =>
                {
Esempio n. 15
0
        private void Inject(MainSettingsModelSO mainSettingsModel, ILoggerProvider loggerProvider, IAvatarInput input, SpawnedAvatar avatar, VRPlatformHelper vrPlatformHelper, AvatarTailor tailor)
        {
            _mainSettingsModel = mainSettingsModel;
            _logger            = loggerProvider.CreateLogger <AvatarTracking>(avatar.avatar.descriptor.name);
            _input             = input;
            _avatar            = avatar;
            _vrPlatformHelper  = vrPlatformHelper;
            _tailor            = tailor;

            if (_avatar.pelvis)
            {
                _initialPelvisPose = new Pose(_avatar.pelvis.position, _avatar.pelvis.rotation);
            }
            if (_avatar.leftLeg)
            {
                _initialLeftFootPose = new Pose(_avatar.leftLeg.position, _avatar.leftLeg.rotation);
            }
            if (_avatar.rightLeg)
            {
                _initialRightFootPose = new Pose(_avatar.rightLeg.position, _avatar.rightLeg.rotation);
            }
        }
        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, (_) =>
            {
Esempio n. 17
0
        internal static bool ImportFromGame()
        {
            // Get reference to MainSettingsModelSO
            MainSettingsModelSO mainSettings = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();

            if (mainSettings == null)
            {
                Logger.log.Error("ImportFromGame: Unable to get a handle on MainSettingsModelSO. Exiting...");
                return(false);
            }

            // Check for position/rotation settings
            if (mainSettings.controllerPosition == null)
            {
                Logger.log.Error("ImportFromGame: Settings for controller position not found. Exiting...");
                return(false);
            }

            if (mainSettings.controllerRotation == null)
            {
                Logger.log.Error("ImportFromGame: Settings for controller rotation not found. Exiting...");
                return(false);
            }

            Vector3SO gameCtrlPosSO = mainSettings.controllerPosition;
            Vector3SO gameCtrlRotSO = mainSettings.controllerRotation;

            Vector3 ctrlPos = new Vector3(gameCtrlPosSO.value.x, gameCtrlPosSO.value.y, gameCtrlPosSO.value.z);
            Vector3 ctrlRot = new Vector3(gameCtrlRotSO.value.x, gameCtrlRotSO.value.y, gameCtrlRotSO.value.z);

            Configuration.GripCfg.PosLeft = new Int3()
            {
                x = -(int)Math.Round(ctrlPos.x * 1000, MidpointRounding.AwayFromZero),
                y = (int)Math.Round(ctrlPos.y * 1000, MidpointRounding.AwayFromZero),
                z = (int)Math.Round(ctrlPos.z * 1000, MidpointRounding.AwayFromZero)
            };

            Configuration.GripCfg.RotLeft = new Int3()
            {
                x = (int)Math.Round(ctrlRot.x, MidpointRounding.AwayFromZero),
                y = -(int)Math.Round(ctrlRot.y, MidpointRounding.AwayFromZero),
                z = (int)Math.Round(ctrlRot.z, MidpointRounding.AwayFromZero)
            };

            Configuration.GripCfg.PosRight = new Int3()
            {
                x = (int)Math.Round(ctrlPos.x * 1000, MidpointRounding.AwayFromZero),
                y = (int)Math.Round(ctrlPos.y * 1000, MidpointRounding.AwayFromZero),
                z = (int)Math.Round(ctrlPos.z * 1000, MidpointRounding.AwayFromZero)
            };

            Configuration.GripCfg.RotRight = new Int3()
            {
                x = (int)Math.Round(ctrlRot.x, MidpointRounding.AwayFromZero),
                y = (int)Math.Round(ctrlRot.y, MidpointRounding.AwayFromZero),
                z = (int)Math.Round(ctrlRot.z, MidpointRounding.AwayFromZero)
            };

            Configuration.Grip.UseBaseGameAdjustmentMode = true;

            return(true);
        }
Esempio n. 18
0
        public void OnActiveSceneChanged(Scene arg0, Scene scene)
        {
            if (scene.name == "MenuViewControllers")
            {
                activateDuringIsolated = false;
                Log("Switched to Menu");
                SharedCoroutineStarter.instance.StartCoroutine(GrabPP());

                var controllers = Resources.FindObjectsOfTypeAll <VRController>();
                if (controllers != null)
                {
                    foreach (VRController controller in controllers)
                    {
                        if (controller != null)
                        {
                            if (controller.ToString() == "ControllerLeft (VRController)")
                            {
                                leftController = controller;
                            }
                            if (controller.ToString() == "ControllerRight (VRController)")
                            {
                                rightController = controller;
                            }
                        }
                        //        Log(controller.ToString());
                    }
                    //                 Log("Left:" + leftController.ToString());
                    //                   Log("Right: " + rightController.ToString());
                }
            }



            if (scene.name == "GameCore")
            {
                RemovePatches();
            }
            if (_mainSettingsModel == null)
            {
                var menu = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().FirstOrDefault();
                if (menu != null)
                {
                    _mainSettingsModel = menu.GetField <MainSettingsModelSO>("_mainSettingsModel");
                    _mainSettingsModel.Load(true);
                    Log("RUMBLE: " + _mainSettingsModel.controllersRumbleEnabled.ToString());

                    if (!setDefaultRumble)
                    {
                        defaultRumble = _mainSettingsModel.controllersRumbleEnabled;
                        ModPrefs.SetInt("GameplayModifiersPlus", "GameRumbleSetting", _mainSettingsModel.controllersRumbleEnabled ? 1 : 0);
                        setDefaultRumble = true;
                        Log("Set Default Rumble Value");
                    }
                }
            }

            if (_mainSettingsModel != null)
            {
                defaultRumble = ModPrefs.GetInt("GameplayModifiersPlus", "GameRumbleSetting", -1, false) != 1 ? false : true;
                _mainSettingsModel.controllersRumbleEnabled.value = defaultRumble;
                _mainSettingsModel.Save();
            }


            paused = false;
            if (!customColorsInstalled)
            {
                if (colorA != null)
                {
                    colorA.SetColor(defColorA);
                }
                if (colorB != null)
                {
                    colorB.SetColor(defColorB);
                }
            }


            //        try
            //        {
            if (scene.name == "EmptyTransition")
            {
                Log("Resetting Chat Powers Object");
                if (chatPowers != null)
                {
                    GameObject.Destroy(chatPowers);
                }
            }
            if (chatPowers == null)
            {
                Log("Null Creation of Chat Powers Object");
                chatPowers = new GameObject("Chat Powers");
                GameObject.DontDestroyOnLoad(chatPowers);
                twitchPowers = chatPowers.AddComponent <TwitchPowers>();
            }

            //        }
            //        catch(Exception ex)
            //        {
            //           Log(ex.ToString());
            //        }

            GMPDisplay display = chatPowers.GetComponent <GMPDisplay>();

            if (display != null)
            {
                display.Destroy();
                GameObject.Destroy(display);
            }



            ReadPrefs();
            if (GMPUI.chatIntegration && twitchPluginInstalled)
            {
                if (twitchPowers != null)
                {
                    cooldowns.ResetCooldowns();
                    TwitchPowers.ResetPowers(false);
                    twitchPowers.StopAllCoroutines();
                }
                if (ChatConfig.resetChargesEachLevel)
                {
                    charges = 0;
                }
            }

            //    twitchCommands.StopAllCoroutines();
            haveSongNJS = false;
            if (soundIsPlaying == true)
            {
                gnomeSound.Stop();
            }
            soundIsPlaying = false;
            isValidScene   = false;
            playerInfo     = false;
            modifiersInit  = false;
            if (arg0.name == "EmpyTransition" && chatPowers != null)
            {
                GameObject.Destroy(chatPowers);
            }

            if (scene.name == "GameCore")
            {
                Log("Isolated: " + BS_Utils.Gameplay.Gamemode.IsIsolatedLevel);
                isValidScene = true;
                if (BS_Utils.Gameplay.Gamemode.IsIsolatedLevel && !activateDuringIsolated)
                {
                    Log("Isolated Level, not activating");
                    return;
                }
                //     Log("Pre GrabGrab");
                GameObject.Destroy(GameObject.Find("Color Setter"));
                soundEffectManager = Resources.FindObjectsOfTypeAll <NoteCutSoundEffectManager>().FirstOrDefault();
                spawnController    = Resources.FindObjectsOfTypeAll <BeatmapObjectSpawnController>().FirstOrDefault();
                energyCounter      = Resources.FindObjectsOfTypeAll <GameEnergyCounter>().First();
                energyPanel        = Resources.FindObjectsOfTypeAll <GameEnergyUIPanel>().First();
                ColorManager       = Resources.FindObjectsOfTypeAll <ColorManager>().First();
                levelData          = BS_Utils.Plugin.LevelData;
                //    Log("Post GrabGrab");
                if (spawnController != null)
                {
                    spawnController.noteDidStartJumpEvent += SpawnController_ModifiedJump;
                    spawnController.noteWasCutEvent       += SpawnController_ScaleRemoveCut;
                    spawnController.noteWasMissedEvent    += SpawnController_ScaleRemoveMiss;
                }
                else
                {
                    Log("Spawn Controller Null");
                }
                //   Log("Post GrabGrab 2");
                currentSongSpeed = levelData.GameplayCoreSceneSetupData.gameplayModifiers.songSpeedMul;

                BS_Utils.Plugin.LevelDidFinishEvent += LevelData_didFinishEvent;
                //   Log("Post GrabGrab 3");
                if (!Multiplayer.MultiMain.multiActive.Value)
                {
                    if (GMPUI.chatIntegration && ChatConfig.maxCharges > 0 && twitchPluginInstalled)
                    {
                        chatPowers.AddComponent <GMPDisplay>();
                    }
                    if (GMPUI.chatIntegration && ChatConfig.timeForCharges > 0 && twitchPluginInstalled)
                    {
                        twitchPowers.StartCoroutine(TwitchPowers.ChargeOverTime());
                    }
                }
                //   Log("Post GrabGrab 4");


                pauseManager = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().First();
                var colors = Resources.FindObjectsOfTypeAll <SimpleColorSO>();
                //    Log("Pre Color");
                foreach (SimpleColorSO color in colors)
                {
                    //     Log(color.name);
                    if (color.name == "BaseNoteColor1")
                    {
                        colorA = color;
                    }
                    if (color.name == "BaseNoteColor0")
                    {
                        colorB = color;
                    }
                }
                oldColorA.SetColor(colorA);
                oldColorB.SetColor(colorB);
                //      Log("Pre ChatInt");

                //      Log(colorA.color.ToString());
                if (GMPUI.chatIntegration && charges <= ChatConfig.maxCharges && twitchPluginInstalled)
                {
                    charges += ChatConfig.chargesPerLevel;
                    if (charges > ChatConfig.maxCharges)
                    {
                        charges = ChatConfig.maxCharges;
                    }
                    //          TryAsyncMessage("Current Charges: " + charges);
                }


                //  Log("Pre Audio/Player");
                //   ReflectionUtil.SetProperty(typeof(PracticePlugin.Plugin), "TimeScale", 1f);
                AudioTimeSync = Resources.FindObjectsOfTypeAll <AudioTimeSyncController>().FirstOrDefault();
                if (AudioTimeSync != null)
                {
                    songAudio = AudioTimeSync.GetField <AudioSource>("_audioSource");
                    if (songAudio == null)
                    {
                        Log("Audio null");
                    }
                    //              Log("Object Found");
                }
                //Get Sabers
                player = Resources.FindObjectsOfTypeAll <PlayerController>().FirstOrDefault();
                if (player != null)
                {
                    playerInfo = true;
                }
                else
                {
                    playerInfo = false;
                    Log("Player is null");
                }
                CheckGMPModifiers();
            }
        }
Esempio n. 19
0
 private void Awake()
 {
     this.mainSettingsModel = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();
 }
        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();
        }
 private void Awake()
 {
     this.saberManager      = FindObjectOfType <SaberManager>();
     this.mainSettingsModel = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();
 }
        static void Postfix(StandardLevelScenesTransitionSetupDataSO __instance, IDifficultyBeatmap difficultyBeatmap, IPreviewBeatmapLevel previewBeatmapLevel,
                            OverrideEnvironmentSettings overrideEnvironmentSettings, GameplayModifiers gameplayModifiers, ColorScheme overrideColorScheme, PlayerSpecificSettings playerSpecificSettings,
                            ref PracticeSettings practiceSettings, bool useTestNoteCutSoundEffects, MainSettingsModelSO ____mainSettingsModel)
        {
            EnvironmentInfoSO environmentInfoSO = difficultyBeatmap.GetEnvironmentInfo();

            if (overrideEnvironmentSettings is { overrideEnvironments : true })
Esempio n. 23
0
 public Preferences()
 {
     this.settings = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();
 }
Esempio n. 24
0
 public TrackedDeviceManager(ILoggerProvider loggerProvider, MainSettingsModelSO mainSettingsModel)
 {
     _mainSettingsModel = mainSettingsModel;
     _logger            = loggerProvider.CreateLogger <TrackedDeviceManager>();
 }