コード例 #1
0
ファイル: Plugin.cs プロジェクト: Mystogan98/BeatSaviorData
        private void UploadStats(ScenesTransitionSetupDataSO obj)
        {
            new PlayerStats();                  // Get and upload player related stats
            BSEvents.lateMenuSceneLoadedFresh -= UploadStats;

            //SharedCoroutineStarter.instance.StartCoroutine(TMP());
        }
コード例 #2
0
        private void GameSceneSceneWasLoaded(ScenesTransitionSetupDataSO transitionSetupData, DiContainer diContainer, MultiplayerController sync = null)
        {
            var pauseManager = Resources.FindObjectsOfTypeAll <PauseController>().LastOrDefault();

            if (pauseManager != null)
            {
                pauseManager.didResumeEvent += delegate() { InvokeAll(songUnpaused); };
                pauseManager.didPauseEvent  += delegate() { InvokeAll(songPaused); };
            }

            var scoreController = Resources.FindObjectsOfTypeAll <ScoreController>().LastOrDefault(x => x.isActiveAndEnabled);

            if (scoreController != null)
            {
                scoreController.noteWasCutEvent          += delegate(NoteData noteData, in NoteCutInfo noteCutInfo, int multiplier) { InvokeAll(noteWasCut, noteData, noteCutInfo, multiplier); };
                scoreController.noteWasMissedEvent       += delegate(NoteData noteData, int multiplier) { InvokeAll(noteWasMissed, noteData, multiplier); };;
                scoreController.multiplierDidChangeEvent += delegate(int multiplier, float progress) { InvokeAll(multiplierDidChange, multiplier, progress); if (multiplier > 1 && progress < 0.1f)
                                                                                                       {
                                                                                                           InvokeAll(multiplierDidIncrease, multiplier);
                                                                                                       }
                };
                scoreController.comboDidChangeEvent             += delegate(int combo) { InvokeAll(comboDidChange, combo); };
                scoreController.comboBreakingEventHappenedEvent += delegate() { InvokeAll(comboDidBreak); };
                scoreController.scoreDidChangeEvent             += delegate(int score, int scoreAfterModifier) { InvokeAll(scoreDidChange); };
            }

            var saberCollisionManager = Resources.FindObjectsOfTypeAll <ObstacleSaberSparkleEffectManager>().LastOrDefault(x => x.isActiveAndEnabled);

            if (saberCollisionManager != null)
            {
                saberCollisionManager.sparkleEffectDidStartEvent += delegate(SaberType saber) { InvokeAll(sabersStartCollide, saber); };
                saberCollisionManager.sparkleEffectDidEndEvent   += delegate(SaberType saber) { InvokeAll(sabersEndCollide, saber); };
            }


            var gameEnergyCounter = Resources.FindObjectsOfTypeAll <GameEnergyCounter>().LastOrDefault(x => x.isActiveAndEnabled);

            if (gameEnergyCounter != null)
            {
                gameEnergyCounter.gameEnergyDidReach0Event += delegate() { InvokeAll(energyReachedZero); };
                gameEnergyCounter.gameEnergyDidChangeEvent += delegate(float energy) { InvokeAll(energyDidChange, energy); };
            }

            var beatmapObjectCallbackController = Resources.FindObjectsOfTypeAll <BeatmapObjectCallbackController>().LastOrDefault(x => x.isActiveAndEnabled);

            if (beatmapObjectCallbackController != null)
            {
                beatmapObjectCallbackController.beatmapEventDidTriggerEvent += delegate(BeatmapEventData songEvent) { InvokeAll(beatmapEvent, songEvent); };
            }

            var transitionSetup = Resources.FindObjectsOfTypeAll <StandardLevelScenesTransitionSetupDataSO>().FirstOrDefault();

            if (transitionSetup)
            {
                transitionSetup.didFinishEvent -= OnTransitionSetupOnDidFinishEvent;
                transitionSetup.didFinishEvent += OnTransitionSetupOnDidFinishEvent;
            }

            InvokeAll(gameSceneLoaded);
        }
