Skip to content

Commit

Permalink
Merge pull request #2 from SortaUnknown/unstable
Browse files Browse the repository at this point in the history
Unstable
  • Loading branch information
SortaUnknown authored Apr 9, 2023
2 parents f2bae55 + aaa4d77 commit 94f6036
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
9 changes: 0 additions & 9 deletions modinfo.json

This file was deleted.

24 changes: 4 additions & 20 deletions src/BaseMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace VibeWorld
{
[BepInPlugin("HelloThere.VibeWorld", "Vibe World", "1.4.2")]
[BepInPlugin("HelloThere.VibeWorld", "Vibe World", "1.5")]
public class BaseMod : BaseUnityPlugin
{
public enum SongMode
Expand Down Expand Up @@ -125,7 +125,7 @@ static void RawUpdatePatch(On.RainWorldGame.orig_RawUpdate orig, RainWorldGame i
}

//Playlist song selector code
if (musicPlayer != null && musicPlayer.song == null && instance.clock > 30)
if (musicPlayer != null && musicPlayer.song == null && instance.clock > 30 && instance.world.rainCycle.RainApproaching > 0.5f)
{
string[] thisRegionList;
string newSong;
Expand Down Expand Up @@ -198,7 +198,6 @@ static void GameCtorPatch(On.RainWorldGame.orig_ctor orig, RainWorldGame instanc
continue;
}
string[] songList = File.ReadAllLines(file);
songList.OrderBy(c => Random.value);
Debug.Log("VibeWorld: Adding: " + file + " songs to list...");
regionSongList.Add(file, songList);
}
Expand All @@ -208,7 +207,6 @@ static void GameCtorPatch(On.RainWorldGame.orig_ctor orig, RainWorldGame instanc
Debug.Log("VibeWorld: General playlist not found! This may cause problems if you are using General Mode.");
generalSongs = calmSongs;
}
generalSongs.OrderBy(c => Random.value);
filesChecked = true;
}

Expand Down Expand Up @@ -251,23 +249,9 @@ public static void AnalyzeRegionMusic(RainWorldGame game, SlugcatStats.Name slug
}
}
}
//tbh i cant remember what this was supposed to accomplish, should clean it up
for (int i = 0; i < songList.Count; i++)
{
if (songList[i] == string.Empty) continue;
string[] checkArray = songList.ToArray();
checkArray[i] = string.Empty;
for (int a = 0; a < checkArray.Length; a++)
{
if (songList[i] == checkArray[a])
{
songList[a] = string.Empty;
}
}
}
//Clean up list, remove empty strings, remove duplicates
songList.RemoveAll(x => x == string.Empty);
intelligentSongs = songList.ToArray();
intelligentSongs.OrderBy(c => Random.value);
intelligentSongs = songList.Distinct().ToArray();
}
}

Expand Down
Binary file removed thumbnail.png
Binary file not shown.

0 comments on commit 94f6036

Please sign in to comment.