From c6a5dfd45df00906ab562561d9e71f35eb4aba44 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 04:43:13 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Buttons/UITextButton.cpp, Source/UI/Lists/UITreeView.h Batch #4735 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_11538 UITreeView::Resize: logic confirmed by peer review - fn_11516 UITreeView::Slot53: logic confirmed by peer review Peer-reviewed-by: alisonrag, youko Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Buttons/UITextButton.cpp | 27 +++++++++++++++++++++++++++ Source/UI/Lists/UITreeView.h | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 96623564..3d7f7677 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -1010,6 +1010,33 @@ void UITreeView::Slot35(int value) { } } +// OFFSET: 0x00897A10 +// FUNCTION: fn_11538 +void UITreeView::Resize(int width, int height) { + UIWindow::Resize(width, height); + this->verticalBar->Move(this->geometry.width - 10, 0); + this->verticalBar->Resize(this->verticalBar->geometry.width, height); + this->Slot53(); +} + +// OFFSET: 0x008961F0 +// FUNCTION: fn_11516 +void UITreeView::Slot53() { + const int visible = this->geometry.height / this->itemHeight; + const int count = this->itemCount; + const int excess = count - visible; + const int overflow = excess < 0 ? 0 : excess; + this->verticalOverflow = overflow != 0; + this->verticalBar->SetRange(overflow, visible, count); + + if (!overflow) { + this->unknown_00A8 = 0; + this->itemCount = 0; + } + + this->verticalBar->Invalidate(); +} + // OFFSET: 0x00892F90 // FUNCTION: fn_11502 void UITabControl::FillTab(int index, int x, int y, int width, int height, std::uint32_t color) { diff --git a/Source/UI/Lists/UITreeView.h b/Source/UI/Lists/UITreeView.h index 9df49741..ae746b11 100644 --- a/Source/UI/Lists/UITreeView.h +++ b/Source/UI/Lists/UITreeView.h @@ -7,10 +7,12 @@ class UIScrollBar; class UITreeView : public UIWindow { public: + void Resize(int width, int height) override; void Slot25(int x, int y) override; void Slot27(int x, int y) override; void Slot31(int x, int y) override; void Slot35(int value) override; + virtual void Slot53(); protected: /* 007C */ UIScrollBar* verticalBar; @@ -19,7 +21,10 @@ protected: /* 0088 */ int unknown_0088; /* 008C */ int unknown_008C; /* 0090 */ int unknown_0090; - /* 0094 */ unsigned char unknown_0094[0x18]; + /* 0094 */ unsigned char unknown_0094[0xC]; + /* 00A0 */ int itemHeight; + /* 00A4 */ int itemCount; + /* 00A8 */ int unknown_00A8; /* 00AC */ unsigned char unknown_00AC; };