-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUI: Add scrolling #118
base: master
Are you sure you want to change the base?
GUI: Add scrolling #118
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feels weird. Like, when you scroll up, and then down, it seems to "continue" scrolling in the direction I was first scrolling in. Maybe it should just instantly set the velocity. Also I think you should add a timeout of a few ms where the world select is just loose (as if you were holding a finger on the scroll area) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is for RolledSelectionList? Problem doesn't appear with ScrolledSelectionList. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, oops... Comment is related to RolledSelectionList. |
||
field_34 -= diff; | ||
field_38 += diff; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should probably rename the unnamed fields that you use, only a suggestion though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with this but I think these classes should be rewritten instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disagree. These classes implement the base of scrollable list views. I don't see how they need to be rewritten.