Skip to content

Commit

Permalink
Cover some eedge case for grid menu.
Browse files Browse the repository at this point in the history
isadorasophia committed Nov 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 258bc7c commit c08f470
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Murder/Core/Input/PlayerInput.cs
Original file line number Diff line number Diff line change
@@ -596,6 +596,14 @@ public bool GridMenu(ref MenuInfo currentInfo, int width, int _, int size, GridM
{
int sign = Math.Sign(axis.Value.X) < 0 ? -1 : 1;
int newOption = currentInfo.NextAvailableOption(currentInfo.Selection, sign);

if (newOption == selectedOptionIndex)
{
// in the very drastic scenario that all options are not enabled, just go to whatever
// next visible item is.
newOption = Calculator.WrapAround(newOption + 1, newOption, currentInfo.VisibleItems);
}

currentInfo.Select(newOption, Game.NowUnscaled);
}

0 comments on commit c08f470

Please sign in to comment.