Skip to content

Commit

Permalink
fix: key hints for left hand items (and unarmed ones ;))
Browse files Browse the repository at this point in the history
  • Loading branch information
sirskunkalot committed Oct 26, 2023
1 parent 57bf3d3 commit cfc5674
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Added a soft dependency to the LocalizationCache mod so that it loads a bit earlier. This has no direct impact on Jötunn
* Fixed the debug mode Jötunn ASCII art
* Fixed AddComponentCopy was setting the name and tag of the Component's GameObject
* Fixed KeyHints for left hand items

## Version 2.14.5
* Fixed GUIManager assets not being properly initialized when later accessed, causing some elements to not show up
Expand Down
14 changes: 13 additions & 1 deletion JotunnLib/Managers/KeyHintManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,19 @@ bool UseCustomKeyHint()
}

// Get the current equipped item name
ItemDrop.ItemData item = Player.m_localPlayer.m_rightItem;
ItemDrop.ItemData item = null;
if (Player.m_localPlayer.m_rightItem != null)
{
item = Player.m_localPlayer.m_rightItem;
}
else if (Player.m_localPlayer.m_leftItem != null && Player.m_localPlayer.m_leftItem.m_shared.m_itemType != ItemDrop.ItemData.ItemType.Torch)
{
item = Player.m_localPlayer.m_leftItem;
}
else if (Player.m_localPlayer.m_unarmedWeapon)
{
item = Player.m_localPlayer.m_unarmedWeapon.m_itemData;
}
if (!(item != null && (item.IsWeapon() || item.m_shared?.m_buildPieces != null)))
{
return false;
Expand Down

0 comments on commit cfc5674

Please sign in to comment.