Skip to content

Commit

Permalink
Maximum cope fix for SS2O music incompat
Browse files Browse the repository at this point in the history
  • Loading branch information
Moffein committed Oct 4, 2024
1 parent be28552 commit 0a332c8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 7 deletions.
6 changes: 6 additions & 0 deletions Starstorm 2/Components/NemesisMusicController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ private void StartMusic()
StopMusic();
isPlaying = true;
Modules.Music.musicSources++;

if (ModCompat.SS2OCompat.pluginLoaded && soundName == "Play_SS2U_NemesisTheme")
{
soundName = "Play_SS2_Music_System";
}

playID = Util.PlaySound(soundName, base.gameObject);
}

Expand Down
12 changes: 8 additions & 4 deletions Starstorm 2/Modules/SoundBanks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ public static void Init()
SoundAPI.SoundBanks.Add(array);
}

using (Stream manifestResourceStream = new FileStream(SoundBankDirectory + "\\SS2UMusic.bnk", FileMode.Open))
//This check needs to be done because there's a mystery conflict with SS2O music.
if (!ModCompat.SS2OCompat.pluginLoaded)
{
byte[] array = new byte[manifestResourceStream.Length];
manifestResourceStream.Read(array, 0, array.Length);
SoundAPI.SoundBanks.Add(array);
using (Stream manifestResourceStream = new FileStream(SoundBankDirectory + "\\SS2UMusic.bnk", FileMode.Open))
{
byte[] array = new byte[manifestResourceStream.Length];
manifestResourceStream.Read(array, 0, array.Length);
SoundAPI.SoundBanks.Add(array);
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions Starstorm 2/Starstorm2Release/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`0.21.6`

- Attempted to fix incompat with SS2 Official music.
- This is done by not loading SS2U's music soundbank if SS2O is loaded.

`0.21.5`

- Updated autoconfig to match latest SS2 Official plugin GUID.
Expand Down
Binary file modified Starstorm 2/Starstorm2Release/VideogameMod2Unofficial.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion Starstorm 2/Starstorm2Release/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Videogame_Mod_2_Unofficial",
"version_number": "0.21.5",
"version_number": "0.21.6",
"website_url": "https://github.com/Moffein/Starstorm2Unofficial",
"description": "A restoration of the pre-SotV Videogame Mod 2. Compatible with the official Videogame Mod 2!",
"dependencies": [
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions Starstorm 2/StarstormPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class StarstormPlugin : BaseUnityPlugin
{
internal const string guid = "com.ChirrLover.Starstorm2Unofficial";
internal const string modName = "Starstorm 2 Unofficial";
internal const string version = "0.21.5";
internal const string version = "0.21.6";

public static StarstormPlugin instance;

Expand Down Expand Up @@ -91,7 +91,6 @@ public void Awake()
{
Modules.Files.PluginInfo = Info;
LanguageTokens.RegisterLanguageTokens();
Modules.SoundBanks.Init();
scepterPluginLoaded = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter");
classicItemsLoaded = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.ThinkInvisible.ClassicItems");
kingArenaLoaded = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.Kingpinush.KingKombatArena");
Expand All @@ -100,6 +99,7 @@ public void Awake()
blightedElitesLoaded = BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.Moffein.BlightedElites");
if (BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ScrollableLobbyUI")) scrollableLobbyInstalled = true;
ModCompat.Initialize();
Modules.SoundBanks.Init();

if (kingArenaLoaded)
{
Expand Down

0 comments on commit 0a332c8

Please sign in to comment.