Ejemplo n.º 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;
            }
        }
    }
Ejemplo n.º 2
0
    private void InitSongRoulette()
    {
        songRouletteController.SetSongs(songMetas);
        if (sceneData.SongMeta != null)
        {
            songRouletteController.SelectSong(sceneData.SongMeta);
        }

        songRouletteController.Selection.Subscribe(newValue => OnNewSongSelection(newValue));
    }
Ejemplo n.º 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;
    }
Ejemplo n.º 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);
        }
    }
Ejemplo n.º 5
0
 public void UpdateFilteredSongs()
 {
     songRouletteController.SetSongs(GetFilteredSongMetas());
 }