Decompile 2 functions in Source/UI/Lists/UIListBox.cpp

Batch #18108 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_11512 UIListBox::Refresh: logic confirmed by peer review
- fn_11552 UIListBox::SendMsg: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, alisonrag, bibinir
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-12 11:42:49 +00:00
commit a69a4699ff

View file

@ -270,10 +270,11 @@ void UIListBox::Refresh() {
UIScrollBar* bar = this->verticalBar;
if (overflow != 0) {
bar->maximum = this->bottomMargin + overflow;
bar->total = static_cast<int>(this->lines.size());
} else {
bar->maximum = 0;
bar->total = static_cast<int>(this->lines.size());
}
bar->total = static_cast<int>(this->lines.size());
bar->visible = visible;
bar->Invalidate();
@ -387,18 +388,6 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s
break;
case UM_DOWNPUSH:
this->selected = (this->selected + 1);
if (this->selected > this->lines.size() - 1) {
this->selected = this->lines.size() - 1;
}
if (this->selected > this->topLine - 1 + this->geometry.height / this->lineHeight) {
this->SendMsg(nullptr, UM_SCROLLVERT, 1, 0, 0, 0);
}
break;
case UM_UPPUSH:
this->selected = (this->selected - 1);
@ -412,6 +401,18 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s
break;
case UM_DOWNPUSH:
this->selected = (this->selected + 1);
if (this->selected > this->lines.size() - 1) {
this->selected = this->lines.size() - 1;
}
if (this->selected > this->topLine - 1 + this->geometry.height / this->lineHeight) {
this->SendMsg(nullptr, UM_SCROLLVERT, 1, 0, 0, 0);
}
break;
case UM_SCROLLVERT:
case UM_SCROLLVERTPAGEUP:
case UM_SCROLLVERTPAGEDOWN: {