From 2c331fa7b7c05535ee27d83f3782c89a5bc6cd96 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Mon, 2 Nov 2026 13:54:26 +0000 Subject: [PATCH] Decompile fn_10976 (UIWhisperEditCtrl::sub_86A060) Batch #10001 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_10976 UIWhisperEditCtrl::sub_86A060: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, cremane Reviewed-by: ragnarok-clanker --- Source/UI/Edit/UIEditCtrl.cpp | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index 199cd3a1..5210ce1a 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -852,6 +852,50 @@ void UIChatEditCtrl::PushHistory() { } } +// OFFSET: 0x0086A060 +// FUNCTION: fn_10976 +void UIWhisperEditCtrl::sub_86A060() { + if (this->Length() == 0) { + this->historyIndex = static_cast(this->history.size()); + return; + } + + for (std::size_t index = 0; index < this->history.size(); ++index) { + if (this->history[index] == this->Text()) { + return; + } + } + + if (this->historyIndex == static_cast(this->history.size())) { + if (this->history.size() >= 30) { + --this->historyIndex; + std::move(this->history.begin() + 1, this->history.end(), this->history.begin()); + this->history.pop_back(); + } + this->history.push_back(std::string(this->Text())); + } else { + bool found = false; + for (std::size_t index = 0; index < this->history.size(); ++index) { + if (this->history[index] == this->Text()) { + this->historyIndex = static_cast(index); + found = true; + break; + } + } + + if (!found) { + this->history.push_back(std::string(this->Text())); + this->historyIndex = static_cast(this->history.size()) - 1; + } + } + + if (this->historyIndex == static_cast(this->history.size())) { + this->SetText(""); + } else { + this->SetText(this->history[this->historyIndex].c_str()); + } +} + // OFFSET: 0x0086A550 // FUNCTION: fn_10977 void UIEditCtrl::MoveCandidateWindow(int x) {