From 171e2e078d993afb1428736e402bb41cdb19dd41 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 01:56:56 +0000 Subject: [PATCH] Decompile 4 functions in Source/UI/Lists/UIScrollBar.cpp, Source/UI/Buttons/UITextButton.cpp, ... Batch #4232 by eAthena: 0 byte-identical, 4 confirmed by peer review. - fn_11527 UIChatHisBox::Resize: logic confirmed by peer review - fn_11528 UIComboBox::Resize: logic confirmed by peer review - fn_11541 UIBmpRadioBtn::SendMsg: logic confirmed by peer review - fn_11542 UIChatHisBox::SendMsg: logic confirmed by peer review Peer-reviewed-by: Yommy, youko Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Buttons/UIBmpRadioBtn.h | 1 + Source/UI/Buttons/UITextButton.cpp | 24 ++++++++++++++++++++++++ Source/UI/Lists/UIChatHisBox.h | 2 ++ Source/UI/Lists/UIComboBox.h | 1 + Source/UI/Lists/UIScrollBar.cpp | 23 +++++++++++++++++++++++ 5 files changed, 51 insertions(+) diff --git a/Source/UI/Buttons/UIBmpRadioBtn.h b/Source/UI/Buttons/UIBmpRadioBtn.h index dc9d53b3..6a1bb1ff 100644 --- a/Source/UI/Buttons/UIBmpRadioBtn.h +++ b/Source/UI/Buttons/UIBmpRadioBtn.h @@ -11,6 +11,7 @@ class UIBmpRadioBtn : public UIWindow { public: void Slot25(int x, int y) override; void Slot28(int x, int y) override; + int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; protected: /* 007C */ unsigned char unknown_007C[0x60]; diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index a09e0508..7b6a5829 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -561,6 +561,30 @@ void UIItemMoveInfo::Slot48() { this->Invalidate(); } +// OFFSET: 0x008974A0 +// FUNCTION: fn_11528 +void UIComboBox::Resize(int width, int height) { + UIListBox::Resize(width, height); + this->topLine = 0; + this->verticalBar->position = this->topLine; + if (this->verticalOverflow) { + this->verticalBar->Move(width - 13, 0); + this->verticalBar->Invalidate(); + } else { + this->verticalBar->Move(width - 13, 0); + } +} + +// OFFSET: 0x00897BF0 +// FUNCTION: fn_11541 +int UIBmpRadioBtn::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { + if (message == 13) { + this->geometry.unknown_0030 = static_cast(argument1); + this->Invalidate(); + } + return 0; +} + // OFFSET: 0x00892060 // FUNCTION: fn_11463 void UIComboBox::Slot27(int x, int y) { diff --git a/Source/UI/Lists/UIChatHisBox.h b/Source/UI/Lists/UIChatHisBox.h index cf5757c3..2041bf20 100644 --- a/Source/UI/Lists/UIChatHisBox.h +++ b/Source/UI/Lists/UIChatHisBox.h @@ -8,10 +8,12 @@ class UIChatHisBox : public UIListBox { public: + void Resize(int width, int height) override; void Show(int visible) override; void Slot25(int x, int y) override; void Slot26(int x, int y) override; void Slot31(int x, int y) override; + int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; const char* HistoryText(unsigned int index); bool SaveChatLog(const char* path); diff --git a/Source/UI/Lists/UIComboBox.h b/Source/UI/Lists/UIComboBox.h index c8a1325c..2b8fba33 100644 --- a/Source/UI/Lists/UIComboBox.h +++ b/Source/UI/Lists/UIComboBox.h @@ -5,6 +5,7 @@ class UIComboBox : public UIListBox { public: + void Resize(int width, int height) override; void Slot25(int x, int y) override; void Slot26(int x, int y) override; void Slot27(int x, int y) override; diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index 9729b776..b822a28c 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -415,6 +415,29 @@ void UIChatHisBox::Slot25(int x, int y) { void UIChatHisBox::Slot31(int, int) { } +// OFFSET: 0x008973E0 +// FUNCTION: fn_11527 +void UIChatHisBox::Resize(int width, int height) { + UIListBox::Resize(width, height); + if (this->verticalOverflow) { + const int visibleLines = this->geometry.height / this->lineHeight; + this->topLine = static_cast(this->lines.size()) - visibleLines + this->bottomMargin; + this->verticalBar->position = this->topLine; + this->verticalBar->Move(width - 13, 0); + this->verticalBar->Invalidate(); + } else { + this->topLine = 0; + this->verticalBar->position = 0; + this->verticalBar->Move(width - 13, 0); + } +} + +// OFFSET: 0x00897C10 +// FUNCTION: fn_11542 +int UIChatHisBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { + return UIListBox::SendMsg(sender, message, argument1, argument2, argument3, argument4); +} + // OFFSET: 0x0089C340 // FUNCTION: fn_11585 void UIChatHisBox::Show(int visible) {