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
This commit is contained in:
ragnarok-clanker 2026-11-02 13:54:26 +00:00
commit 2c331fa7b7

View file

@ -852,6 +852,50 @@ void UIChatEditCtrl::PushHistory() {
}
}
// OFFSET: 0x0086A060
// FUNCTION: fn_10976
void UIWhisperEditCtrl::sub_86A060() {
if (this->Length() == 0) {
this->historyIndex = static_cast<int>(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<int>(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<int>(index);
found = true;
break;
}
}
if (!found) {
this->history.push_back(std::string(this->Text()));
this->historyIndex = static_cast<int>(this->history.size()) - 1;
}
}
if (this->historyIndex == static_cast<int>(this->history.size())) {
this->SetText("");
} else {
this->SetText(this->history[this->historyIndex].c_str());
}
}
// OFFSET: 0x0086A550
// FUNCTION: fn_10977
void UIEditCtrl::MoveCandidateWindow(int x) {