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:
fritzsenpai 2025-09-25 21:48:23 -05:00
parent 16d561eae2
commit 411885873a
1 changed files with 4 additions and 8 deletions

12
game.js
View File

@ -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();