private static void OnSongStarted() { if ((PluginConfig.Instance.MultiEnabled && mpconnected) || (PluginConfig.Instance.SingleEnabled && !mpconnected)) { MicDeviceUtils.SetMicMute(true); } }
private static void OnRightGripChange(bool state) { if (PluginConfig.Instance.PTTMode == "R Grip" || (PluginConfig.Instance.PTTMode == "L+R Grip" && ControllersHelper.LeftGripState == state)) { state ^= !PluginConfig.Instance.PTTInverted; MicDeviceUtils.SetMicMute(state); MuteButtonWindowController.Instance.UpdateMutebtn(); } }
private static void OnLeftTriggerChange(bool state) { if (PluginConfig.Instance.PTTMode == "L Trigger" || (PluginConfig.Instance.PTTMode == "L+R Trigger" && ControllersHelper.RightTriggerState == state)) { //XOR state ^= !PluginConfig.Instance.PTTInverted; MicDeviceUtils.SetMicMute(state); MuteButtonWindowController.Instance.UpdateMutebtn(); } }
public void OnApplicationStart() { //Harmony Harmony = new HarmonyLib.Harmony(HarmonyId); Harmony.PatchAll(Assembly.GetExecutingAssembly()); ControllersHelper.Init(); new GameObject("MicMuterController").AddComponent <MicMuterController>(); //Gameplay events to mute/unmute EventMute.Setup(); //Register mod settings menu button BSMLSettings.instance.AddSettingsMenu("MicMuter", "MicMuter.UI.ConfigView.bsml", ConfigView.instance); //Microphone device setup MicDeviceUtils.Setup(); }
public void OnApplicationQuit() { EventMute.Cleanup(); MuteButtonWindowController.Instance.Cleanup(); MicDeviceUtils.SetMicMute(false); }