From 439d33aaffa8b88fd50c8610901caa5c3013c27c Mon Sep 17 00:00:00 2001 From: Ungeziefi <163609976+Ungeziefi@users.noreply.github.com> Date: Tue, 14 Oct 2025 23:36:15 +0200 Subject: [PATCH 1/2] Fix control hint display text and button formatting --- Tobey.SnapBuilder/ControlHint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tobey.SnapBuilder/ControlHint.cs b/Tobey.SnapBuilder/ControlHint.cs index c98b34d..574af77 100644 --- a/Tobey.SnapBuilder/ControlHint.cs +++ b/Tobey.SnapBuilder/ControlHint.cs @@ -14,7 +14,7 @@ internal class ControlHint private static string GetDisplayText(KeyCode keyCode) => Utils.KeyCode.ToString(keyCode) switch { - string name when !string.IsNullOrEmpty(name) => uGUI.GetDisplayTextForBinding(name), + string name when !string.IsNullOrEmpty(name) => name, _ => NoInputAssigned }; private static string GetDisplayText(IEnumerable keyCodes) => string.Join(" + ", keyCodes.Select(keyCode => GetDisplayText(keyCode))); @@ -29,7 +29,7 @@ internal class ControlHint public static string Get(string hint, KeyCode keyCode) => $"{hint} ({FormatButton(keyCode)})"; public static string Get(string hint, KeyCode keyCode1, KeyCode keyCode2) => $"{hint} ({FormatButton(keyCode1)} / {FormatButton(keyCode2)})"; public static string Get(string hint, IEnumerable keyCodes) => $"{hint} ({FormatButton(keyCodes)})"; - public static string Get(string hint, GameInput.Button button) => $"{hint} ({uGUI.FormatButton(button, true, ", ", false)})"; + public static string Get(string hint, GameInput.Button button) => $"{hint} ({GameInput.FormatButton(button, false)})"; public static void Show(string hint, Toggle toggle) => ErrorMessage.AddMessage(Get(hint, toggle)); public static void Show(string hint, KeyCode keyCode) => ErrorMessage.AddMessage(Get(hint, keyCode)); From 4f28e4a236f3f30ef1adad8d42c9ae499c12fb4b Mon Sep 17 00:00:00 2001 From: Ungeziefi <163609976+Ungeziefi@users.noreply.github.com> Date: Tue, 14 Oct 2025 23:51:40 +0200 Subject: [PATCH 2/2] Use list of null keys for safety --- Tobey.SnapBuilder/Patches/BuilderPatch.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tobey.SnapBuilder/Patches/BuilderPatch.cs b/Tobey.SnapBuilder/Patches/BuilderPatch.cs index 29b88d7..6cb5696 100644 --- a/Tobey.SnapBuilder/Patches/BuilderPatch.cs +++ b/Tobey.SnapBuilder/Patches/BuilderPatch.cs @@ -119,7 +119,8 @@ public static void SetPlaceOnSurfacePostfix(RaycastHit hit, ref Vector3 position [HarmonyPrefix, HarmonyWrapSafe] public static void EndResetConstructablesPrefix() { - foreach (var key in ConstructablePatch.constructableDistances.Keys.Where(k => k == null)) + var nullKeys = ConstructablePatch.constructableDistances.Keys.Where(k => k == null).ToList(); + foreach (var key in nullKeys) { ConstructablePatch.constructableDistances.Remove(key); }