| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using Il2Cpp;
- using MelonLoader;
- using UnityEngine;
- namespace AudioMgr
- {
-
- [HarmonyLib.HarmonyPatch(typeof(AuroraActivatedToggle), "SetState", new Type[] { typeof(AuroraActivatedToggleState) })]
- public class TurnOnPatch
- {
- public static bool Prefix(ref AuroraActivatedToggle __instance, ref AuroraActivatedToggleState state)
- {
- if (Settings.options.customRadioMusic && RadioMaster.auroraClipManager.clipCount > 0)
- {
- if (state == AuroraActivatedToggleState.On)
- {
- if (GameManager.GetAuroraManager().AuroraIsActive() || (!GameManager.GetAuroraManager().AuroraIsActive() && Settings.options.radioWorksWithoutAurora))
- {
-
- RadioMaster.StartQueue(__instance.gameObject);
- __instance.m_ToggleState = state;
- return false;
- }
- }
- }
- if (state == AuroraActivatedToggleState.Off)
- {
- RadioMaster.StopQueue(__instance.gameObject);
- __instance.m_ToggleState = state;
- return true;
- }
- return true;
- }
- }
- [HarmonyLib.HarmonyPatch(typeof(AuroraManager), "AuroraAudioSetIntensityRTPC")]
- public class TempAuroraMusicPatch
- {
- public static bool Prefix(ref AuroraManager __instance)
- {
- return false;
- }
- }
- /*
- [HarmonyLib.HarmonyPatch(typeof(AuroraActivatedToggle), "Update")]
- public class LightingPatch
- {
- public static bool Prefix(ref AuroraActivatedToggle __instance)
- {
- if (Settings.options.customRadioMusic && Settings.options.radioWorksWithoutAurora)
- {
- __instance.m_RequiresAuroraField = false;
- return false;
- }
- return true;
- }
- }
- [HarmonyLib.HarmonyPatch(typeof(AuroraActivatedToggle), "ShouldEnableChildren")]
- public class ShouldEnableEffectPatch
- {
- public static void Postfix(ref AuroraActivatedToggle __instance, ref bool __result)
- {
- if (Settings.options.customRadioMusic && Settings.options.radioWorksWithoutAurora && RadioMaster.auroraClipManager.clipCount > 0)
- {
- __result = true;
- }
- }
- }
- */
- }
|