From 97b55fe15c6bdca958c089e15c986088f0098d7a Mon Sep 17 00:00:00 2001 From: Eric Robinson Date: Sun, 6 Oct 2024 22:16:44 -0400 Subject: [PATCH] Fixed item selection bug --- Source/stores.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/stores.cpp b/Source/stores.cpp index c721603de34..44ad96f907a 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -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; @@ -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(); }