rodecomp/Source/UI/UIScrollWnd.cpp
ragnarok-clanker 3e8c4f3253 Decompile 5 functions in Source/UI/UIScrollWnd.cpp, Source/UI/UIScrollWnd.h, ...
Batch #3536 by eAthena: 1 byte-identical, 4 confirmed by peer review.

- fn_13772 UIScrollWnd::~UIScrollWnd: logic confirmed by peer review
- fn_13783 UIScrollWnd::Slot15: logic confirmed by peer review
- fn_13784 UIScrollWnd::Slot35: logic confirmed by peer review
- fn_13786 UIScrollWnd::Clear: byte-identical
- fn_13787 UIScrollWnd::RemoveChild: logic confirmed by peer review

Peer-reviewed-by: Yommy, meitogi, superintelligence
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
Adds to the build: Source/UI/UIScrollWnd.cpp
2026-10-29 22:45:52 +00:00

58 lines
1.6 KiB
C++

#include "UI/UIScrollWnd.h"
#include "UI/Lists/UIScrollBar.h"
// OFFSET: 0x009AC2B0
// FUNCTION: fn_13772
UIScrollWnd::~UIScrollWnd() {
if (this->horizontalBar) {
this->RemoveChild(this->horizontalBar, 0);
delete this->horizontalBar;
this->horizontalBar = nullptr;
}
if (this->scrollBar) {
this->RemoveChild(this->scrollBar, 0);
delete this->scrollBar;
this->scrollBar = nullptr;
}
}
// OFFSET: 0x009AD3A0
// FUNCTION: fn_13783
void UIScrollWnd::Slot15(int width, int height) {
this->horizontalBar = new UIScrollBar(*this->m_context);
this->horizontalBar->Configure(0, height - this->scrollBarHeight, 0, width - this->scrollBarWidth);
this->AddChild(this->horizontalBar);
this->scrollBar = new UIScrollBar(*this->m_context);
this->scrollBar->Configure(width - this->scrollBarWidth, 0, 1, height - this->scrollBarHeight);
this->AddChild(this->scrollBar);
}
// OFFSET: 0x009AD4A0
// FUNCTION: fn_13784
void UIScrollWnd::Slot35(int delta) {
if (this->wheelScroll == 1) {
if (delta < 0) {
this->SendMsg(this->scrollBar, 7, 3, 0, 0, 0);
return;
}
this->SendMsg(this->scrollBar, 7, -3, 0, 0, 0);
}
}
// OFFSET: 0x009AD790
// FUNCTION: fn_13786
void UIScrollWnd::Clear() {
this->unknown_009C = 0;
this->scrollPosition = 0;
this->childOrigins.clear();
this->DeleteChildren();
}
// OFFSET: 0x009AD7C0
// FUNCTION: fn_13787
void UIScrollWnd::RemoveChild(UIWindow* child, unsigned char destroy) {
if (this->horizontalBar && this->scrollBar) {
this->childOrigins.erase(child);
}
UIWindow::RemoveChild(child, destroy);
}