diff --git a/Source/UI/Text/TextMarkup.cpp b/Source/UI/Text/TextMarkup.cpp index 197748be..dd08b50f 100644 --- a/Source/UI/Text/TextMarkup.cpp +++ b/Source/UI/Text/TextMarkup.cpp @@ -19,6 +19,15 @@ static const std::string g_naviTagBegin = ""; // GLOBAL: gl_24594 static const std::string g_naviTagEnd = ""; +// GLOBAL: gl_25478 +static const std::string g_infoTagBegin = ""; + +// GLOBAL: gl_25479 +static const std::string g_infoTagEnd = ""; + +// GLOBAL: gl_25480 +static const std::string g_itemLinkTagOpen = ""; + // GLOBAL: gl_24595 static const std::string g_itemTagBegin = ""; @@ -33,8 +42,8 @@ static const std::string g_questTagEnd = ""; // OFFSET: 0x00A7CA90 // FUNCTION: fn_16949 -void ExtractNavigationTextLinks(std::string&& text, std::vector& links) { - ExtractTextLinks(std::move(text), g_naviTagBegin, g_naviTagEnd, links); +void ExtractNavigationTextLinks(const std::string& text, std::vector& links) { + ExtractTextLinks(text, g_naviTagBegin, g_naviTagEnd, links); } // GLOBAL: gl_24597 @@ -45,8 +54,8 @@ static const std::string g_tipBoxTagEnd = ""; // OFFSET: 0x00A7D690 // FUNCTION: fn_16951 -void ExtractTipBoxTextLinks(std::string&& text, std::vector& links) { - ExtractTextLinks(std::move(text), g_tipBoxTagBegin, g_tipBoxTagEnd, links); +void ExtractTipBoxTextLinks(const std::string& text, std::vector& links) { + ExtractTextLinks(text, g_tipBoxTagBegin, g_tipBoxTagEnd, links); } // GLOBAL: gl_24591 @@ -57,15 +66,15 @@ static const std::string g_urlTagEnd = ""; // OFFSET: 0x00A7D6B0 // FUNCTION: fn_16952 -void ExtractUrlTextLinks(std::string&& text, std::vector& links) { - ExtractTextLinks(std::move(text), g_urlTagBegin, g_urlTagEnd, links); +void ExtractUrlTextLinks(const std::string& text, std::vector& links) { + ExtractTextLinks(text, g_urlTagBegin, g_urlTagEnd, links); } // OFFSET: 0x00A81A70 // FUNCTION: fn_16980 bool HasTextLinks(const std::string& text) { - return text.find("") != std::string::npos || text.find("") != std::string::npos || text.find("") != std::string::npos || - text.find("") != std::string::npos || text.find("") != std::string::npos || text.find("") != std::string::npos; + return text.find(g_urlTagBegin) != std::string::npos || text.find(g_itemTagBegin) != std::string::npos || text.find(g_tipBoxTagBegin) != std::string::npos || + text.find(g_naviTagBegin) != std::string::npos || text.find(g_itemLinkTagOpen) != std::string::npos || text.find(g_questTagBegin) != std::string::npos; } // OFFSET: 0x008791E0 @@ -202,7 +211,8 @@ std::string RemoveTextLinkInfo(std::string text) { // OFFSET: 0x00A7CAB0 // FUNCTION: fn_16950 -void ExtractTextLinks(std::string text, const std::string& begin, const std::string& end, std::vector& links) { +void ExtractTextLinks(const std::string& source, const std::string& begin, const std::string& end, std::vector& links) { + std::string text = source; auto position = text.find(begin); if (position == std::string::npos) { @@ -224,12 +234,12 @@ void ExtractTextLinks(std::string text, const std::string& begin, const std::str std::string display = tail.substr(0, close); std::string metadata; - const auto info = display.find(""); + const auto info = display.find(g_infoTagBegin); if (info != std::string::npos) { display = tail.substr(0, info); metadata = tail.substr(info + 6); - const auto infoEnd = metadata.find(""); + const auto infoEnd = metadata.find(g_infoTagEnd); if (infoEnd != std::string::npos) { metadata.resize(infoEnd); diff --git a/Source/UI/Text/TextMarkup.h b/Source/UI/Text/TextMarkup.h index 860b9b1c..05ff7cc6 100644 --- a/Source/UI/Text/TextMarkup.h +++ b/Source/UI/Text/TextMarkup.h @@ -23,7 +23,10 @@ std::string DisplayQuestTextTag(const std::string& text); std::string DisplayTipBoxTextTag(const std::string& text); std::string DisplayUrlTextTag(const std::string& text); std::string RemoveTextLinkInfo(std::string text); -void ExtractTextLinks(std::string text, const std::string& begin, const std::string& end, std::vector& links); +void ExtractTextLinks(const std::string& source, const std::string& begin, const std::string& end, std::vector& links); +void ExtractNavigationTextLinks(const std::string& text, std::vector& links); +void ExtractTipBoxTextLinks(const std::string& text, std::vector& links); +void ExtractUrlTextLinks(const std::string& text, std::vector& links); void SplitTextLinkArguments(std::string text, std::vector& arguments); #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index 935c7ad3..5e1d17e9 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -17,6 +17,18 @@ #include #include +// GLOBAL: gl_24664 +static const std::string g_viewerItemTagBegin = ""; + +// GLOBAL: gl_24665 +static const std::string g_viewerItemTagEnd = ""; + +// GLOBAL: gl_24666 +static const std::string g_viewerQuestTagBegin = ""; + +// GLOBAL: gl_24667 +static const std::string g_viewerQuestTagEnd = ""; + // OFFSET: 0x0091B800 // FUNCTION: fn_12605 std::string UINewChatWnd::ConvertChat(std::string text) {