Beispiel #1
0
        public static void RefreshLoadedSongs()
        {
            if (_alwaysOwnedContent == null)
            {
                _alwaysOwnedContent = Resources.FindObjectsOfTypeAll <AlwaysOwnedContentSO>().First();
            }
            if (_primaryLevelCollection == null)
            {
                _primaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[0].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }
            if (_secondaryLevelCollection == null)
            {
                _secondaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[1].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }
            if (_tertiaryLevelCollection == null)
            {
                _tertiaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[2].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }
            if (_extrasLevelCollection == null)
            {
                _extrasLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[3].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }

            masterLevelList = new List <IPreviewBeatmapLevel>();
            masterLevelList.AddRange(_primaryLevelCollection.beatmapLevels);
            masterLevelList.AddRange(_secondaryLevelCollection.beatmapLevels);
            masterLevelList.AddRange(_tertiaryLevelCollection.beatmapLevels);
            masterLevelList.AddRange(_extrasLevelCollection.beatmapLevels);
            masterLevelList.AddRange(Loader.CustomLevelsCollection.beatmapLevels);
        }
Beispiel #2
0
        public void OpenSongsList(string songToSelectWhenLoaded = null)
        {
            if (songListViewController == null)
            {
                songListViewController = BeatSaberUI.CreateViewController <SongListViewController>();
            }
            if (_bottomViewController == null)
            {
                _bottomViewController = BeatSaberUI.CreateViewController <BottomViewController>();
            }
            if (_resultsViewController == null)
            {
                _resultsViewController = Resources.FindObjectsOfTypeAll <ResultsViewController>().First();
            }
            if (_playerDataModel == null)
            {
                _playerDataModel = Resources.FindObjectsOfTypeAll <PlayerDataModel>().First();
            }
            if (_menuLightsManager == null)
            {
                _menuLightsManager = Resources.FindObjectsOfTypeAll <MenuLightsManager>().First();
            }
            if (_soloFreePlayFlowCoordinator == null)
            {
                _soloFreePlayFlowCoordinator = Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().First();
            }
            if (_campaignFlowCoordinator == null)
            {
                _campaignFlowCoordinator = Resources.FindObjectsOfTypeAll <CampaignFlowCoordinator>().First();
            }
            if (_alwaysOwnedContent == null)
            {
                _alwaysOwnedContent = Resources.FindObjectsOfTypeAll <AlwaysOwnedContentSO>().First();
            }
            if (_primaryLevelCollection == null)
            {
                _primaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[0].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }
            if (_secondaryLevelCollection == null)
            {
                _secondaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[1].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }
            if (_tertiaryLevelCollection == null)
            {
                _tertiaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[2].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }
            if (_extrasLevelCollection == null)
            {
                _extrasLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[3].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
            }
            if (!songListViewController.isInViewControllerHierarchy || !songListViewController.isActiveAndEnabled)
            {
                SetViewControllersToNavigationController(_mainModNavigationController, new ViewController[] { songListViewController });

                songListViewController.SelectWhenLoaded(songToSelectWhenLoaded);
                songListViewController.SongListRowSelected += SongListRowSelected;
                songListViewController.ReloadPressed       += () => ReloadServerData();
                ReloadServerData();
            }
        }
        IEnumerator IEInstantiateAudioSource()
        {
            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().Any()));

            MainSettingsModelSO mainSettings = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault();

            _maxPreviewVolume = mainSettings.volume * 0.5f;

            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().Any()));

            _songPreviewPlayer = Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().FirstOrDefault();
            _songPreviewPlayer.FadeOut(1);

            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <BeatmapLevelsModel>().Any()));

            BeatmapLevelsModel           levelsModel      = Resources.FindObjectsOfTypeAll <BeatmapLevelsModel>().FirstOrDefault();
            BeatmapLevelPackCollectionSO packCollectionSO = levelsModel.ostAndExtrasPackCollection;

            BeatmapLevelPackSO[]     levelPack         = packCollectionSO.GetField <BeatmapLevelPackSO[]>("_beatmapLevelPacks");
            BeatmapLevelCollectionSO levelCollectionSO = levelPack[5].GetField <BeatmapLevelCollectionSO>("_beatmapLevelCollection");

            BeatmapLevelSO[] levels = levelCollectionSO.GetField <BeatmapLevelSO[]>("_beatmapLevels");

            AudioClip clip = levels[1].GetField <AudioClip>("_audioClip");

            _audioSource              = new GameObject("SSAudSource").AddComponent <AudioSource>();
            _audioSource.clip         = clip;
            _audioSource.spatialBlend = 0;
            _audioSource.loop         = true;
            _audioSource.volume       = 0;
            _audioSource.time         = 20f;
            _audioSource.Play();
        }
        public static CustomLevelCollectionSO ReplaceOriginal(BeatmapLevelCollectionSO original)
        {
            var newCollection = CreateInstance <CustomLevelCollectionSO>();

            newCollection.UpdateArray();

            if (beatmapCharacteristicCollection == null)
            {
                beatmapCharacteristicCollection = Resources.FindObjectsOfTypeAll <BeatmapCharacteristicCollectionSO>().FirstOrDefault().beatmapCharacteristics;
            }

            if (_standardCharacteristic == null)
            {
                _standardCharacteristic = beatmapCharacteristicCollection[0];
            }

            if (_oneSaberCharacteristic == null)
            {
                _oneSaberCharacteristic = beatmapCharacteristicCollection[1];
            }

            if (_noArrowsCharacteristic == null)
            {
                _noArrowsCharacteristic = beatmapCharacteristicCollection[2];
            }

            return(newCollection);
        }
