1
0
Fork 0

Fix: Don't (briefly) switch from title-only playlist on menu screen.

Switching playlist while on the menu screen now only changes the playlist
that will be used when out of the menu screen.
pull/10560/head
Peter Nelson 2023-03-08 11:20:50 +00:00 committed by PeterN
parent 3b90b85439
commit e999aa2923
1 changed files with 12 additions and 10 deletions

View File

@ -147,18 +147,20 @@ void MusicSystem::ChangePlaylist(PlaylistChoices pl)
{ {
assert(pl < PLCH_MAX && pl >= PLCH_ALLMUSIC); assert(pl < PLCH_MAX && pl >= PLCH_ALLMUSIC);
this->displayed_playlist = this->standard_playlists[pl]; if (pl != PLCH_THEMEONLY) _settings_client.music.playlist = pl;
this->active_playlist = this->displayed_playlist;
this->selected_playlist = pl;
this->playlist_position = 0;
if (this->selected_playlist != PLCH_THEMEONLY) _settings_client.music.playlist = this->selected_playlist; if (_game_mode != GM_MENU || pl == PLCH_THEMEONLY) {
this->displayed_playlist = this->standard_playlists[pl];
this->active_playlist = this->displayed_playlist;
this->selected_playlist = pl;
this->playlist_position = 0;
if (_settings_client.music.shuffle) { if (_settings_client.music.shuffle) {
this->Shuffle(); this->Shuffle();
/* Shuffle() will also Play() if necessary, only start once */ /* Shuffle() will also Play() if necessary, only start once */
} else if (_settings_client.music.playing) { } else if (_settings_client.music.playing) {
this->Play(); this->Play();
}
} }
InvalidateWindowData(WC_MUSIC_TRACK_SELECTION, 0); InvalidateWindowData(WC_MUSIC_TRACK_SELECTION, 0);