Example #1
0
 public void OnStart()
 {
     log.Info("Starting BStoMidi");
     BSEvents.menuSceneLoaded += BSEvents_menuSceneLoaded;
     BSMLSettings.instance.AddSettingsMenu("BStoMidi", "BStoMidi.UI.settings.bsml", Settings.instance);
     Settings.instance.UpdateConnection();
 }
        private void OnMenuSceneLoadedFresh()
        {
            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();
        }
Example #3
0
        /// <summary>
        /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
        /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
        /// Only use [Init] with one Constructor.
        /// </summary>
        public void Init(IPALogger logger, Config conf)
        {
            Instance = this;
            Log      = logger;

            PluginConfig.Instance = conf.Generated <PluginConfig>();
            BSMLSettings.instance.AddSettingsMenu("Replay FOV", $"ReplayFOV.Settings.bsml", SettingsController.instance);
            Log.Info("Config loaded.");

            Log.Info("Replay FOV initialized.");
        }
Example #4
0
        public override void CounterInit()
        {
            if (PluginConfig.Instance.HideDuringReplay && Utils.Utils.IsInReplay())
            {
                _logger.Info("We are in a replay, Counter hides.");
                return;
            }

            if (!Refresh())
            {
                _logger.Info("Can't Refresh");
                _logger.Info("Please check your settings about data source and the link or id.");
                return;
            }

            CreateCounter();
            Utils.GamePause.GameStart();

            try
            {
                _bpmDownloader.Start();
                _logger.Info("Start updating heart rate");
            }
            catch (Exception e)
            {
                _logger.Critical("Could not start bpm downloader.");
                _logger.Error(e.Message);
                _logger.Debug(e);
                _bpmDownloader.Stop();
                return;
            }
            Start();
            _logger.Info("Start updating counter text");
        }
Example #5
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("Fever initialized.");
     zenjector.OnGame <GameInstaller>();
 }
Example #6
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger)
 {
     Instance = this;
     Log      = logger;
     Log.Info("DontHiddenPlayButton initialized.");
     this.harmony = new Harmony(HARMONY_ID);
 }
Example #7
0
 public void Init(IPALogger logger, IPAConfig conf)
 {
     Instance        = this;
     Log             = logger;
     Config.Instance = conf.Generated <Config>();
     Log.Info($"Beat-360fyer-Plugin initialized.");
 }
Example #8
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Config conf)
 {
     Instance = this;
     Log      = logger;
     Log.Info("FireworksEverywhere initialized.");
     Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
 }
        public void Init(IPALogger logger)
        {
            Instance = this;
            Log      = logger;

            Log.Info("BeatSaberColorDetector initialized.");
        }
Example #10
0
 public void Init(IPALogger logger, Conf conf)
 {
     Instance = this;
     Log      = logger;
     Config   = conf.Generated <Config>();
     Log.Info("Lighting+ initialized.");
 }
Example #11
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger)
 {
     Instance = this;
     Log      = logger;
     Log.Info("OculusColorSpaceSetting initialized.");
     this.harmony = new Harmony(HARMONY_ID);
 }
Example #12
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Config conf)
 {
     Instance = this;
     Log      = logger;
     Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
     Log.Info("ProcessPriority initialized.");
 }
Example #13
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("SRMV2Extention initialized.");
     zenjector.OnMenu <SRMExtentionInstaller>();
 }
Example #14
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("CustomEnergyBar initialized.");
     zenjector.OnGame <GameInstaller>(false).OnlyForMultiplayer();
     zenjector.OnGame <GameInstaller>().OnlyForStandard();
 }
 public void Init(IPALogger logger, IPA.Config.Config config)
 {
     PluginConfig.Instance = config.Generated <PluginConfig>();
     Log = logger;
     Log.Info("CoverColorSaber initialized.");
     new Harmony("CoverSaber").PatchAll(Assembly.GetExecutingAssembly());
     GameplaySetup.instance.AddTab("Cover Color Saber", "CoverColorSaber.Settings.Panel.bsml", Settings.Menu.instance);
 }
Example #16
0
 public void Init(IPALogger logger, Config conf)
 {
     Instance = this;
     Log      = logger;
     PluginConfig.Instance = conf.Generated <PluginConfig>();
     Log.Info("RequiredModInstaller initialized.");
     controller = new MainViewController();
 }
        /// <summary>
        /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
        /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
        /// Only use [Init] with one Constructor.
        /// </summary>
        public void Init(IPALogger logger, Config conf)
        {
            Instance = this;
            Log      = logger;
            Log.Info("Gotta Go Fast initialized.");

            Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
        }
