SHA256
Migrate to C#12
This commit is contained in:
24 files changed
+42
-42
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using ADOFAIRenderer.Core;
|
||||
using ADOFAIRenderer.Util.Audio;
|
||||
using ADOFAIRenderer.Util.Audio.Clip;
|
||||
@@ -206,7 +207,7 @@ public static class AudioSourceIsPlayingPatch
|
||||
{
|
||||
/// <summary>When <see cref="EffectSource.TryGet"/> finds a mapped state, uses it and returns false (Unity is skipped); otherwise returns true.</summary>
|
||||
[HarmonyPrefix]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static bool Prefix(AudioSource __instance, ref bool __result)
|
||||
{
|
||||
if (!EffectSource.TryGet(__instance, out var state, out var now)) return true;
|
||||
@@ -221,7 +222,7 @@ public static class AudioSourceTimeGetterPatch
|
||||
{
|
||||
/// <summary>When <see cref="EffectSource.TryGet"/> finds a mapped state, uses it and returns false (Unity is skipped); otherwise returns true.</summary>
|
||||
[HarmonyPrefix]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static bool Prefix(AudioSource __instance, ref float __result)
|
||||
{
|
||||
if (!EffectSource.TryGet(__instance, out var state, out var now)) return true;
|
||||
@@ -257,7 +258,7 @@ public static class AudioSourceTimeSamplesGetterPatch
|
||||
{
|
||||
/// <summary>When <see cref="EffectSource.TryGet"/> finds a mapped state, uses it and returns false (Unity is skipped); otherwise returns true.</summary>
|
||||
[HarmonyPrefix]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static bool Prefix(AudioSource __instance, ref int __result)
|
||||
{
|
||||
if (!EffectSource.TryGet(__instance, out var state, out var now)) return true;
|
||||
@@ -287,7 +288,7 @@ public static class AudioSourcePitchGetterPatch
|
||||
{
|
||||
/// <summary>When <see cref="EffectSource.TryGet"/> finds a mapped state, uses it and returns false (Unity is skipped); otherwise returns true.</summary>
|
||||
[HarmonyPrefix]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static bool Prefix(AudioSource __instance, ref float __result)
|
||||
{
|
||||
if (!EffectSource.TryGet(__instance, out var state, out _)) return true;
|
||||
|
||||
@@ -28,20 +28,9 @@ public static class CustomFrameRateDeferPatch
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the SetFramerate render timing fix is enabled.
|
||||
/// Active if rendering session has the option enabled, or enabled by default during normal in-game play.
|
||||
/// Active if rendering session has the option enabled.
|
||||
/// </summary>
|
||||
public static bool IsEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
if (RenderManager.IsActive && RenderManager.Instance?.Configuration?.AdvancedConfig != null)
|
||||
{
|
||||
return RenderManager.Instance.Configuration.AdvancedConfig.FixCustomFrameRate;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public static bool IsEnabled => RenderManager.IsActive && RenderManager.Instance.Configuration.AdvancedConfig.FixCustomFrameRate;
|
||||
|
||||
/// <summary>
|
||||
/// Intercepts manual camera render calls from SetCustomFrameRate (Update phase) or CheckUpdateFrameRateScreen
|
||||
|
||||
@@ -16,7 +16,7 @@ public static class DecorationPatch
|
||||
public static bool IsEnabled =>
|
||||
RenderManager.Instance &&
|
||||
RenderManager.Instance.stage >= RenderStage.Load &&
|
||||
RenderManager.Instance.Configuration?.AdvancedConfig?.HideFailedDecorations == true;
|
||||
RenderManager.Instance.Configuration.AdvancedConfig.HideFailedDecorations;
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the given sprite is the default placeholder or not-found sprite of the decoration manager.
|
||||
@@ -46,7 +46,7 @@ public static class DecorationPatch
|
||||
{
|
||||
if (IsPlaceholderSprite(visualDec.spriteRenderer.sprite, manager))
|
||||
{
|
||||
visualDec.SetSprite((Sprite)null!);
|
||||
visualDec.SetSprite(null!);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@ public static class DecorationPatch
|
||||
public static class VisualDecorationSetSpritePatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static void Prefix(scrVisualDecoration __instance, ref Sprite? sprite)
|
||||
{
|
||||
if (!IsEnabled || !sprite) return;
|
||||
|
||||
@@ -44,7 +44,7 @@ public static class scnGamePatch
|
||||
|
||||
var nonTile = RenderManager.Instance &&
|
||||
RenderManager.Instance.stage >= RenderStage.Load &&
|
||||
RenderManager.Instance.Configuration?.AdvancedConfig?.NonTile == true;
|
||||
RenderManager.Instance.Configuration.AdvancedConfig.NonTile;
|
||||
|
||||
if (!nonTile) return;
|
||||
foreach (var floor in scrLevelMaker.instance.listFloors)
|
||||
|
||||
@@ -91,6 +91,7 @@ public static class scrControllerPatch
|
||||
/// <param name="__instance">The game controller.</param>
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("OnLandOnPortal")]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static void PreventWinTextsPostfix(scrController __instance)
|
||||
{
|
||||
if (!RenderManager.IsActive || __instance == null) return;
|
||||
|
||||
@@ -41,6 +41,7 @@ public class scrFloorPatch
|
||||
/// </summary>
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("Start")]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static void ForceEnableOnStart(scrFloor __instance)
|
||||
{
|
||||
if (RenderManager.Instance &&
|
||||
|
||||
Reference in new issue
Block a user