Skip to content

Commit

Permalink
Fix freeze in H scene
Browse files Browse the repository at this point in the history
  • Loading branch information
DeathWeasel1337 committed Feb 19, 2022
1 parent 8401753 commit b19ad48
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/FadeAdjuster.Core/FadeAdjuster.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace KK_Plugins
{
Expand All @@ -14,7 +16,9 @@ public class FadeAdjuster : BaseUnityPlugin
public const string GUID = "com.deathweasel.bepinex.fadeadjuster";
public const string PluginName = "Fade Adjuster";
public const string PluginNameInternal = "KK_FadeAdjuster";
public const string Version = "1.0.1";
public const string Version = "1.0.2";

internal static new ManualLogSource Logger;

#if KK
private static bool UpdateColor;
Expand All @@ -25,7 +29,7 @@ public class FadeAdjuster : BaseUnityPlugin

private void Awake()
{
Logger.LogInfo($"Awake");
Logger = base.Logger;
DisableFade = Config.Bind("Config", "Disable Fade", false, "Disables fade on loading screens");
FadeColor = Config.Bind("Config", "Fade Color", Color.white, "Color of loading screens");
#if KK
Expand Down Expand Up @@ -69,6 +73,10 @@ private static void SceneFadeCanvasSetColor(ref Color _color)
[HarmonyPrefix, HarmonyPatch(typeof(FadeCanvas), nameof(FadeCanvas.StartAysnc))]
private static void SceneFadeCanvasSetColor(ref float duration)
{
Scene scene = SceneManager.GetActiveScene();
if (scene.buildIndex == -1)
return;

if (DisableFade.Value)
duration = 0f;
}
Expand Down

0 comments on commit b19ad48

Please sign in to comment.