Decompile 4 functions in Source/UI/Lists/UIScrollBar.cpp, Source/UI/Lists/UIChatHisBox.h, ...

Batch #1755 by ragnarok-clanker: 0 byte-identical, 4 confirmed by peer review.

- fn_11279 UIListBoxEx::FindLine: logic confirmed by peer review
- fn_11280 UIImgMenu::ItemAt: logic confirmed by peer review
- fn_11284 UITabControl::TabAt: logic confirmed by peer review
- fn_11285 UIChatHisBox::HistoryText: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
This commit is contained in:
ragnarok-clanker 2026-10-28 22:09:42 +00:00
commit b2cd2e3091

View file

@ -321,8 +321,43 @@ void UIScrollBar::Configure(int x, int y, unsigned char vertical, int length) {
}
// OFFSET: 0x00880800
// FUNCTION: fn_11279
int UIListBoxEx::FindLine(const std::string& text) {
const std::string key = text;
auto it = this->lines.begin();
for (; it != this->lines.end(); ++it) {
if (key == it->second.text) {
break;
}
}
return it == this->lines.end() ? -1 : it->first;
}
// OFFSET: 0x00880920
// FUNCTION: fn_11280
int UIImgMenu::ItemAt(int x, int y) {
const int width = this->geometry.width - 3;
if (x < 1 || x >= width || y < 1) {
return -1;
}
const int height = this->geometry.height - 3;
if (y >= height) {
return -1;
}
int size;
int offset;
if (this->horizontal != 0) {
size = width / this->count;
this->itemWidth = size;
offset = x;
} else {
size = height / this->count;
this->itemHeight = size;
offset = y;
}
return std::min(offset / size, this->count - 1);
}
// OFFSET: 0x00880B20
// FUNCTION: fn_11283
@ -331,5 +366,27 @@ int UITabControl::TabCount() {
}
// OFFSET: 0x00880B40
// FUNCTION: fn_11284
int UITabControl::TabAt(int x, int y) {
int offset = x;
if (this->layout == 0 || this->layout == 2) {
offset = y;
}
const int count = this->TabCount();
for (int index = 0; index < count; ++index) {
offset -= this->widths[index];
if (offset < 0) {
return index;
}
}
return -1;
}
// OFFSET: 0x00880BB0
// FUNCTION: fn_11285
const char* UIChatHisBox::HistoryText(unsigned int index) {
if (index < this->history.size() && !this->history[index].empty()) {
return this->history[index].c_str();
}
return nullptr;
}