Ejemplo n.º 1
0
 public void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode)
 {
     if (scene.buildIndex != SongLoader.MenuIndex)
     {
         return;
     }
     SongLoader.OnLoad();
 }
Ejemplo n.º 2
0
 public void OnLevelWasInitialized(int level)
 {
     if (level != SongLoader.MenuIndex)
     {
         return;
     }
     SongLoader.OnLoad();
 }
Ejemplo n.º 3
0
 private void SongLoaderOnSongsLoadedEvent(SongLoader arg1, List <CustomLevel> arg2)
 {
     _showingMessage       = false;
     _headerText.text      = arg2.Count + " songs loaded";
     _loadingBar.enabled   = false;
     _loadingBackg.enabled = false;
     StartCoroutine(DisableCanvasRoutine(5f));
 }
Ejemplo n.º 4
0
 private void SongLoaderOnLoadingStartedEvent(SongLoader obj)
 {
     _showingMessage       = false;
     _headerText.text      = HeaderText;
     _loadingBar.enabled   = true;
     _loadingBackg.enabled = true;
     _canvas.enabled       = true;
 }
Ejemplo n.º 5
0
        private void Awake()
        {
            Instance = this;
            RefreshSongs();
            SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
            SceneManagerOnActiveSceneChanged(new Scene(), new Scene());

            DontDestroyOnLoad(gameObject);
        }
Ejemplo n.º 6
0
 public void OnApplicationStart()
 {
     _sceneEvents = new GameObject("menu-signal").AddComponent <SceneEvents>();
     _sceneEvents.MenuSceneEnabled += OnMenuSceneEnabled;
     harmony = HarmonyInstance.Create("com.xyoncio.BeatSaber.SongLoaderPlugin");
     harmony.PatchAll(System.Reflection.Assembly.GetExecutingAssembly());
     SongLoader.GetIcons();
     SongLoader.RegisterCustomCharacteristic(SongLoader.MissingCharIcon, "Missing Characteristic", "Missing Characteristic", "MissingCharacteristic", "MissingCharacteristic");
     SongLoader.RegisterCustomCharacteristic(SongLoader.LightshowIcon, "Lightshow", "Lightshow", "Lightshow", "Lightshow");
     SongLoader.RegisterCustomCharacteristic(SongLoader.ExtraDiffsIcon, "Lawless", "Lawless - These difficulties don't follow conventional standards, and should not necessarily be expected to reflect their given names.", "Lawless", "Lawless");
 }
Ejemplo n.º 7
0
        private void Awake()
        {
            Instance = this;

            _minLogSeverity = Environment.CommandLine.Contains("--mute-song-loader")
                                ? LogSeverity.Error
                                : LogSeverity.Info;

            CreateCustomLevelCollections();
            SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
            SceneManagerOnActiveSceneChanged(new Scene(), SceneManager.GetActiveScene());
            _progressBar = ProgressBar.Create();

            RefreshSongs();

            DontDestroyOnLoad(gameObject);
        }
Ejemplo n.º 8
0
        private void Awake()
        {
            Instance = this;

            _minLogSeverity = Environment.CommandLine.Contains("--mute-song-loader")
                                ? LogSeverity.Error
                                : LogSeverity.Info;

            _progressBar = ProgressBar.Create();

            OnSceneTransitioned(SceneManager.GetActiveScene());
            RefreshSongs();

            DontDestroyOnLoad(gameObject);

            SceneEvents.Instance.SceneTransitioned += OnSceneTransitioned;
        }
Ejemplo n.º 9
0
        private void Awake()
        {
            Instance = this;

            bool shouldScan = !File.Exists(Environment.CurrentDirectory + "\\songs.sqlite");

            _database = new Database(Environment.CurrentDirectory);
            if (shouldScan)
            {
                Logger.Log("First run, building database");
                _database.UpdateSongDB(GetAllSongFolders().ToArray(), true);
            }
            RefreshSongs();
            SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged;
            SceneManagerOnActiveSceneChanged(new Scene(), new Scene());

            DontDestroyOnLoad(gameObject);
        }
Ejemplo n.º 10
0
        public void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode)
        {
            if (scene.name == "MenuViewControllers")
            {
                if (SongLoader.reqDialog == null)
                {
                    SongLoader.InitRequirementsMenu();
                }

                var subMenuCC = GameplaySettingsUI.CreateSubmenuOption(GameplaySettingsPanels.PlayerSettingsLeft, "Song Loader", "MainMenu",
                                                                       "songloader", "Songloader Options");

                var colorOverrideOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsLeft, "Allow Custom Song Colors",
                                                                                "songloader", "Allow Custom Songs to override note/light colors if Custom Colors or Chroma is installed");
                colorOverrideOption.GetValue  = ModPrefs.GetBool("Songloader", "customSongColors", true, true);
                colorOverrideOption.OnToggle += delegate(bool value) { ModPrefs.SetBool("Songloader", "customSongColors", value); };

                var platformOverrideOption = GameplaySettingsUI.CreateToggleOption(GameplaySettingsPanels.PlayerSettingsLeft, "Allow Custom Song Platforms",
                                                                                   "songloader", "Allow Custom Songs to override your Custom Platform if Custom Platforms is installed");
                platformOverrideOption.GetValue  = ModPrefs.GetBool("Songloader", "customSongPlatforms", true, true);
                platformOverrideOption.OnToggle += delegate(bool value) { ModPrefs.SetBool("Songloader", "customSongPlatforms", value); };
            }
        }
Ejemplo n.º 11
0
 private void OnMenuSceneEnabled()
 {
     SongLoader.OnLoad();
 }