From 86285f8cf0233fb25fc2d2a8a8140f5f335872c4 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 18:36:24 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Lists/UIScrollBar.cpp, Source/UI/Lists/UIChatHisBox.h Batch #6040 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_11257 UIChatHisBox::DropOldestLines: logic confirmed by peer review - fn_11259 UIChatHisBox::ShiftNaviLinks: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Lumen, Snow Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Lists/UIChatHisBox.h | 2 ++ Source/UI/Lists/UIScrollBar.cpp | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/Source/UI/Lists/UIChatHisBox.h b/Source/UI/Lists/UIChatHisBox.h index 028a250d..cb5d719e 100644 --- a/Source/UI/Lists/UIChatHisBox.h +++ b/Source/UI/Lists/UIChatHisBox.h @@ -23,6 +23,8 @@ public: const char* HistoryText(unsigned int index); bool SaveChatLog(const char* path); void PlaceNaviLinks(int line); + void DropOldestLines(); + void ShiftNaviLinks(); /* 00DC */ std::list> naviLinks; /* 00E4 */ std::vector unknown_00E4; diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index bd9ba71a..54e63dec 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -830,3 +830,56 @@ int UITabControl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 this->Invalidate(); return 0; } + +// OFFSET: 0x0087CD70 +// FUNCTION: fn_11257 +void UIChatHisBox::DropOldestLines() { + unsigned int half = static_cast(this->lines.size()) / 2; + for (unsigned int index = 0; index < half; ++index) { + this->lines[index] = this->lines[index + half]; + } + this->lines.erase(this->lines.begin() + half, this->lines.end()); + + half = static_cast(this->unknown_00E4.size()) / 2; + for (int index = 0; index < static_cast(half); ++index) { + this->unknown_00E4[index] = this->unknown_00E4[index + half]; + } + this->unknown_00E4.resize(half); + + half = static_cast(this->history.size()) / 2; + for (unsigned int index = 0; index < half; ++index) { + this->history[index] = this->history[index + half]; + } + this->history.erase(this->history.begin() + half, this->history.end()); + + this->Refresh(); +} + +// OFFSET: 0x0087D080 +// FUNCTION: fn_11259 +void UIChatHisBox::ShiftNaviLinks() { + const unsigned int half = static_cast(this->lines.size()) / 2; + std::list>::iterator row = this->naviLinks.begin(); + while (row != this->naviLinks.end()) { + bool removed = false; + for (unsigned int index = 0; index < row->size(); ++index) { + UINaviLinkButton* button = (*row)[index]; + if (button->geometry.id == 438) { + button->line -= half; + if (button->line < 0) { + removed = true; + this->RemoveChild((*row)[index], 1); + } + } + } + + if (!removed) { + ++row; + continue; + } + + std::vector buttons; + buttons.swap(*row); + row = this->naviLinks.erase(row); + } +}