Decompile fn_10771 (UIEditCtrl3::TakePendingText)

Batch #9862 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review.

- fn_10771 UIEditCtrl3::TakePendingText: logic confirmed by peer review

Peer-reviewed-by: KWDev, Montyla, cremane
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-02 03:59:47 +00:00
commit bc80b3741d
2 changed files with 27 additions and 1 deletions

View file

@ -688,7 +688,7 @@ std::string UIEditCtrl3::TakePendingText() {
for (std::size_t i = 0; i < this->pendingText.size(); ++i) {
result.append(this->pendingText[i]);
}
this->pendingText.clear();
this->pendingText.erase(this->pendingText.begin(), this->pendingText.end());
return result;
}
@ -826,6 +826,31 @@ void UIEditCtrlWheel::Slot35(int value) {
}
}
// OFFSET: 0x00869E30
void UIChatEditCtrl::PushHistory() {
if (this->Length() == 0) {
return;
}
if (this->unknown_0140 == static_cast<int>(this->history.size())) {
if (this->history.size() >= static_cast<unsigned>(this->historyLimit)) {
--this->unknown_0140;
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 {
this->history[this->unknown_0140] = this->Text();
}
++this->unknown_0140;
if (this->unknown_0140 == static_cast<int>(this->history.size())) {
this->SetText("");
} else {
this->SetText(this->history[this->unknown_0140].c_str());
}
}
// OFFSET: 0x0086A550
// FUNCTION: fn_10977
void UIEditCtrl::MoveCandidateWindow(int x) {

View file

@ -223,6 +223,7 @@ public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
void InsertItemTag(int tagId);
void InsertItemLink(const ITEM_INFO& item);
void PushHistory();
/* 011C */ std::vector<std::string> history;
/* 0128 */ std::string pending;