From 027672ad1c7d961192063dbddfd08a5944543145 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 17:49:20 +0000 Subject: [PATCH] Decompile fn_14358 (AdventureGuide::CUIItemInfo::SetDescription) Batch #8433 by SapitoSucio: 0 byte-identical, 1 confirmed by peer review. - fn_14358 AdventureGuide::CUIItemInfo::SetDescription: logic confirmed by peer review Peer-reviewed-by: eAthena, gordaoprogramas, System4z Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index e2ac68b4..8bed2e6a 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -551,6 +551,46 @@ void CUIItemInfo::Slot16() { } // OFFSET: 0x009DEF40 +// FUNCTION: fn_14358 +void CUIItemInfo::SetDescription(int type, const std::vector& description) { + CUITextViewer* viewer = reinterpret_cast(this->unknown_00F0); + viewer->Clear(); + + if (type == 5) { + this->type = 5; + } else if (type == 6) { + this->type = 4; + } + + int lines = 0; + for (const char* value : description) { + if (lines > 6) { + break; + } + + std::string text(value); + bool highlighted = false; + for (std::size_t pos = text.find('^'); pos != std::string::npos; pos = text.find('^', pos + 1)) { + if (pos + 6 < text.size() && text[pos + 1] == '7' && text[pos + 2] == '7' && text[pos + 3] == '7' && + text[pos + 4] == '7' && text[pos + 5] == '7' && text[pos + 6] == '7') { + highlighted = true; + break; + } + } + if (!highlighted) { + continue; + } + + std::regex pattern("\\^000000"); + std::cmatch match; + while (std::regex_search(text.c_str(), text.c_str() + text.size(), match, pattern)) { + viewer->AddLine(match.prefix().str() + match[0].str()); + ++lines; + text = match.suffix().str(); + text.erase(0, text.find_first_not_of(" \r\n\t\v\f")); + } + } +} // OFFSET: 0x009DD210 // FUNCTION: fn_14335