Decompile 2 functions in Source/UI/Window/UIControl.cpp, Source/UI/Window/UIControl.h, ...

Batch #5297 by youko: 0 byte-identical, 2 confirmed by peer review.

- fn_14603 CUIHScrollBar::Slot35: logic confirmed by peer review
- fn_14604 CUIHScrollBar::Slot54: logic confirmed by peer review

Peer-reviewed-by: eAthena, Yommy, alisonrag
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 10:09:04 +00:00
commit ffdfd5862b

View file

@ -1278,8 +1278,33 @@ void CUIVScrollBar::SetHidden(int) {
// OFFSET: 0x009EE1B0
// OFFSET: 0x009EE270
// FUNCTION: fn_14603
void CUIHScrollBar::Slot35(int value) {
if (value > 0) {
this->PageDown();
} else {
this->PageUp();
}
}
// OFFSET: 0x009EE290
// FUNCTION: fn_14604
void CUIHScrollBar::Slot54() {
CUIThumb* bar = this->thumb;
float offset;
if (bar->resizable) {
const int length = static_cast<int>((static_cast<float>(this->visible) / static_cast<float>(this->total)) * static_cast<float>(this->trackLength));
bar->Resize(length > 1 ? length : 1, this->geometry.height);
offset = (static_cast<float>(this->trackLength) / static_cast<float>(this->total)) * static_cast<float>(this->position);
} else {
if (this->total - this->visible <= 0) {
bar->Move(this->upButton->geometry.width, 0);
return;
}
offset = static_cast<float>((this->trackLength - bar->geometry.width) * this->position) / static_cast<float>(this->total - this->visible);
}
this->thumb->Move(static_cast<int>(offset + static_cast<float>(this->upButton->geometry.width)), 0);
}
// OFFSET: 0x009EE380