From e7cf6074ff9b8fa04eb44a2ce0044f22efd62d81 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 11 Nov 2026 14:35:00 +0000 Subject: [PATCH] Decompile 3 functions in Source/UI/Text/UITextViewerLinks.cpp Batch #17145 by eAthena: 0 byte-identical, 3 confirmed by peer review. - fn_11205 UITextViewer::AddItemLinks: logic confirmed by peer review - fn_11209 UITextViewer::AddQuestLinks: logic confirmed by peer review - fn_11212 UITextViewer::AddUrlLinks: logic confirmed by peer review Peer-reviewed-by: kyoshi, br4yan Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Text/UITextViewerLinks.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index 9e8b4077b..708023177 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -89,16 +89,15 @@ bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) { } for (unsigned index = 0; index < extracted.size(); ++index) { - const TextLink& link = extracted[index]; auto* button = new UITextButton(); - button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); + button->Configure(extracted[index].display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; - const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(extracted[index].display.c_str(), 0, 0, 12, 0, 0); button->ResizeToTextClipped(width + 1, height); button->m_hoverColor = 0x00FF7864; button->SetId(464); - this->SplitTextLinkArguments(link.metadata, button); - const auto position = this->LinkPosition(link.position, addedLines); + this->SplitTextLinkArguments(extracted[index].metadata, button); + const auto position = this->LinkPosition(extracted[index].position, addedLines); button->m_value = position.first; button->Move(position.second, -100); this->AddChild(button); @@ -238,16 +237,15 @@ bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) { } for (unsigned index = 0; index < extracted.size(); ++index) { - const TextLink& link = extracted[index]; auto* button = new UITextButton(); - button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); + button->Configure(extracted[index].display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; - const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(extracted[index].display.c_str(), 0, 0, 12, 0, 0); button->ResizeToTextClipped(width + 1, height); button->m_hoverColor = 0x00FF7864; button->SetId(539); - this->SplitTextLinkArguments(link.metadata, button); - const auto position = this->LinkPosition(link.position, addedLines); + this->SplitTextLinkArguments(extracted[index].metadata, button); + const auto position = this->LinkPosition(extracted[index].position, addedLines); button->m_value = position.first; button->Move(position.second, -100); this->AddChild(button); @@ -380,20 +378,19 @@ bool UITextViewer::AddUrlLinks(std::string text, unsigned addedLines) { } for (unsigned index = 0; index < extracted.size(); ++index) { - const TextLink& link = extracted[index]; auto* button = new UITextButton(); - button->Configure(link.display.c_str(), 0x00E6A300, 0, 12, 0, 1); + button->Configure(extracted[index].display.c_str(), 0x00E6A300, 0, 12, 0, 1); button->m_hoverColor = 0x00EFB700; button->SetId(437); const int height = button->geometry.height; - const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(extracted[index].display.c_str(), 0, 0, 12, 0, 0); button->ResizeToTextClipped(width + 1, height); parsed = RemoveTextLinkInfo(parsed); - const auto position = this->LinkPosition(link.position, addedLines); + const auto position = this->LinkPosition(extracted[index].position, addedLines); button->m_value = position.first; button->Move(position.second, -100); this->AddChild(button); - this->SplitTextLinkArguments(link.metadata, button); + this->SplitTextLinkArguments(extracted[index].metadata, button); this->links.push_back(button); }