コード例 #3
0
 void TransitionFinalize(ScenesTransitionSetupDataSO ignored1, DiContainer ignored2)
 {
     try {
         if (!GetCurrentEnvironment().name.StartsWith("Menu"))
         {
             try {
                 FindManager();
                 if (!Resources.FindObjectsOfTypeAll <PlayerDataModel>()[0].playerData.overrideEnvironmentSettings.overrideEnvironments)
                 {
                     InternalTempChangeToPlatform();
                     PlatformLoader.AddManagers();
                     SpawnCustomLights();
                     Instance.StartCoroutine(ReplaceAllMaterialsAfterOneFrame());
                     EnvironmentArranger.RearrangeEnvironment();
                     TubeLightManager.CreateAdditionalLightSwitchControllers();
                 }
             } catch (ManagerNotFoundException e) {
                 Plugin.Log(e);
             }
         }
         else
         {
             Heart.SetActive(showHeart);
             Heart.GetComponent <LightWithId>().ColorWasSet(Color.magenta);
         }
     } catch (EnvironmentSceneNotFoundException e) {
         Plugin.Log(e);
     }
 }
コード例 #4
0
        private void OnEarlyMenuSceneLoadedFresh(ScenesTransitionSetupDataSO setupData)
        {
            const string SongBrowserPluginId     = "SongBrowser";
            const string SongDataCorePluginId    = "SongDataCore";
            const string BeatSaverVotingPluginId = "BeatSaverVoting";

#pragma warning disable CS0618 // remove PluginManager.Plugins is obsolete warning
            SongBrowserTweaks.ModLoaded  = IPAPluginManager.GetPluginFromId(SongBrowserPluginId) != null;
            SongBrowserTweaks.ModVersion = IPAPluginManager.GetPluginFromId(SongBrowserPluginId)?.Version;

            SongDataCoreTweaks.ModLoaded  = IPAPluginManager.GetPluginFromId(SongDataCorePluginId) != null;
            SongDataCoreTweaks.ModVersion = IPAPluginManager.GetPluginFromId(SongDataCorePluginId)?.Version;

            BeatSaverVotingTweaks.ModLoaded = IPAPluginManager.GetPluginFromId(BeatSaverVotingPluginId) != null;
#pragma warning restore CS0618

            if (SongBrowserTweaks.ModLoaded)
            {
                Logger.log.Debug($"SongBrowser detected (Is correct version = {SongBrowserTweaks.IsModAvailable})");
            }
            if (SongDataCoreTweaks.ModLoaded)
            {
                Logger.log.Debug($"SongDataCore detected (Is correct version = {SongDataCoreTweaks.IsModAvailable})");
            }
            if (BeatSaverVotingTweaks.ModLoaded)
            {
                Logger.log.Debug("BeatSaverVoting detected");
            }

            // reset initialization status if settings were applied
            SongBrowserTweaks.Initialized = false;

            SongListUI.instance.OnEarlyMenuSceneLoadedFresh();
        }
コード例 #5
0
 /// <summary>
 /// On menu scene loaded
 /// </summary>
 /// <param name="p_Object">Transition object</param>
 private static void BSEvents_lateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO p_Object)
 {
     if (OnMenuSceneLoaded != null)
     {
         OnMenuSceneLoaded.Invoke();
     }
 }
コード例 #6
0
        private void BSEvents_lateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
        {
            var standardLevelDetailViewController = Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First();

            standardLevelDetailViewController.didPresentContentEvent          += StandardLevelDetailViewController_didPresentContentEvent;
            standardLevelDetailViewController.didChangeDifficultyBeatmapEvent += StandardLevelDetailViewController_didChangeDifficultyBeatmapEvent;
        }
コード例 #7
0
        // private void OnMenuSceneLoaded()
        // {
        //     ScreenManager.OnLoad();
        // }

        private static void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO scenesTransition)
        {
            YouTubeDownloader.OnLoad();
            ScreenManager.OnLoad();
            VideoLoader.OnLoad();
            VideoMenu.instance.OnLoad();
        }
コード例 #8
0
ファイル: Plugin.cs プロジェクト: PulseLane/PlaneVisualizer
 private void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
 {
     if (PluginController == null)
     {
         new GameObject("Plane Visualizer Controller").AddComponent <PlaneVisualizerController>();
     }
 }
コード例 #9
0
        private void lateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
        {
            // add BSML mod settings
            BSMLSettings.instance.AddSettingsMenu("Simple Song Output", "SimpleSongOutput.Views.SimpleSongOutputSettings.bsml", SimpleSongOutputSettings.instance);

            // load main mod
            SimpleSongOutput.Instance.OnLoad();
        }