Example #18
0
        /// <summary>
        /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
        /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
        /// Only use [Init] with one Constructor.
        /// </summary>
        public void Init(IPALogger logger)
        {
            Instance = this;
            Log      = logger;

            Log.Info("Camera2 loaded");
            LoadShaders();
        }
Example #19
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("CameraPlusUIPlus initialized.");
     _harmony = new Harmony(HARMONY_ID);
     zenjector.OnMenu <CameraUIPlusInstaller>();
 }
Example #20
0
        public void OnEnable()
        {
            _harmonyInstance = HarmonyInstance.Create(kHarmonyId);

            logger.Info("Applying Index controller patch");

            _harmonyInstance.PatchAll();
        }
        public void OnApplicationStart()
        {
            logger.Info("Looking for BeatSaberMultiplayer");
            PluginLoader.PluginInfo beatsabermultiplayer = PluginManager.GetPluginFromId("BeatSaberMultiplayer");
            if (beatsabermultiplayer != null)
            {
                Type multiplayerClientType = beatsabermultiplayer.Metadata.Assembly.GetType("BeatSaberMultiplayer.Client");
                if (multiplayerClientType != null)
                {
                    clientInstanceField       = multiplayerClientType.GetField("instance", (BindingFlags)(-1));
                    clientInstanceInroomField = multiplayerClientType.GetField("inRoom", (BindingFlags)(-1));
                    logger.Info("BeatSaberMultiplayer found and linked.");
                }
                else
                {
                    logger.Warn("Found BeatSaberMultiplayer, but not type BeatSaberMultiplayer.Client. Multiplayer won't be shown on discord.");
                }
            }
            logger.Info("Looking for YURFit (IPA)");
#pragma warning disable CS0618
            IPlugin yurfit = PluginManager.Plugins.FirstOrDefault((IPlugin x) => x.Name == "YURfitMod");
            if (yurfit != null)
            {
                Type yurpresence = yurfit.GetType().Assembly.GetType("YURfitMod.RPC.YURpresence");
                if (yurpresence != null)
                {
                    harmonyInstance.Patch(yurpresence.GetMethod("Awake", (BindingFlags)(-1)), GetVoidPatch(), null, null);
                    harmonyInstance.Patch(yurpresence.GetMethod("Menu", (BindingFlags)(-1)), GetVoidPatch(), null, null);
                    logger.Info("YURFit found as IPA Plugin and patched.");
                }
                else
                {
                    logger.Warn("Found YURFit as IPA Plugin, but not type YURfitMod.RPC.YURpresence. There may be some conflivts between the two mods.");
                }
            }
            //Menu scene loaded
            Presence.details        = "In Menu";
            Presence.state          = string.Empty;
            Presence.startTimestamp = default(long);
            Presence.largeImageKey  = "default";
            Presence.largeImageText = "Beat Saber";
            Presence.smallImageKey  = "";
            Presence.smallImageText = "";
            DiscordRpc.UpdatePresence(Presence);
#pragma warning restore CS0618
        }
Example #22
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("HttpStatusExtention initialized.");
     zenjector.OnGame <HttpStatusExtentionInstaller>().OnlyForStandard();
     _ = ScoreDataBase.Instance.Initialize();
 }
Example #23
0
        /// <summary>
        /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
        /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
        /// Only use [Init] with one Constructor.
        /// </summary>
        public void Init(IPALogger logger, Config config)
        {
            Instance = this;
            Log      = logger;

            Settings = config.Generated <SettingsStore>();

            Log.Info("SpectroSaber initialized.");
        }
Example #24
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public Plugin(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("PlaylistManager initialized.");
     harmony = new Harmony(HarmonyId);
     zenjector.OnMenu <PlaylistViewInstaller>();
     DownloaderUtils.Init();
 }
