GUI: Add scrolling

Fixes #107
This commit is contained in:
Er2
2024-04-09 17:11:30 +03:00
parent 0da5a0322a
commit 419f730410
13 changed files with 62 additions and 29 deletions

View File

@@ -97,7 +97,6 @@ void ScrolledSelectionList::renderScrollBackground()
void ScrolledSelectionList::checkInput(int mouseX, int mouseY)
{
int nItems = getNumberOfItems();
if (Mouse::isButtonDown(BUTTON_LEFT))
{
if (float(mouseY) >= field_C && float(mouseY) <= field_10 && abs(mouseY - field_28) > 5)
@@ -276,3 +275,10 @@ void ScrolledSelectionList::setRenderHeader(bool b, int i)
i = 0;
field_48 = i;
}
void ScrolledSelectionList::handleScroll(bool down)
{
float diff = 5.0f * (down ? -1.0f : 1.0f);
field_34 -= diff;
field_38 += diff;
}