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).
This commit is contained in:
ragnarok-clanker 2026-10-30 18:36:24 +00:00
commit 86285f8cf0
2 changed files with 55 additions and 0 deletions

View file

@ -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<std::vector<UINaviLinkButton*>> naviLinks;
/* 00E4 */ std::vector<int> unknown_00E4;

View file

@ -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<unsigned int>(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<unsigned int>(this->unknown_00E4.size()) / 2;
for (int index = 0; index < static_cast<int>(half); ++index) {
this->unknown_00E4[index] = this->unknown_00E4[index + half];
}
this->unknown_00E4.resize(half);
half = static_cast<unsigned int>(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<unsigned int>(this->lines.size()) / 2;
std::list<std::vector<UINaviLinkButton*>>::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<UINaviLinkButton*> buttons;
buttons.swap(*row);
row = this->naviLinks.erase(row);
}
}