Beispiel #5
0
        public void OnApplicationStart()
        {
            client = new Client();
            client.Start();

            Loader.SongsLoadedEvent += (Loader _, Dictionary <string, CustomPreviewBeatmapLevel> __) =>
            {
                if (_alwaysOwnedContent == null)
                {
                    _alwaysOwnedContent = Resources.FindObjectsOfTypeAll <AlwaysOwnedContentSO>().First();
                }
                if (_primaryLevelCollection == null)
                {
                    _primaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[0].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
                }
                if (_secondaryLevelCollection == null)
                {
                    _secondaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[1].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
                }
                if (_tertiaryLevelCollection == null)
                {
                    _tertiaryLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[2].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
                }
                if (_extrasLevelCollection == null)
                {
                    _extrasLevelCollection = _alwaysOwnedContent.alwaysOwnedPacks.First(x => x.packID == OstHelper.packs[3].PackID).beatmapLevelCollection as BeatmapLevelCollectionSO;
                }

                masterLevelList = new List <IPreviewBeatmapLevel>();
                masterLevelList.AddRange(_primaryLevelCollection.beatmapLevels);
                masterLevelList.AddRange(_secondaryLevelCollection.beatmapLevels);
                masterLevelList.AddRange(_tertiaryLevelCollection.beatmapLevels);
                masterLevelList.AddRange(_extrasLevelCollection.beatmapLevels);
                masterLevelList.AddRange(Loader.CustomLevelsCollection.beatmapLevels);

                client.SendSongList(masterLevelList);
            };
        }
        protected override void DidActivate(bool firstActivation, ActivationType activationType)
        {
            if (activationType == ActivationType.AddedToHierarchy)
            {
                title = Plugin.Name;

                navigationController = BeatSaberUI.CreateViewController <GenericNavigationController>();
                navigationController.didFinishEvent += (_) => mainFlowCoordinator.InvokeMethod("DismissFlowCoordinator", this, null, false);

                if (soloFreePlayFlowCoordinator == null)
                {
                    soloFreePlayFlowCoordinator = Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().First();
                }
                if (_additionalContentModel == null)
                {
                    _additionalContentModel = Resources.FindObjectsOfTypeAll <AdditionalContentModelSO>().First();
                }
                if (_primaryLevelCollection == null)
                {
                    _primaryLevelCollection = _additionalContentModel.alwaysOwnedPacks.First(x => x.packID == "OstVol1").beatmapLevelCollection as BeatmapLevelCollectionSO;
                }
                if (_secondaryLevelCollection == null)
                {
                    _secondaryLevelCollection = _additionalContentModel.alwaysOwnedPacks.First(x => x.packID == "OstVol2").beatmapLevelCollection as BeatmapLevelCollectionSO;
                }
                if (_extrasLevelCollection == null)
                {
                    _extrasLevelCollection = _additionalContentModel.alwaysOwnedPacks.First(x => x.packID == "Extras").beatmapLevelCollection as BeatmapLevelCollectionSO;
                }
                if (beatmapLevelPackCollection == null)
                {
                    beatmapLevelPackCollection = soloFreePlayFlowCoordinator.GetField <IBeatmapLevelPackCollection>("_levelPackCollection");
                }
                if (centerViewController == null)
                {
                    centerViewController = BeatSaberUI.CreateViewController <CenterViewController>();
                    centerViewController.GenerateButtonPressed += () =>
                    {
                        centerViewController.SetUIType(CenterViewController.UIType.ProgressBar);
                        GeneratePlaylistWithMinTime(centerViewController.GetTimeValue(), centerViewController.UseOnlyPreferredDifficulty ? centerViewController.PreferredDifficulty : (BeatmapDifficulty?)null, (playlist) =>
                        {
                            var duration = 0f;
                            foreach (var song in playlist)
                            {
                                duration += song.songDuration;
                                Logger.Debug($"PLAYLIST ITEM: {song.songName} ({song.songDuration})");
                            }
                            Logger.Debug($"TOTAL DURATION: {duration}");

                            centerViewController.SetUIType(CenterViewController.UIType.GenerationButton);

                            //Launch first level
                            Config.Enabled = true;
                            Plugin.instance.loadedLevels = new Queue <IBeatmapLevel>(playlist);
                            var firstMap = SongHelpers.GetClosestDifficultyPreferLower(Plugin.instance.loadedLevels.First(), centerViewController.PreferredDifficulty);

                            SongStitcher.songSwitched -= SongSwitched;
                            SongStitcher.songSwitched += SongSwitched;

                            var playerDataModel = Resources.FindObjectsOfTypeAll <PlayerDataModelSO>().First();
                            MenuTransitionsHelperSO menuTransitionHelper = Resources.FindObjectsOfTypeAll <MenuTransitionsHelperSO>().FirstOrDefault();
                            menuTransitionHelper.StartStandardLevel(firstMap, playerDataModel.currentLocalPlayer.gameplayModifiers, playerDataModel.currentLocalPlayer.playerSpecificSettings, null, "Menu", false, null, SongFinished);
                        });
                    };
                }

                ProvideInitialViewControllers(navigationController);
                SetViewControllersToNavigationConctroller(navigationController, new VRUIViewController[] { centerViewController });
            }
        }
