Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tobey.SnapBuilder/ControlHint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<KeyCode> keyCodes) => string.Join(" + ", keyCodes.Select(keyCode => GetDisplayText(keyCode)));
Expand All @@ -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<KeyCode> 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));
Expand Down
3 changes: 2 additions & 1 deletion Tobey.SnapBuilder/Patches/BuilderPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down