Example #25
0
        public Plugin(IPALogger _logger)
        {
            instance = this;
            log      = _logger;
            log?.Debug("Logger initialized.");
            if (_init)
            {
                return;
            }
            _init = true;

            logger = log;

            harmonyInstance = new Harmony(HarmonyId);

            gameObject = Resources.FindObjectsOfTypeAll <MonoBehaviour>()
                         .First(c => c.GetType().Name == "PluginComponent");

            try {
                logger?.Info("Initializing");

                logger?.Info("Starting Discord RichPresence");
                var handlers = new DiscordRpc.EventHandlers();
                DiscordRpc.Initialize(DiscordAppID, ref handlers, false, string.Empty);

                logger?.Info("Fetching nonpublic fields");
                _gameplayCoreSceneSetupDataField = typeof(GameplayCoreSceneSetupData).GetField("_sceneSetupData",
                                                                                               BindingFlags.NonPublic | BindingFlags.Instance);
                _oneColorBeatmapCharacteristic =
                    typeof(GameplayCoreSceneSetupData).GetField("_oneColorBeatmapCharacteristic",
                                                                BindingFlags.NonPublic | BindingFlags.Instance);
                _90DegreeBeatmapCharacteristic =
                    typeof(GameplayCoreSceneSetupData).GetField("_90DegreeBeatmapCharacteristic",
                                                                BindingFlags.NonPublic | BindingFlags.Instance);
                _360DegreeBeatmapCharacteristic =
                    typeof(GameplayCoreSceneSetupData).GetField("_360DegreeBeatmapCharacteristic",
                                                                BindingFlags.NonPublic | BindingFlags.Instance);
                logger?.Info("Init done !");
            }
            catch (Exception e) {
                logger?.Error("Unable to initialize plugin:\n" + e);
            }
        }
        public void Init(IPA.Logging.Logger log)
        {
            if (_init)
            {
                return;
            }
            _init = true;

            logger = log;

            harmonyInstance = HarmonyInstance.Create("slaynash.discordpresence");

            gameObject = Resources.FindObjectsOfTypeAll <MonoBehaviour>().First(c => c.GetType().Name == "PluginComponent");

            try
            {
                logger.Info("Initializing");

                logger.Info("Starting Discord RichPresence");
                var handlers = new DiscordRpc.EventHandlers();
                DiscordRpc.Initialize(DiscordAppID, ref handlers, false, string.Empty);

                logger.Info("Fetching nonpublic fields");
                _gameplayCoreSceneSetupDataField = typeof(GameplayCoreSceneSetup).GetField("_sceneSetupData", BindingFlags.NonPublic | BindingFlags.Instance);
                _oneColorBeatmapCharacteristic   = typeof(GameplayCoreSceneSetup).GetField("_oneColorBeatmapCharacteristic", BindingFlags.NonPublic | BindingFlags.Instance);
                _90DegreeBeatmapCharacteristic   = typeof(GameplayCoreSceneSetup).GetField("_90DegreeBeatmapCharacteristic", BindingFlags.NonPublic | BindingFlags.Instance);
                _360DegreeBeatmapCharacteristic  = typeof(GameplayCoreSceneSetup).GetField("_360DegreeBeatmapCharacteristic", BindingFlags.NonPublic | BindingFlags.Instance);
#if DEBUG
                logger.Debug("Discord Presence - Field SceneSetup<GameplayCoreSceneSetupData>._sceneSetupData: " + _gameplayCoreSceneSetupDataField);
#endif
                if (_gameplayCoreSceneSetupDataField == null)
                {
                    logger.Error("Unable to fetch SceneSetup<GameplayCoreSceneSetupData>._sceneSetupData");
                    return;
                }

                logger.Info("Init done !");
            }
            catch (Exception e)
            {
                logger.Error("Unable to initialize plugin:\n" + e);
            }
        }
Example #27
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Config conf, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("UltimateFireworks initialized.");
     Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
     Log.Debug("Config loaded");
     _harmony = new Harmony(HARMONY_ID);
     zenjector.OnMenu <Installer.Installer>();
 }
Example #28
0
        public void Init(IPALogger logger, IPA.Config.Config conf)
        {
            Instance = this;

            Log = logger;
            Log.Info("VisibleHitboxes initialized.");

            Config.Instance = conf.Generated <Config>();
            Log.Debug("Config loaded");
        }
Example #29
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("HttpStatusExtention initialized.");
     s_harmony = new Harmony(HARMONY_ID);
     zenjector.Install <HttpStatusExtentionInstaller>(Location.Player);
     zenjector.Install <HttpStatusExtentionMenuAndGameInstaller>(Location.Menu | Location.Player);
     zenjector.Install <HttpStatusExxtentionAppInstaller>(Location.App);
 }
Example #30
0
 /// <summary>
 /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled).
 /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig.
 /// Only use [Init] with one Constructor.
 /// </summary>
 public void Init(IPALogger logger, Config conf, Zenjector zenjector)
 {
     Instance = this;
     Log      = logger;
     Log.Info("BeatmapInformation initialized.");
     Configuration.PluginConfig.Instance = conf.Generated <Configuration.PluginConfig>();
     Log.Debug("Config loaded");
     zenjector.Install <BMInfoGameInstaller>(Location.Player);
     zenjector.Install <BMInfoMenuInstaller>(Location.Menu);
 }