Remove hardcoded built-in music tracks
Simplify MusicManager to use only custom audio files: Changes: 1. MusicManager Constructor: - Initialize tracks array as empty instead of with 4 hardcoded tracks - Custom tracks loaded immediately by loadCustomTracks() - No more built-in vs custom track distinction needed 2. refreshCustomTracks() Method: - Simply clear tracks array since no built-in tracks exist - Reload custom tracks without filtering logic - Cleaner implementation without isBuiltIn property logic Benefits: Music player now shows only user's imported background music Simpler codebase without hardcoded audio references All tracks are treated equally as custom content No need to maintain separate built-in/custom track categories The music player will now be populated entirely from the user's imported background audio files through the audio management system.
This commit is contained in:
parent
16d561eae2
commit
411885873a
12
game.js
12
game.js
|
|
@ -3182,12 +3182,8 @@ class MusicManager {
|
|||
this.currentTrackIndex = this.dataManager.getSetting('music.currentTrack') || 0;
|
||||
this.playHistory = [];
|
||||
|
||||
this.tracks = [
|
||||
{ name: 'Colorful Flowers', file: 'audio/Colorful-Flowers(chosic.com).mp3', isBuiltIn: true },
|
||||
{ name: 'New Beginnings', file: 'audio/New-Beginnings-chosic.com_.mp3', isBuiltIn: true },
|
||||
{ name: 'Storm Clouds', file: 'audio/storm-clouds-purpple-cat(chosic.com).mp3', isBuiltIn: true },
|
||||
{ name: 'Brunch For Two', file: 'audio/Tokyo-Music-Walker-Brunch-For-Two-chosic.com_.mp3', isBuiltIn: true }
|
||||
];
|
||||
// Initialize empty tracks array - custom tracks will be loaded next
|
||||
this.tracks = [];
|
||||
|
||||
// Load and add custom background music
|
||||
this.loadCustomTracks();
|
||||
|
|
@ -3224,8 +3220,8 @@ class MusicManager {
|
|||
}
|
||||
|
||||
refreshCustomTracks() {
|
||||
// Remove existing custom tracks
|
||||
this.tracks = this.tracks.filter(track => track.isBuiltIn);
|
||||
// Clear all tracks since we only have custom tracks now
|
||||
this.tracks = [];
|
||||
|
||||
// Reload custom tracks
|
||||
this.loadCustomTracks();
|
||||
|
|
|
|||
Loading…
Reference in New Issue