diff --git a/AmongUs.props b/AmongUs.props index 16ac51a..8304cb2 100644 --- a/AmongUs.props +++ b/AmongUs.props @@ -1,7 +1,7 @@ - + diff --git a/Reactor.Benchmarks/packages.lock.json b/Reactor.Benchmarks/packages.lock.json index bce5d4f..d915f03 100644 --- a/Reactor.Benchmarks/packages.lock.json +++ b/Reactor.Benchmarks/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2023.6.13, )", - "resolved": "2023.6.13", - "contentHash": "460jLKEZoVY33SlIYEgnV5zE/wEAb5fTxY32ddAV5JI03YmoK+/6D3A6yjpu1HlU/I99Y9s21aKXZY0xan2eSQ==" + "requested": "[2023.7.11, )", + "resolved": "2023.7.11", + "contentHash": "e5zbU+4AYnp1zAQDizO5GRIh1kemkgCa8rFVAcr9bxeupkBu5dwwdHxArWv/pUybIJTZfOPjkOnicZ2qKWLX7g==" }, "BenchmarkDotNet": { "type": "Direct", diff --git a/Reactor.Debugger/packages.lock.json b/Reactor.Debugger/packages.lock.json index 1a9b7ec..6764453 100644 --- a/Reactor.Debugger/packages.lock.json +++ b/Reactor.Debugger/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2023.6.13, )", - "resolved": "2023.6.13", - "contentHash": "460jLKEZoVY33SlIYEgnV5zE/wEAb5fTxY32ddAV5JI03YmoK+/6D3A6yjpu1HlU/I99Y9s21aKXZY0xan2eSQ==" + "requested": "[2023.7.11, )", + "resolved": "2023.7.11", + "contentHash": "e5zbU+4AYnp1zAQDizO5GRIh1kemkgCa8rFVAcr9bxeupkBu5dwwdHxArWv/pUybIJTZfOPjkOnicZ2qKWLX7g==" }, "BepInEx.AutoPlugin": { "type": "Direct", diff --git a/Reactor.Example/packages.lock.json b/Reactor.Example/packages.lock.json index 1a9b7ec..6764453 100644 --- a/Reactor.Example/packages.lock.json +++ b/Reactor.Example/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2023.6.13, )", - "resolved": "2023.6.13", - "contentHash": "460jLKEZoVY33SlIYEgnV5zE/wEAb5fTxY32ddAV5JI03YmoK+/6D3A6yjpu1HlU/I99Y9s21aKXZY0xan2eSQ==" + "requested": "[2023.7.11, )", + "resolved": "2023.7.11", + "contentHash": "e5zbU+4AYnp1zAQDizO5GRIh1kemkgCa8rFVAcr9bxeupkBu5dwwdHxArWv/pUybIJTZfOPjkOnicZ2qKWLX7g==" }, "BepInEx.AutoPlugin": { "type": "Direct", diff --git a/Reactor/Patches/ReactorVersionShower.cs b/Reactor/Patches/ReactorVersionShower.cs index 57917cc..6ed8f2a 100644 --- a/Reactor/Patches/ReactorVersionShower.cs +++ b/Reactor/Patches/ReactorVersionShower.cs @@ -25,11 +25,16 @@ public static class ReactorVersionShower /// public static event Action? TextUpdated; - private static readonly Il2CppSystem.Action _setMainMenuPositionFromAspect = (Action) (aspect => + private static void SetMainMenuPositionFromAspect(float aspectRatio) { if (Text == null) return; - var pos = new Vector3(-1.2287f * aspect + 10.9f, -0.57f, 4.5f); + var pos = new Vector3(-1.2287f * aspectRatio + 10.9f, -0.57f, 4.5f); Text.transform.position = pos; + } + + private static readonly ResolutionManager.ResolutionChangedHandler _resolutionChangedHandler = (Action) ((aspectRatio, _, _, _) => + { + SetMainMenuPositionFromAspect(aspectRatio); }); internal static void Initialize() @@ -57,12 +62,12 @@ internal static void Initialize() if (scene.name == "MainMenu") { - ResolutionManager.add_ResolutionChanged(_setMainMenuPositionFromAspect); - _setMainMenuPositionFromAspect.Invoke(Screen.width / (float) Screen.height); + ResolutionManager.add_ResolutionChanged(_resolutionChangedHandler); + SetMainMenuPositionFromAspect(Screen.width / (float) Screen.height); } else { - ResolutionManager.remove_ResolutionChanged(_setMainMenuPositionFromAspect); + ResolutionManager.remove_ResolutionChanged(_resolutionChangedHandler); var aspectPosition = gameObject.AddComponent(); var distanceFromEdge = new Vector3(10.13f, 2.55f, -1); if (originalAspectPosition.Alignment == AspectPosition.EdgeAlignments.LeftTop) diff --git a/Reactor/packages.lock.json b/Reactor/packages.lock.json index 2a949d4..aed78df 100644 --- a/Reactor/packages.lock.json +++ b/Reactor/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2023.6.13, )", - "resolved": "2023.6.13", - "contentHash": "460jLKEZoVY33SlIYEgnV5zE/wEAb5fTxY32ddAV5JI03YmoK+/6D3A6yjpu1HlU/I99Y9s21aKXZY0xan2eSQ==" + "requested": "[2023.7.11, )", + "resolved": "2023.7.11", + "contentHash": "e5zbU+4AYnp1zAQDizO5GRIh1kemkgCa8rFVAcr9bxeupkBu5dwwdHxArWv/pUybIJTZfOPjkOnicZ2qKWLX7g==" }, "BepInEx.AutoPlugin": { "type": "Direct",