forked from nikita/muzika-gromche
Select new random track groups every time
This commit is contained in:
parent
dfefc06abf
commit
b99e4c1e2c
|
|
@ -6,6 +6,8 @@
|
|||
- Show real Artist & Song info in the config.
|
||||
- Added a new track Yesterday.
|
||||
- Added lyrics to the existing track HighLow.
|
||||
- New random track will be selected every time instead of having the same track all day.
|
||||
- Groupped tracks (verses of the same song) are still played together in a sequence.
|
||||
|
||||
## MuzikaGromche 1337.9001.68 - LocalHost hotfix
|
||||
|
||||
|
|
|
|||
|
|
@ -35,12 +35,8 @@ namespace MuzikaGromche
|
|||
|
||||
private static int GetCurrentSeed()
|
||||
{
|
||||
var seed = 0;
|
||||
var roundManager = RoundManager.Instance;
|
||||
if (roundManager != null && roundManager.dungeonGenerator != null)
|
||||
{
|
||||
seed = roundManager.dungeonGenerator.Generator.ChosenSeed;
|
||||
}
|
||||
var rng = new System.Random(unchecked((int)DateTime.Now.Ticks));
|
||||
var seed = rng.Next();
|
||||
return seed;
|
||||
}
|
||||
|
||||
|
|
@ -2049,11 +2045,6 @@ namespace MuzikaGromche
|
|||
const string IntroAudioGameObjectName = "MuzikaGromcheAudio (Intro)";
|
||||
const string LoopAudioGameObjectName = "MuzikaGromcheAudio (Loop)";
|
||||
|
||||
// Number of times a selected track has been played.
|
||||
// Increases by 1 with each ChooseTrackOnServer call.
|
||||
// Resets on SettingChanged.
|
||||
private int SelectedTrackIndex = 0;
|
||||
|
||||
internal IAudioTrack? CurrentTrack = null;
|
||||
internal BeatTimeState? BeatTimeState = null;
|
||||
internal AudioSource IntroAudioSource = null!;
|
||||
|
|
@ -2145,7 +2136,8 @@ namespace MuzikaGromche
|
|||
|
||||
private void ChooseTrackDeferredDelegate(object sender, EventArgs e)
|
||||
{
|
||||
SelectedTrackIndex = 0;
|
||||
HostSelectableTrack = null;
|
||||
HostSelectableTrackIndex = 0;
|
||||
ChooseTrackDeferred();
|
||||
}
|
||||
|
||||
|
|
@ -2226,13 +2218,25 @@ namespace MuzikaGromche
|
|||
}
|
||||
}
|
||||
|
||||
// Host selected this group of tracks, and
|
||||
private ISelectableTrack? HostSelectableTrack = null;
|
||||
|
||||
// Number of times a selected track has been played.
|
||||
// Increases by 1 with each ChooseTrackOnServer call.
|
||||
// Resets on SettingChanged.
|
||||
private int HostSelectableTrackIndex = 0;
|
||||
|
||||
void ChooseTrackOnServer()
|
||||
{
|
||||
var selectableTrack = Plugin.ChooseTrack();
|
||||
var audioTrack = selectableTrack.SelectTrack(SelectedTrackIndex);
|
||||
Plugin.Log.LogInfo($"ChooseTrackOnServer {selectableTrack.Name} #{SelectedTrackIndex} {audioTrack.Name}");
|
||||
if (HostSelectableTrack == null || HostSelectableTrackIndex >= HostSelectableTrack.Count())
|
||||
{
|
||||
HostSelectableTrack = Plugin.ChooseTrack();
|
||||
HostSelectableTrackIndex = 0;
|
||||
}
|
||||
var audioTrack = HostSelectableTrack.SelectTrack(HostSelectableTrackIndex);
|
||||
Plugin.Log.LogInfo($"ChooseTrackOnServer {HostSelectableTrack.Name} #{HostSelectableTrackIndex} {audioTrack.Name}");
|
||||
SetTrackClientRpc(audioTrack.Name);
|
||||
SelectedTrackIndex += 1;
|
||||
HostSelectableTrackIndex += 1;
|
||||
}
|
||||
|
||||
void ChooseTrackCompat()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
_Add some content to your Inverse teleporter experience on Titan!<sup>1</sup>_
|
||||
|
||||
Muzika Gromche literally means _"crank music louder"_. This mod replaces Jester's winding up and chasing sounds with **a whole library** of timed to the beat and **seamlessly looped** popular energetic songs, combined with various **visual effects**. Song choice is random each day but **synchronized** with clients: everyone in the lobby will vibe to the same tunes, however **vanilla-compatible** client-side playback is also supported.
|
||||
Muzika Gromche literally means _"crank music louder"_. This mod replaces Jester's winding up and chasing sounds with **a whole library** of timed to the beat and **seamlessly looped** popular energetic songs, combined with various **visual effects**. Song choice is random each time but **synchronized** with clients: everyone in the lobby will vibe to the same tunes, however **vanilla-compatible** client-side playback is also supported.
|
||||
|
||||
A demo video is worth a thousand words. Check out what Muzika Gromche does:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue