Skip to content

Commit

Permalink
add support for 0.219.13 (The Bog Witch)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbusseneau committed Oct 31, 2024
1 parent d19b62d commit 6e1f850
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Update Jotunn to 2.20.3.
- Support for 0.219.13 (The Bog Witch).
- Update Jotunn to 2.21.2.

## [0.5.12] - 2024-07-19

Expand Down
4 changes: 2 additions & 2 deletions src/BetterCartographyTable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@

<!-- Packages -->
<ItemGroup>
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.32">
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.34.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="JotunnLib" Version="2.20.3" />
<PackageReference Include="JotunnLib" Version="2.21.2" />
</ItemGroup>

<!-- Translations -->
Expand Down
38 changes: 1 addition & 37 deletions src/Extensions/KeyCode.cs
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.LowLevel;

namespace BetterCartographyTable.Extensions;

public static class KeyCodeExtensions
{
public static string ToKeyHintString(this KeyCode keyCode)
{
var (isMouseButton, mouseButton) = ZInput.KeyCodeToMouseButton(keyCode, logWarning: false);
if (isMouseButton)
{
var mouseString = mouseButton switch
{
MouseButton.Left => "$button_mouse0",
MouseButton.Right => "$button_mouse1",
MouseButton.Middle => "$button_mouse2",
MouseButton.Forward => Mouse.current?.forwardButton.displayName ?? "Mouse Forward",
MouseButton.Back => Mouse.current?.backButton.displayName ?? "Mouse Back",
_ => null,
};
if (mouseString is not null) return mouseString;
}

var key = ZInput.KeyCodeToKey(keyCode, logWarning: false);
return key switch
{
Key.Comma => ",",
Key.Period => ".",
Key.Space => "$button_space",
Key.LeftShift => "$button_lshift",
Key.RightShift => "$button_rshift",
Key.LeftAlt => "$button_lalt",
Key.RightAlt => "$button_ralt",
Key.LeftCtrl => "$button_lctrl",
Key.RightCtrl => "$button_rctrl",
Key.Enter => "$button_return",
Key.NumpadEnter => "$button_return",
Key.None => "$menu_none",
_ => Keyboard.current?[key].displayName ?? key.ToString(),
};
}
public static string ToKeyHintString(this KeyCode keyCode) => ZInput.KeyCodeToDisplayName(keyCode);
}

0 comments on commit 6e1f850

Please sign in to comment.