From d60159ae8660d188be93a886e1cdb81517f898d6 Mon Sep 17 00:00:00 2001 From: Alexejhero <32238504+Alexejhero@users.noreply.github.com> Date: Tue, 13 Aug 2024 21:07:03 +0300 Subject: [PATCH 1/5] Update GameLibs to 2024.8.13 --- AmongUs.props | 2 +- Reactor.Benchmarks/packages.lock.json | 6 +++--- Reactor.Debugger/packages.lock.json | 6 +++--- Reactor.Example/packages.lock.json | 6 +++--- Reactor/packages.lock.json | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/AmongUs.props b/AmongUs.props index a72a589..f16a231 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 cd4ff5e..507b3d2 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": "[2024.6.18, )", - "resolved": "2024.6.18", - "contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg==" + "requested": "[2024.8.13, )", + "resolved": "2024.8.13", + "contentHash": "xYZBHQJcwSF5wABtJIZlmpNwZ7jXWafe6vid6/YEWSxpk1fcYLxz42bHSTYcGjpu4wVz1p1ZG/QC4Eu0SbGhrg==" }, "BenchmarkDotNet": { "type": "Direct", diff --git a/Reactor.Debugger/packages.lock.json b/Reactor.Debugger/packages.lock.json index fc4ad1e..6bc3797 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": "[2024.6.18, )", - "resolved": "2024.6.18", - "contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg==" + "requested": "[2024.8.13, )", + "resolved": "2024.8.13", + "contentHash": "xYZBHQJcwSF5wABtJIZlmpNwZ7jXWafe6vid6/YEWSxpk1fcYLxz42bHSTYcGjpu4wVz1p1ZG/QC4Eu0SbGhrg==" }, "BepInEx.AutoPlugin": { "type": "Direct", diff --git a/Reactor.Example/packages.lock.json b/Reactor.Example/packages.lock.json index fc4ad1e..6bc3797 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": "[2024.6.18, )", - "resolved": "2024.6.18", - "contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg==" + "requested": "[2024.8.13, )", + "resolved": "2024.8.13", + "contentHash": "xYZBHQJcwSF5wABtJIZlmpNwZ7jXWafe6vid6/YEWSxpk1fcYLxz42bHSTYcGjpu4wVz1p1ZG/QC4Eu0SbGhrg==" }, "BepInEx.AutoPlugin": { "type": "Direct", diff --git a/Reactor/packages.lock.json b/Reactor/packages.lock.json index d06c335..adeb77a 100644 --- a/Reactor/packages.lock.json +++ b/Reactor/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2024.6.18, )", - "resolved": "2024.6.18", - "contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg==" + "requested": "[2024.8.13, )", + "resolved": "2024.8.13", + "contentHash": "xYZBHQJcwSF5wABtJIZlmpNwZ7jXWafe6vid6/YEWSxpk1fcYLxz42bHSTYcGjpu4wVz1p1ZG/QC4Eu0SbGhrg==" }, "BepInEx.AutoPlugin": { "type": "Direct", From f4f04a1503cd73638b1ba22b95a400fe0cc04fb2 Mon Sep 17 00:00:00 2001 From: Alexejhero <32238504+Alexejhero@users.noreply.github.com> Date: Tue, 13 Aug 2024 21:13:03 +0300 Subject: [PATCH 2/5] Fix ambiguous patch exception --- Reactor/Patches/Fixes/CursorPosPatch.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Reactor/Patches/Fixes/CursorPosPatch.cs b/Reactor/Patches/Fixes/CursorPosPatch.cs index 912ebc2..306b66b 100644 --- a/Reactor/Patches/Fixes/CursorPosPatch.cs +++ b/Reactor/Patches/Fixes/CursorPosPatch.cs @@ -8,7 +8,8 @@ namespace Reactor.Patches.Fixes; /// /// "Fixes" an issue where empty TextBoxes have wrong cursor positions. /// -[HarmonyPatch(typeof(TextMeshProExtensions), nameof(TextMeshProExtensions.CursorPos))] +[HarmonyPatch(typeof(TextMeshProExtensions), nameof(TextMeshProExtensions.CursorPos), typeof(TextMeshPro))] +[HarmonyPatch(typeof(TextMeshProExtensions), nameof(TextMeshProExtensions.CursorPos), typeof(TextMeshPro), typeof(int))] internal static class CursorPosPatch { public static bool Prefix(TextMeshPro self, ref Vector2 __result) From 0171dec1d3a0bae517c2b6d4a05576c495349511 Mon Sep 17 00:00:00 2001 From: Alexejhero <32238504+Alexejhero@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:07:47 +0300 Subject: [PATCH 3/5] Make patch backwards compatible --- Reactor/Patches/Fixes/CursorPosPatch.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Reactor/Patches/Fixes/CursorPosPatch.cs b/Reactor/Patches/Fixes/CursorPosPatch.cs index 306b66b..623bac1 100644 --- a/Reactor/Patches/Fixes/CursorPosPatch.cs +++ b/Reactor/Patches/Fixes/CursorPosPatch.cs @@ -1,4 +1,6 @@ +using System.Collections.Generic; using System.Linq; +using System.Reflection; using HarmonyLib; using TMPro; using UnityEngine; @@ -8,10 +10,14 @@ namespace Reactor.Patches.Fixes; /// /// "Fixes" an issue where empty TextBoxes have wrong cursor positions. /// -[HarmonyPatch(typeof(TextMeshProExtensions), nameof(TextMeshProExtensions.CursorPos), typeof(TextMeshPro))] -[HarmonyPatch(typeof(TextMeshProExtensions), nameof(TextMeshProExtensions.CursorPos), typeof(TextMeshPro), typeof(int))] +[HarmonyPatch] internal static class CursorPosPatch { + public static IEnumerable TargetMethods() + { + return AccessTools.GetDeclaredMethods(typeof(TextMeshProExtensions)).Where(m => m.Name == nameof(TextMeshProExtensions.CursorPos)); + } + public static bool Prefix(TextMeshPro self, ref Vector2 __result) { if (self.textInfo == null || self.textInfo.lineCount == 0 || self.textInfo.lineInfo[0].characterCount <= 0) From 6faea03f56aa7b4f26786db82ae2f0f05f52258b Mon Sep 17 00:00:00 2001 From: Alexejhero <32238504+Alexejhero@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:08:10 +0300 Subject: [PATCH 4/5] Fix free name textbox by not changing it as much I dont care that the text is smaller and no one else cares either --- Reactor/Patches/Miscellaneous/FreeNamePatch.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Reactor/Patches/Miscellaneous/FreeNamePatch.cs b/Reactor/Patches/Miscellaneous/FreeNamePatch.cs index 32070a9..6d97449 100644 --- a/Reactor/Patches/Miscellaneous/FreeNamePatch.cs +++ b/Reactor/Patches/Miscellaneous/FreeNamePatch.cs @@ -35,15 +35,12 @@ public static void Initialize() var textBox = nameText.GetComponent(); textBox.outputText.alignment = TextAlignmentOptions.CenterGeoAligned; textBox.outputText.transform.position = nameText.transform.position; - textBox.outputText.fontSize = 4f; textBox.OnChange.AddListener((Action) (() => { DataManager.Player.Customization.Name = textBox.text; })); textBox.OnEnter = textBox.OnFocusLost = textBox.OnChange; - - textBox.Pipe.GetComponent().fontSize = 4f; })); } From 12d928757a85145ef16d73f97477defa2481ed98 Mon Sep 17 00:00:00 2001 From: Alexejhero <32238504+Alexejhero@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:21:01 +0300 Subject: [PATCH 5/5] Bump patch version --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index c7dd6ec..116e119 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ true - 2.2.0 + 2.2.1 dev NuclearPowered