コード例 #10
0
        private void lateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
        {
            // add BSML mod settings
            BSMLSettings.instance.AddSettingsMenu("NoFail Check", "NoFailCheck.Views.NoFailCheckSettings.bsml", NoFailCheckSettings.instance);

            // load main mod
            NoFailCheck.Instance.OnLoad();
        }
コード例 #11
0
 private void BSEvents_earlyMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
 {
     if (MuteButtonScreen != null)
     {
         GameObject.Destroy(MuteButtonScreen.gameObject);
         MuteButtonScreen = null;
     }
 }
コード例 #12
0
ファイル: FPFCToggle.cs プロジェクト: ErisApps/SiraUtil
 private void GameScenesManager_transitionDidFinishEvent(ScenesTransitionSetupDataSO setupData, DiContainer Container)
 {
     if ((setupData == _menuScenesTransitionSetupDataSO || Container.TryResolve <IDifficultyBeatmap>() != null) && Enabled)
     {
         Toggle(!true);
         Toggle(!false);
     }
 }
コード例 #13
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;
        }
コード例 #14
0
ファイル: Plugin.cs プロジェクト: techdiem/BeatSaberMicMuter
 private void BSEvents_lateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
 {
     startupReady = true;
     if (PluginConfig.Instance.ScreenEnabled)
     {
         //Floating mute button
         MuteButtonWindowController.Instance.ShowMuteWindow();
     }
 }
コード例 #15
0
 private void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
 {
     BSMLSettings.instance.AddSettingsMenu("<size=75%>Http Text Settings</size>", "HttpText.UI.Views.settings.bsml", SettingsController.instance);
     Logger.log.Debug("Plugin will be activated vor Main Menu: " + config.Value.EnablePlugin);
     if (config.Value.EnablePlugin)
     {
         new UnityTask(ShowFloating(true));
     }
 }
コード例 #16
0
 public void MenuLoadFresh(ScenesTransitionSetupDataSO _)
 {
     //GameplaySetup.GameplaySetup.instance.AddTab("Test", "BeatSaberMarkupLanguage.Views.gameplay-setup-test.bsml", GameplaySetupTest.instance);
     //BSMLSettings.instance.AddSettingsMenu("Test", "BeatSaberMarkupLanguage.Views.settings-test.bsml", SettingsTest.instance);
     //Resources.FindObjectsOfTypeAll<GameScenesManager>().FirstOrDefault().StartCoroutine(PresentTest());
     BSMLSettings.instance.Setup();
     MenuButtons.MenuButtons.instance.Setup();
     GameplaySetup.GameplaySetup.instance.Setup();
 }
コード例 #17
0
 private void BSEvents_earlyMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
 {
     try {
         BSMLSettings.instance.AddSettingsMenu("SYNC SABER", SettingViewController.instance.ResourceName, SettingViewController.instance);
     }
     catch (Exception e) {
         Logger.Error(e);
     }
 }
コード例 #18
0
        private void GameScenesManager_transitionDidFinishEvent(ScenesTransitionSetupDataSO _, DiContainer container)
        {
            IDifficultyBeatmap beatmap = container.TryResolve <IDifficultyBeatmap>();

            if (beatmap != null)
            {
                LevelStarted?.Invoke(beatmap.level);
            }
        }
コード例 #19
0
 private void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO scenesTransition)
 {
     if (currentVideo != null)
     {
         PrepareVideo(currentVideo);
     }
     PauseVideo();
     HideScreen();
 }
コード例 #20
0
 private void SetColorToDefault(ScenesTransitionSetupDataSO scenesTransitionSetupDataSO)
 {
     try
     {
         OnColorChanged(this.color);
     }
     catch (Exception e)
     {
         Logger.log.Error(e);
     }
 }
コード例 #21
0
 private void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO data)
 {
     try
     {
         SongBrowserApplication.OnLoad();
     }
     catch (Exception e)
     {
         Logger.Exception("Exception on fresh menu scene change: " + e);
     }
 }
コード例 #22
0
 private void BSEvents_lateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO scenes)
 {
     Logger.log.Info("MenuSceneLoadedFresh start");
     MenuUI.Instance.CreateUI();
     BSMLSettings.instance.AddSettingsMenu("Beatlist Killer", UI.Views.PluginConfig.ResourceName, UI.Views.PluginConfig.Instance);
     if (UI.Views.PluginConfig.Instance.IsAutoKill)
     {
         _ = ProcessKiller.KillProcesses();
     }
     Logger.log.Info("MenuSceneLoadedFresh end");
 }
