using System.Diagnostics.CodeAnalysis; using HarmonyLib; namespace ADOFAIRenderer.Patch.Game; [HarmonyPatch(typeof(scrCamera))] // ReSharper disable once InconsistentNaming public class scrCameraPatch { [HarmonyPrefix] [HarmonyPatch("SetCustomFrameRate")] [SuppressMessage("ReSharper", "InconsistentNaming")] private static bool FixCamRT(scrCamera __instance, bool enable, float frame) { // There is an issue that `mainTexture.Release` triggers even if `mainTexture` is `camRT`, so mod tries to fix it if (enable || __instance.enableCustomFPS != enable) return true; __instance.enableCustomFPS = enable; __instance.frameRate = frame; return false; } }