Пример #1
0
        public void OnApplicationStart()
        {
            string steamDllPath    = Path.Combine(IPA.Utilities.UnityGame.InstallPath, "Beat Saber_Data", "Plugins", "steam_api64.dll");
            bool   hasSteamDll     = File.Exists(steamDllPath);
            string platform        = hasSteamDll ? "steam" : "oculus";
            string gameVersionFull = $"{IPA.Utilities.UnityGame.GameVersion.ToString()}-{platform}";

            var httpOptions = new BeatSaverSharp.HttpOptions()
            {
                ApplicationName = "BeatSaverDownloader",
                Version         = Assembly.GetExecutingAssembly().GetName().Version,

                Agents = new BeatSaverSharp.ApplicationAgent[1]
                {
                    new BeatSaverSharp.ApplicationAgent("BeatSaber", gameVersionFull),
                },
            };

            BeatSaver = new BeatSaverSharp.BeatSaver(httpOptions);

            instance = this;
            PluginConfig.LoadConfig();
            Sprites.ConvertToSprites();

            PluginUI.instance.Setup();

            BS_Utils.Utilities.BSEvents.menuSceneLoadedFresh += OnMenuSceneLoadedFresh;
            SceneManager.activeSceneChanged += OnActiveSceneChanged;
            SceneManager.sceneLoaded        += OnSceneLoaded;
        }
Пример #2
0
        public void OnApplicationStart()
        {
            var steamDllPath = Path.Combine(
                UnityGame.InstallPath,
                "Beat Saber_Data",
                "Plugins",
                "steam_api64.dll");
            var hasSteamDll     = File.Exists(steamDllPath);
            var platform        = hasSteamDll ? "steam" : "oculus";
            var gameVersionFull = $"{UnityGame.GameVersion}-{platform}";
            var httpAgent       = new HttpAgent("BeatSaber", gameVersionFull);
            var agentList       = new List <HttpAgent> {
                httpAgent
            };
            var httpOptions = new HttpOptions(
                "BeatSaverDownloader",
                Assembly.GetExecutingAssembly().GetName().Version,
                agents: agentList
                );

            BeatSaver = new BeatSaver(httpOptions);

            PluginConfig.LoadConfig();
            Sprites.ConvertToSprites();
            PluginUI.instance.Setup();

            BSEvents.earlyMenuSceneLoadedFresh += OnMenuSceneLoadedFresh;
            SceneManager.activeSceneChanged    += OnActiveSceneChanged;
            SceneManager.sceneLoaded           += OnSceneLoaded;
        }
Пример #3
0
        public void OnApplicationStart()
        {
            instance = this;
            PluginConfig.LoadConfig();
            Sprites.ConvertToSprites();
            PlaylistsCollection.ReloadPlaylists();
            SongLoader.SongsLoadedEvent += SongLoader_SongsLoadedEvent;

            BSEvents.OnLoad();
            BSEvents.menuSceneLoadedFresh += OnMenuSceneLoadedFresh;
        }