From 9c276a8cdff0117fa0e6ca4b99d6775ac58e59fa Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 13:49:24 +0000 Subject: [PATCH] Decompile fn_11436 (UIComboBoxID::Slot31) Batch #8052 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_11436 UIComboBoxID::Slot31: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, secret, Tanke Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Buttons/UITextButton.cpp | 38 ++++++++++++++++++++++++++++++ Source/UI/Lists/UIListBoxID.h | 1 + 2 files changed, 39 insertions(+) diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index defde439..3ab19324 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -2942,6 +2942,44 @@ void UIComboBox::Slot31(int x, int y) { g_windowMgr.CloseWindow(26); } +// OFFSET: 0x00890C20 +// FUNCTION: fn_11436 +void UIComboBoxID::Slot31(int x, int y) { + int line = -1; + + if (x >= 0 && y >= 0 && x < this->geometry.width && y < this->geometry.height) { + const int index = y / this->lineHeight + this->topLine; + + if (index >= 0 && static_cast(index) < this->lines.size()) { + line = index; + } + } + + this->selected = line; + + if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { + int extra = 0; + const auto found = this->unknown_00C4.find(this->selected); + + if (found != this->unknown_00C4.end()) { + extra = found->second; + } + + target->SendMsg(nullptr, 39, this->lines[this->selected].id, extra, 0, 0); + } else if (this->parent) { + int extra = 0; + const auto found = this->unknown_00C4.find(this->selected); + + if (found != this->unknown_00C4.end()) { + extra = found->second; + } + + this->parent->SendMsg(nullptr, 39, this->lines[this->selected].id, extra, 0, 0); + } + + g_windowMgr.CloseWindow(26); +} + // OFFSET: 0x00892990 // FUNCTION: fn_11480 void UIBasicSkillCtrl::Slot32(int x, int y) { diff --git a/Source/UI/Lists/UIListBoxID.h b/Source/UI/Lists/UIListBoxID.h index 7e4f6de4..52558d6e 100644 --- a/Source/UI/Lists/UIListBoxID.h +++ b/Source/UI/Lists/UIListBoxID.h @@ -56,6 +56,7 @@ public: void Slot25(int x, int y) override; void Slot26(int x, int y) override; void Slot27(int x, int y) override; + void Slot31(int x, int y) override; void Configure(int x, int y, int width, int height, unsigned char transparent) override; int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; void Refresh() override;