Beispiel #7
0
        private void SetupTweaks()
        {
            _mainFlowCoordinator = FindObjectOfType <MainFlowCoordinator>();
            _mainFlowCoordinator.GetPrivateField <MainMenuViewController>("_mainMenuViewController").didFinishEvent += SongListTweaks_didFinishEvent;

            RectTransform viewControllersContainer = FindObjectsOfType <RectTransform>().First(x => x.name == "ViewControllers");

            if (initialized || PluginConfig.disableSongListTweaks)
            {
                return;
            }

            Logger.Log("Setting up song list tweaks...");

            try
            {
                var harmony = HarmonyInstance.Create("BeatSaverDownloaderHarmonyInstance");
                harmony.PatchAll(Assembly.GetExecutingAssembly());
            }
            catch (Exception e)
            {
                Logger.Log("Unable to patch level list! Exception: " + e);
            }

            _playlistsFlowCoordinator = new GameObject("PlaylistsFlowCoordinator").AddComponent <PlaylistsFlowCoordinator>();
            _playlistsFlowCoordinator.didFinishEvent += _playlistsFlowCoordinator_didFinishEvent;

            if (SongLoader.AreSongsLoaded)
            {
                _levelCollection = SongLoader.CustomLevelCollectionSO;
            }
            else
            {
                SongLoader.SongsLoadedEvent += (SongLoader sender, List <CustomLevel> levels) =>
                {
                    _levelCollection = SongLoader.CustomLevelCollectionSO;
                };
            }

            _simpleDialog = ReflectionUtil.GetPrivateField <SimpleDialogPromptViewController>(_mainFlowCoordinator, "_simpleDialogPromptViewController");
            _simpleDialog = Instantiate(_simpleDialog.gameObject, _simpleDialog.transform.parent).GetComponent <SimpleDialogPromptViewController>();

            _levelListViewController = viewControllersContainer.GetComponentInChildren <LevelPackLevelsViewController>(true);
            _levelListViewController.didSelectLevelEvent += _levelListViewController_didSelectLevelEvent;

            _levelPacksViewController = viewControllersContainer.GetComponentInChildren <LevelPacksViewController>(true);
            _levelPacksViewController.didSelectPackEvent += _levelPacksViewController_didSelectPackEvent;

            TableView     _songSelectionTableView = _levelListViewController.GetComponentsInChildren <TableView>(true).First();
            RectTransform _tableViewRectTransform = _levelListViewController.GetComponentsInChildren <RectTransform>(true).First(x => x.name == "LevelsTableView");

            _tableViewRectTransform.sizeDelta        = new Vector2(0f, -20.5f);
            _tableViewRectTransform.anchoredPosition = new Vector2(0f, -2.5f);

            Button _pageUp = _tableViewRectTransform.GetComponentsInChildren <Button>(true).First(x => x.name == "PageUpButton");

            (_pageUp.transform as RectTransform).anchoredPosition = new Vector2(0f, -1f);

            Button _pageDown = _tableViewRectTransform.GetComponentsInChildren <Button>(true).First(x => x.name == "PageDownButton");

            (_pageDown.transform as RectTransform).anchoredPosition = new Vector2(0f, 1f);

            _fastPageUpButton = Instantiate(_pageUp, _tableViewRectTransform, false);
            (_fastPageUpButton.transform as RectTransform).anchorMin        = new Vector2(0.5f, 1f);
            (_fastPageUpButton.transform as RectTransform).anchorMax        = new Vector2(0.5f, 1f);
            (_fastPageUpButton.transform as RectTransform).anchoredPosition = new Vector2(-26f, 1f);
            (_fastPageUpButton.transform as RectTransform).sizeDelta        = new Vector2(8f, 6f);
            _fastPageUpButton.GetComponentsInChildren <RectTransform>().First(x => x.name == "BG").sizeDelta        = new Vector2(8f, 6f);
            _fastPageUpButton.GetComponentsInChildren <UnityEngine.UI.Image>().First(x => x.name == "Arrow").sprite = Sprites.DoubleArrow;
            _fastPageUpButton.onClick.AddListener(delegate()
            {
                FastScrollUp(_songSelectionTableView, PluginConfig.fastScrollSpeed);
            });

            _fastPageDownButton = Instantiate(_pageDown, _tableViewRectTransform, false);
            (_fastPageDownButton.transform as RectTransform).anchorMin        = new Vector2(0.5f, 0f);
            (_fastPageDownButton.transform as RectTransform).anchorMax        = new Vector2(0.5f, 0f);
            (_fastPageDownButton.transform as RectTransform).anchoredPosition = new Vector2(-26f, -1f);
            (_fastPageDownButton.transform as RectTransform).sizeDelta        = new Vector2(8f, 6f);
            _fastPageDownButton.GetComponentsInChildren <RectTransform>().First(x => x.name == "BG").sizeDelta        = new Vector2(8f, 6f);
            _fastPageDownButton.GetComponentsInChildren <UnityEngine.UI.Image>().First(x => x.name == "Arrow").sprite = Sprites.DoubleArrow;
            _fastPageDownButton.onClick.AddListener(delegate()
            {
                FastScrollDown(_songSelectionTableView, PluginConfig.fastScrollSpeed);
            });

            _randomButton         = Instantiate(viewControllersContainer.GetComponentsInChildren <Button>(true).First(x => x.name == "PracticeButton"), _levelListViewController.rectTransform, false);
            _randomButton.onClick = new Button.ButtonClickedEvent();
            _randomButton.onClick.AddListener(() =>
            {
                int randomRow = UnityEngine.Random.Range(0, _songSelectionTableView.dataSource.NumberOfCells());
                _songSelectionTableView.ScrollToCellWithIdx(randomRow, TableView.ScrollPositionType.Beginning, false);
                _songSelectionTableView.SelectCellWithIdx(randomRow, true);
            });
            _randomButton.name = "CustomUIButton";

            (_randomButton.transform as RectTransform).anchorMin        = new Vector2(0.5f, 0.5f);
            (_randomButton.transform as RectTransform).anchorMax        = new Vector2(0.5f, 0.5f);
            (_randomButton.transform as RectTransform).anchoredPosition = new Vector2(35f, 36.25f);
            (_randomButton.transform as RectTransform).sizeDelta        = new Vector2(8.8f, 6f);

            _randomButton.SetButtonText("");
            _randomButton.SetButtonIcon(Sprites.RandomIcon);
            _randomButton.GetComponentsInChildren <UnityEngine.UI.Image>().First(x => x.name == "Stroke").sprite = Resources.FindObjectsOfTypeAll <Sprite>().First(x => x.name == "RoundRectSmallStroke");

            var _randomIconLayout = _randomButton.GetComponentsInChildren <HorizontalLayoutGroup>().First(x => x.name == "Content");

            _randomIconLayout.padding = new RectOffset(0, 0, 0, 0);

            _searchButton = _levelListViewController.CreateUIButton("CreditsButton", new Vector2(-20f, 36.25f), new Vector2(20f, 6f), SearchPressed, "Search");
            _searchButton.SetButtonTextSize(3f);
            _searchButton.ToggleWordWrapping(false);

            _sortByButton = _levelListViewController.CreateUIButton("CreditsButton", new Vector2(0f, 36.25f), new Vector2(20f, 6f), () =>
            {
                SelectTopButtons(TopButtonsState.SortBy);
            }, "Sort By");
            _sortByButton.SetButtonTextSize(3f);
            _sortByButton.ToggleWordWrapping(false);

            _playlistsButton = _levelListViewController.CreateUIButton("CreditsButton", new Vector2(20f, 36.25f), new Vector2(20f, 6f), PlaylistsButtonPressed, "Playlists");
            _playlistsButton.SetButtonTextSize(3f);
            _playlistsButton.ToggleWordWrapping(false);

            _defButton = _levelListViewController.CreateUIButton("CreditsButton", new Vector2(-20f, 36.25f), new Vector2(20f, 6f), () =>
            {
                SelectTopButtons(TopButtonsState.Select);
                SetLevels(SortMode.Default, "");
            },
                                                                 "Default");

            _defButton.SetButtonTextSize(3f);
            _defButton.ToggleWordWrapping(false);
            _defButton.gameObject.SetActive(false);

            _newButton = _levelListViewController.CreateUIButton("CreditsButton", new Vector2(0f, 36.25f), new Vector2(20f, 6f), () =>
            {
                SelectTopButtons(TopButtonsState.Select);
                SetLevels(SortMode.Newest, "");
            }, "Newest");

            _newButton.SetButtonTextSize(3f);
            _newButton.ToggleWordWrapping(false);
            _newButton.gameObject.SetActive(false);


            _difficultyButton = _levelListViewController.CreateUIButton("CreditsButton", new Vector2(20f, 36.25f), new Vector2(20f, 6f), () =>
            {
                SelectTopButtons(TopButtonsState.Select);
                SetLevels(SortMode.Difficulty, "");
            }, "Difficulty");

            _difficultyButton.SetButtonTextSize(3f);
            _difficultyButton.ToggleWordWrapping(false);
            _difficultyButton.gameObject.SetActive(false);

            _detailViewController = viewControllersContainer.GetComponentsInChildren <StandardLevelDetailViewController>(true).First(x => x.name == "LevelDetailViewController");
            _detailViewController.didChangeDifficultyBeatmapEvent += _difficultyViewController_didSelectDifficultyEvent;

            RectTransform buttonsRect = _detailViewController.GetComponentsInChildren <RectTransform>(true).First(x => x.name == "PlayButtons");

            _favoriteButton         = Instantiate(viewControllersContainer.GetComponentsInChildren <Button>(true).First(x => x.name == "PracticeButton"), buttonsRect, false);
            _favoriteButton.onClick = new Button.ButtonClickedEvent();
            _favoriteButton.onClick.AddListener(() =>
            {
                if (PluginConfig.favoriteSongs.Any(x => x.Contains(_detailViewController.selectedDifficultyBeatmap.level.levelID)))
                {
                    PluginConfig.favoriteSongs.Remove(_detailViewController.selectedDifficultyBeatmap.level.levelID);
                    PluginConfig.SaveConfig();
                    _favoriteButton.SetButtonIcon(Sprites.AddToFavorites);
                    PlaylistsCollection.RemoveLevelFromPlaylist(PlaylistsCollection.loadedPlaylists.First(x => x.playlistTitle == "Your favorite songs"), _detailViewController.selectedDifficultyBeatmap.level.levelID);
                }
                else
                {
                    PluginConfig.favoriteSongs.Add(_detailViewController.selectedDifficultyBeatmap.level.levelID);
                    PluginConfig.SaveConfig();
                    _favoriteButton.SetButtonIcon(Sprites.RemoveFromFavorites);
                    PlaylistsCollection.AddSongToPlaylist(PlaylistsCollection.loadedPlaylists.First(x => x.playlistTitle == "Your favorite songs"), new PlaylistSong()
                    {
                        levelId = _detailViewController.selectedDifficultyBeatmap.level.levelID, songName = _detailViewController.selectedDifficultyBeatmap.level.songName, level = SongDownloader.GetLevel(_detailViewController.selectedDifficultyBeatmap.level.levelID)
                    });
                }
            });
            _favoriteButton.name = "CustomUIButton";
            _favoriteButton.SetButtonIcon(Sprites.AddToFavorites);
            (_favoriteButton.transform as RectTransform).sizeDelta = new Vector2(12f, 8.8f);
            var _favoriteIconLayout = _favoriteButton.GetComponentsInChildren <HorizontalLayoutGroup>().First(x => x.name == "Content");

            _favoriteIconLayout.padding = new RectOffset(3, 3, 0, 0);
            _favoriteButton.transform.SetAsFirstSibling();

            Button practiceButton = buttonsRect.GetComponentsInChildren <Button>().First(x => x.name == "PracticeButton");

            (practiceButton.transform as RectTransform).sizeDelta = new Vector2(12f, 8.8f);
            var _practiceIconLayout = practiceButton.GetComponentsInChildren <HorizontalLayoutGroup>().First(x => x.name == "Content");

            _practiceIconLayout.padding = new RectOffset(3, 3, 0, 0);

            _deleteButton         = Instantiate(viewControllersContainer.GetComponentsInChildren <Button>(true).First(x => x.name == "PracticeButton"), buttonsRect, false);
            _deleteButton.onClick = new Button.ButtonClickedEvent();
            _deleteButton.onClick.AddListener(DeletePressed);
            _deleteButton.name = "CustomUIButton";
            _deleteButton.SetButtonIcon(Sprites.DeleteIcon);
            _deleteButton.interactable = !PluginConfig.disableDeleteButton;
            (_deleteButton.transform as RectTransform).sizeDelta = new Vector2(8.8f, 8.8f);
            _deleteButton.GetComponentsInChildren <UnityEngine.UI.Image>().First(x => x.name == "Stroke").sprite = Resources.FindObjectsOfTypeAll <Sprite>().First(x => x.name == "RoundRectSmallStroke");

            var _deleteIconLayout = _deleteButton.GetComponentsInChildren <HorizontalLayoutGroup>().First(x => x.name == "Content");

            _deleteIconLayout.padding = new RectOffset(0, 0, 1, 1);

            _deleteButton.transform.SetAsLastSibling();

            //based on https://github.com/halsafar/BeatSaberSongBrowser/blob/master/SongBrowserPlugin/UI/Browser/SongBrowserUI.cs#L192
            var statsPanel     = _detailViewController.GetComponentsInChildren <LevelParamsPanel>(true).First(x => x.name == "LevelParamsPanel");
            var statTransforms = statsPanel.GetComponentsInChildren <RectTransform>(true);
            var valueTexts     = statsPanel.GetComponentsInChildren <TextMeshProUGUI>(true).Where(x => x.name == "ValueText").ToList();

            foreach (RectTransform r in statTransforms)
            {
                if (r.name == "Separator")
                {
                    continue;
                }
                r.sizeDelta = new Vector2(r.sizeDelta.x * 0.85f, r.sizeDelta.y * 0.85f);
            }

            var _starStatTransform = Instantiate(statTransforms[1], statsPanel.transform, false);

            _starStatText = _starStatTransform.GetComponentInChildren <TextMeshProUGUI>(true);
            _starStatTransform.GetComponentInChildren <UnityEngine.UI.Image>(true).sprite = Sprites.StarFull;
            _starStatText.text = "--";

            ResultsViewController _standardLevelResultsViewController = viewControllersContainer.GetComponentsInChildren <ResultsViewController>(true).First(x => x.name == "StandardLevelResultsViewController");

            _standardLevelResultsViewController.continueButtonPressedEvent += _standardLevelResultsViewController_continueButtonPressedEvent;

            initialized = true;
        }