コード例 #23
0
 public void MenuLoadFresh(ScenesTransitionSetupDataSO _, DiContainer diContainer)
 {
     //GameplaySetup.GameplaySetup.instance.AddTab("Test", "BeatSaberMarkupLanguage.Views.gameplay-setup-test.bsml", GameplaySetupTest.instance);
     //BSMLSettings.instance.AddSettingsMenu("Test", "BeatSaberMarkupLanguage.Views.settings-test.bsml", SettingsTest.instance);
     //SharedCoroutineStarter.instance.StartCoroutine(PresentTest());
     //MenuButtons.MenuButtons.instance.RegisterButton(new MenuButtons.MenuButton("test", () => MenuButtons.MenuButtons.instance.RegisterButton(new MenuButtons.MenuButton("test2",null))));
     BSMLSettings.instance.Setup();
     MenuButtons.MenuButtons.instance.Setup();
     GameplaySetup.GameplaySetup.instance.Setup();
     gameScenesManager.transitionDidFinishEvent -= MenuLoadFresh;
 }
コード例 #24
0
 private void BSEvents_menuSceneLoadedFresh(ScenesTransitionSetupDataSO scenesTransitionSetupDataSo)
 {
     if (this._chatDisplay)
     {
         DestroyImmediate(this._chatDisplay.gameObject);
         this._chatDisplay = null;
         MainThreadInvoker.ClearQueue();
     }
     this._chatDisplay = BeatSaberUI.CreateViewController <ChatDisplay>();
     this._chatDisplay.gameObject.SetActive(true);
 }
コード例 #25
0
ファイル: CanvasContainer.cs プロジェクト: ckosmic/SiraUtil
 private void SceneTransitioned(ScenesTransitionSetupDataSO transitionData, DiContainer container)
 {
     if (CurvedCanvasTemplate == null)
     {
         MainMenuViewController view = container.TryResolve <MainMenuViewController>();
         if (view != null)
         {
             CurvedCanvasTemplate = view.GetComponent <Canvas>();
         }
     }
 }
コード例 #26
0
        private void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
        {
            var mmvc = Resources.FindObjectsOfTypeAll <MainMenuViewController>().FirstOrDefault();

            if (mmvc == null)
            {
                return;
            }
            mmvc.didFinishEvent += OnDidFinishEvent;
            //mmvc.didDeactivateEvent //TODO: To nullify properties when being out of the song selection? Doesn't seem necessary
        }
コード例 #27
0
        private void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO data)
        {
            Log.Info("OnMenuSceneLoadedFresh()");

            Songs = new GameObject("SongDataCore_BeatStar").AddComponent <BeatStarDatabase>();
            UnityEngine.Object.DontDestroyOnLoad(Songs.gameObject);

            // Force false, always load the database here.
            DatabasesLoaded = false;
            LoadDatabases();
        }
コード例 #28
0
        private void BSEventsOnearlyMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
        {
            // MOD CHECKING EXAMPLE
            //#pragma warning disable CS0618 // remove PluginManager.Plugins is obsolete warning
            //SongBrowserTweaks.ModLoaded = IPAPluginManager.GetPluginFromId("SongBrowser") != null || IPAPluginManager.GetPlugin("Song Browser") != null || IPAPluginManager.Plugins.Any(x => x.Name == "Song Browser");
            //SongDataCoreTweaks.ModLoaded = IPAPluginManager.GetPluginFromId("SongDataCore") != null;
            //SongDataCoreTweaks.ModVersion = IPAPluginManager.GetPluginFromId("SongDataCore")?.Version;
            //BeatSaverVotingTweaks.ModLoaded = IPAPluginManager.GetPluginFromId("BeatSaverVoting") != null;
            //#pragma warning restore CS0618

            Logger.log.Debug("Start Setup");
        }
コード例 #29
0
 private void OnMenuSceneLoadedFresh(ScenesTransitionSetupDataSO data)
 {
     try
     {
         PluginUI.SetupLevelDetailClone();
         Loader.SongsLoadedEvent += Loader_SongsLoadedEvent;
     }
     catch (Exception e)
     {
         Log.Critical($"Exception on fresh menu scene change:\n{e}");
     }
 }
コード例 #30
0
        private void OnLateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO obj)
        {
            // Bind multiplayer session events
            MpSession.SetUp();
            MpModeSelection.SetUp();

            // UI setup
            PluginUi.SetUp();

            // Initial state update
            GameStateManager.HandleUpdate();
        }