Skip to content

Commit

Permalink
Fixed item selection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Oct 7, 2024
1 parent 9f2462a commit 97b55fe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Source/stores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,6 @@ void StoreEnter()
}
}

// FIXME: New handling for scrollbar makes item lists without a scrollbar have very specific undesirable behavior.
void CheckStoreButton()
{
const Point uiPosition = GetUIRectangle().position;
Expand Down Expand Up @@ -2163,14 +2162,14 @@ void CheckStoreButton()
if (y >= 5) {
if (y >= BackButtonLine() + 1)
y = BackButtonLine();
if (HasScrollbar() && y <= 20 && !TextLine[y].isSelectable()) {
if (GetItemCount(ActiveStore) > 0 && y <= 20 && !TextLine[y].isSelectable()) {
if (TextLine[y - 2].isSelectable()) {
y -= 2;
} else if (TextLine[y - 1].isSelectable()) {
y--;
}
}
if (TextLine[y].isSelectable() || (HasScrollbar() && y == BackButtonLine())) {
if (TextLine[y].isSelectable() || (GetItemCount(ActiveStore) > 0 && y == BackButtonLine())) {
CurrentTextLine = y;
StoreEnter();
}
Expand Down

0 comments on commit 97b55fe

Please sign in to comment.