diff --git a/Blackout/BlackoutController.cs b/Blackout/BlackoutController.cs index d4faf30..150afd3 100644 --- a/Blackout/BlackoutController.cs +++ b/Blackout/BlackoutController.cs @@ -59,7 +59,7 @@ public class BlackoutController : MonoBehaviour Sleeping, } - private GameObject activeModeCam; + private Camera activeModeCam; private Quaternion oldHeadRotation = Quaternion.identity; private float angularMovement = 0f; private float curTime = 0f; @@ -114,6 +114,10 @@ public class BlackoutController : MonoBehaviour blackoutGO.name = "BlackoutInstance"; blackoutAnimator = blackoutGO.GetComponent(); SetupBlackoutInstance(); + + //we dont want this to ever disable (unless in awake state maybe? + Camera.onPreRender += OnPreRender; + Camera.onPostRender += OnPostRender; } //Automatic State Change @@ -151,20 +155,16 @@ public class BlackoutController : MonoBehaviour { curTime = Time.time; lastAwakeTime = curTime; - Camera.onPreRender += OnPreRender; - Camera.onPostRender += OnPostRender; } void OnDisable() { ChangeBlackoutState(BlackoutState.Awake); - Camera.onPreRender -= OnPreRender; - Camera.onPostRender -= OnPostRender; } void OnPreRender(Camera cam) { - if (cam != activeModeCam.GetComponent()) return; + if (cam == activeModeCam) return; blackoutAnimator.transform.localScale = Vector3.zero; } @@ -175,7 +175,7 @@ public class BlackoutController : MonoBehaviour public void SetupBlackoutInstance() { - activeModeCam = PlayerSetup.Instance.GetActiveCamera(); + activeModeCam = PlayerSetup.Instance.GetActiveCamera().GetComponent(); blackoutAnimator.transform.parent = activeModeCam.transform; blackoutAnimator.transform.localPosition = Vector3.zero; blackoutAnimator.transform.localRotation = Quaternion.identity; diff --git a/Blackout/Main.cs b/Blackout/Main.cs index 03badb4..e1ac4a4 100644 --- a/Blackout/Main.cs +++ b/Blackout/Main.cs @@ -23,8 +23,8 @@ public class Blackout : MelonMod m_entryDropFPSOnSleep = m_categoryBlackout.CreateEntry("Lower FPS While Sleep", false, description: "Lowers FPS to 5 while in Sleep State."); m_entryDrowsyThreshold = m_categoryBlackout.CreateEntry("Drowsy Threshold", 1f, description: "Degrees of movement to return partial vision."); m_entryAwakeThreshold = m_categoryBlackout.CreateEntry("Awake Threshold", 12f, description: "Degrees of movement to return full vision."); - m_entryDrowsyModeTimer = m_categoryBlackout.CreateEntry("Enter Drowsy Time", 3f, description: "How many minutes without movement until enter drowsy mode."); - m_entrySleepModeTimer = m_categoryBlackout.CreateEntry("Enter Sleep Time", 10f, description: "How many seconds without movement until enter sleep mode."); + m_entryDrowsyModeTimer = m_categoryBlackout.CreateEntry("Enter Drowsy Time (Minutes)", 3f, description: "How many minutes without movement until enter drowsy mode."); + m_entrySleepModeTimer = m_categoryBlackout.CreateEntry("Enter Sleep Time (Seconds)", 10f, description: "How many seconds without movement until enter sleep mode."); m_entryDrowsyDimStrength = m_categoryBlackout.CreateEntry("Drowsy Dim Strength", 0.5f, description: "How strong of a dimming effect should drowsy mode have."); m_categoryBlackout.SaveToFile(false); diff --git a/Blackout/Properties/AssemblyInfo.cs b/Blackout/Properties/AssemblyInfo.cs index 6757bc4..f50fc51 100644 --- a/Blackout/Properties/AssemblyInfo.cs +++ b/Blackout/Properties/AssemblyInfo.cs @@ -25,6 +25,6 @@ using System.Reflection; namespace Blackout.Properties; internal static class AssemblyInfoParams { - public const string Version = "1.0.2"; + public const string Version = "1.0.3"; public const string Author = "NotAKidoS"; } \ No newline at end of file diff --git a/Blackout/format.json b/Blackout/format.json index 464b644..0455ec4 100644 --- a/Blackout/format.json +++ b/Blackout/format.json @@ -1,7 +1,7 @@ { "_id": 106, "name": "Blackout", - "modversion": "1.0.2", + "modversion": "1.0.3", "gameversion": "2022r169p1", "loaderversion": "0.5.5", "modtype": "Mod", @@ -16,8 +16,8 @@ "requirements": [ "None" ], - "downloadlink": "https://github.com/NotAKidOnSteam/Blackout/releases/download/r3/Blackout.dll", + "downloadlink": "https://github.com/NotAKidOnSteam/Blackout/releases/download/r4/Blackout.dll", "sourcelink": "https://github.com/NotAKidOnSteam/Blackout/", - "changelog": "Fix render queue of sleep mode. Made effect 2x bigger to accommodate extreme FOV & avatar scale. Attempt to render only in active camera.", + "changelog": "Fixed rendering in every camera other than player camera. Should now behave in both automatic and manual modes.", "embedcolor": "#161b22" } \ No newline at end of file