Added shuffling on user request

This commit is contained in:
lieght
2025-10-14 19:57:07 +02:00
parent 3165ff33b3
commit cb7e3298fd
2 changed files with 6 additions and 3 deletions

View File

@@ -18,10 +18,13 @@ public class MusicManager<T extends AudioResource> implements org.toop.framework
private int playingIndex = 0;
private boolean playing = false;
public MusicManager(List<T> resources) {
public MusicManager(List<T> resources, boolean shuffleMusic) {
this.dispatcher = new JavaFXDispatcher();
this.resources = resources;
createShuffled();
// Shuffle if wanting to shuffle
if (shuffleMusic) createShuffled();
else backgroundMusic.addAll(resources);
// ------------------------------
}
/**