Skip to content

Commit

Permalink
sort stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Kade-github committed Aug 22, 2023
1 parent 7250c4f commit 7f51980
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions BombRushRadio/BombRushRadio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public void SanitizeSongs()
audios.Remove(tr);
tr.AudioClip.UnloadAudioData();
}

mInstance.musicTrackQueue.currentMusicTracks.Sort((m,m2) => String.Compare(m.Title, m2.Title, StringComparison.Ordinal));
}
}
public IEnumerator LoadAudioFile(string filePath, AudioType type)
Expand Down Expand Up @@ -94,6 +96,7 @@ public IEnumerator LoadAudioFile(string filePath, AudioType type)
if (done == shouldBeDone)
{
Logger.LogInfo("[BRR] Bomb Rush Radio has been loaded!");
audios.Sort((m,m2) => String.Compare(m.Title, m2.Title, StringComparison.Ordinal));
loading = false;
}
}
Expand Down
6 changes: 5 additions & 1 deletion BombRushRadio/MusicPlayer-Patches.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HarmonyLib;
using System;
using HarmonyLib;
using Reptile;
using UnityEngine;

Expand All @@ -15,6 +16,8 @@ static void Prefix(MusicPlayer __instance)
BombRushRadio.mInstance = __instance;

Debug.Log("[BRR] Amount of tracks " + __instance.musicTrackQueue.AmountOfTracks);

bool addedAnything = false;

foreach (MusicTrack track in BombRushRadio.audios)
{
Expand All @@ -23,6 +26,7 @@ static void Prefix(MusicPlayer __instance)
continue;

__instance.musicTrackQueue.currentMusicTracks.Add(track);
addedAnything = true;
}

Debug.Log("[BRR] Line up: ");
Expand Down

0 comments on commit 7f51980

Please sign in to comment.