From a69a4699ff753109663e05145890768e0980e239 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 11:42:49 +0000 Subject: [PATCH] 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). --- Source/UI/Lists/UIListBox.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Source/UI/Lists/UIListBox.cpp b/Source/UI/Lists/UIListBox.cpp index 223356b20..95954d984 100644 --- a/Source/UI/Lists/UIListBox.cpp +++ b/Source/UI/Lists/UIListBox.cpp @@ -270,10 +270,11 @@ void UIListBox::Refresh() { UIScrollBar* bar = this->verticalBar; if (overflow != 0) { bar->maximum = this->bottomMargin + overflow; + bar->total = static_cast(this->lines.size()); } else { bar->maximum = 0; + bar->total = static_cast(this->lines.size()); } - bar->total = static_cast(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: {