예제 #1
0
    public void OnSearchTextChanged()
    {
        SongMeta lastSelectedSong = SelectedSong;
        string   searchText       = searchTextInputField.Text.ToLower();

        if (string.IsNullOrEmpty(searchText))
        {
            songRouletteController.SetSongs(songMetas);
            if (lastSelectedSong != null)
            {
                songRouletteController.SelectSong(lastSelectedSong);
            }
            else if (selectedSongBeforeSearch != null)
            {
                songRouletteController.SelectSong(selectedSongBeforeSearch);
            }
        }
        else
        {
            switch (searchTextInputField.SearchMode)
            {
            case SearchInputField.ESearchMode.BySongTitle:
                DoSearch((songMeta) => songMeta.Title.ToLower().Contains(searchText));
                break;

            case SearchInputField.ESearchMode.ByArtist:
                DoSearch((songMeta) => songMeta.Artist.ToLower().Contains(searchText));
                break;
            }
        }
    }
예제 #2
0
    private void InitSongRoulette()
    {
        songRouletteController.SetSongs(songMetas);
        if (sceneData.SongMeta != null)
        {
            songRouletteController.SelectSong(sceneData.SongMeta);
        }

        songRouletteController.Selection.Subscribe(newValue => OnNewSongSelection(newValue));
    }
예제 #3
0
    public void UpdateFilteredSongs()
    {
        songRouletteController.SetSongs(GetFilteredSongMetas());

        // Indicate filtered playlist via font style of song count
        songCountText.fontStyle = playlistSlider.SelectedItem == null || playlistSlider.SelectedItem is UltraStarAllSongsPlaylist
            ? FontStyles.Normal
            : FontStyles.Underline;
    }
예제 #4
0
    void Start()
    {
        sceneData = SceneNavigator.Instance.GetSceneData(CreateDefaultSceneData());

        searchTextInputField = GameObjectUtils.FindObjectOfType <SearchInputField>(true);

        songMetas = SongMetaManager.Instance.SongMetas;
        List <PlayerProfile> playerProfiles = PlayerProfileManager.Instance.PlayerProfiles;

        PopulatePlayerProfileList(playerProfiles);

        songRouletteController = FindObjectOfType <SongRouletteController>();
        songRouletteController.SongSelectSceneController = this;
        songRouletteController.SetSongs(songMetas);
        if (sceneData.SongMeta != null)
        {
            songRouletteController.SelectSong(sceneData.SongMeta);
        }
    }
예제 #5
0
 public void UpdateFilteredSongs()
 {
     songRouletteController.SetSongs(GetFilteredSongMetas());
 }