Skip to content

Commit

Permalink
Fix error on first launch in newer Beat Saber versions
Browse files Browse the repository at this point in the history
  • Loading branch information
techdiem committed Dec 31, 2022
1 parent 1ed9f9f commit 89bcf8d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
37 changes: 24 additions & 13 deletions MicMuter/Configuration/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,33 @@ internal class PluginConfig
/// </summary>
public virtual void Changed()
{
//Update audio device
MicDeviceUtils.SelectConfiguredMic(MicDeviceID);
//Mute depending on push-to-talk or push-to-mute
if (PTTEnabled) {
MicDeviceUtils.SetMicMute(!PTTInverted);
}

//Toggle mute button screen
if (Plugin.startupReady) {
if (ScreenEnabled) {
MuteButtonWindowController.Instance.ShowMuteWindow();
if (MicDeviceID != "")
{
//Update audio device
MicDeviceUtils.SelectConfiguredMic(MicDeviceID);
//Mute depending on push-to-talk or push-to-mute
if (PTTEnabled)
{
MicDeviceUtils.SetMicMute(!PTTInverted);
}
else if (MuteButtonWindowController.Instance.MuteButtonScreen != null) {
MuteButtonWindowController.Instance.Cleanup();

//Toggle mute button screen
if (Plugin.startupReady)
{
if (ScreenEnabled)
{
MuteButtonWindowController.Instance.ShowMuteWindow();
}
else if (MuteButtonWindowController.Instance.MuteButtonScreen != null)
{
MuteButtonWindowController.Instance.Cleanup();
}
}
}
else
{
Plugin.Log.Warn("Selected Mic ID is empty, is this your first start or did the device ID change?");
}
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions MicMuter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("TechDiem")]
[assembly: AssemblyProduct("MicMuter")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.3")]
[assembly: AssemblyFileVersion("1.3.3")]
[assembly: AssemblyVersion("1.3.4")]
[assembly: AssemblyFileVersion("1.3.4")]
2 changes: 1 addition & 1 deletion MicMuter/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "MicMuter",
"name": "MicMuter",
"author": "TechDiem",
"version": "1.3.3",
"version": "1.3.4",
"description": "Mutes your microphone when ingame",
"gameVersion": "1.19.0",
"dependsOn": {
Expand Down

0 comments on commit 89bcf8d

Please sign in to comment.