Esempio n. 1
0
        public void OnApplicationStart()
        {
#if DEBUG
            if (Environment.CommandLine.Contains("fpfc"))
            {
                QualitySettings.vSyncCount  = 2;
                Application.targetFrameRate = 60;
            }
#endif

            instance = this;

#if DEBUG
            DebugForm.OnLoad();
#endif

            BSEvents.OnLoad();
            BSEvents.menuSceneLoadedFresh += MenuSceneLoadedFresh;
            BSEvents.menuSceneLoaded      += MenuSceneLoaded;
            BSEvents.gameSceneLoaded      += GameSceneLoaded;

            if (Config.Load())
            {
                log.Info("Loaded config!");
            }
            else
            {
                Config.Create();
            }

            try
            {
                PresetsCollection.ReloadPresets();
            }
            catch (Exception e)
            {
                log.Warn("Unable to load presets! Exception: " + e);
            }

            Sprites.ConvertSprites();

            ScrappedData.Instance.DownloadScrappedData(null);

            try
            {
                var harmony = HarmonyInstance.Create("com.andruzzzhka.BeatSaberMultiplayer");
                harmony.PatchAll(Assembly.GetExecutingAssembly());
            }
            catch (Exception e)
            {
                Plugin.log.Info("Unable to patch assembly! Exception: " + e);
            }
        }
Esempio n. 2
0
        public void OnApplicationStart()
        {
#if DEBUG
            if (Environment.CommandLine.Contains("fpfc"))
            {
                QualitySettings.vSyncCount = 1;
            }
#endif

            if (File.Exists("MPLog.txt"))
            {
                File.Delete("MPLog.txt");
            }

            instance = this;

#if DEBUG
            DebugForm.OnLoad();
#endif

            BSEvents.OnLoad();
            BSEvents.menuSceneLoadedFresh += MenuSceneLoadedFresh;
            BSEvents.menuSceneLoaded      += MenuSceneLoaded;
            BSEvents.gameSceneLoaded      += GameSceneLoaded;

            if (Config.Load())
            {
                Misc.Logger.Info("Loaded config!");
            }
            else
            {
                Config.Create();
            }
            try
            {
                PresetsCollection.ReloadPresets();
            }
            catch (Exception e)
            {
                Misc.Logger.Warning("Unable to load presets! Exception: " + e);
            }
            Sprites.ConvertSprites();

            ScrappedData.Instance.DownloadScrappedData(null);
        }