Decompile 2 functions in Source/UI/Text/NavigationLink.cpp, Source/UI/Text/NavigationLink.h, ...
Batch #4903 by youko: 0 byte-identical, 2 confirmed by peer review. - fn_10407 NavigationLinkParser::HasLink: logic confirmed by peer review - fn_10408 NavigationLinkParser::ExpandMessages: logic confirmed by peer review Peer-reviewed-by: eAthena, alisonrag, Lumen Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
e699bcba8d
commit
5edd042708
3 changed files with 74 additions and 0 deletions
|
|
@ -164,6 +164,61 @@ static const std::string g_questCloseTag = "</QUEST>";
|
|||
// GLOBAL: gl_24836
|
||||
std::vector<LineFontState> CCreateLineInfo::s_fontStackCache;
|
||||
|
||||
// OFFSET: 0x00832500
|
||||
// FUNCTION: fn_10407
|
||||
bool NavigationLinkParser::HasLink(std::string text) {
|
||||
return text.find(g_naviLinkTag) != std::string::npos || text.find(g_naviLinkCloseTag) != std::string::npos ||
|
||||
text.find(g_itemLinkTag) != std::string::npos || text.find(g_itemLinkCloseTag) != std::string::npos;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00832640
|
||||
// FUNCTION: fn_10408
|
||||
std::string NavigationLinkParser::ExpandMessages(std::string text) {
|
||||
std::string expanded;
|
||||
|
||||
for (;;) {
|
||||
std::string work;
|
||||
if (expanded.empty()) {
|
||||
work = text;
|
||||
} else {
|
||||
work = expanded;
|
||||
}
|
||||
|
||||
const std::size_t begin = work.find(g_messageTag);
|
||||
if (begin == std::string::npos) {
|
||||
return text;
|
||||
}
|
||||
|
||||
work = work.substr(begin + std::strlen(g_messageTag.c_str()));
|
||||
const std::size_t end = work.find(g_messageCloseTag);
|
||||
if (end == std::string::npos) {
|
||||
return text;
|
||||
}
|
||||
|
||||
work = work.substr(0, end);
|
||||
int messageId;
|
||||
if (work.find("MSI_") != std::string::npos) {
|
||||
messageId = FindMessageId(work.c_str());
|
||||
} else {
|
||||
messageId = std::atoi(work.c_str());
|
||||
}
|
||||
|
||||
const std::string message = FormatMessageArguments(work, messageId);
|
||||
work.clear();
|
||||
work = expanded.empty() ? text : expanded;
|
||||
const std::string head = work.substr(0, begin);
|
||||
const std::string tail = work.substr(work.find(g_messageCloseTag) + std::strlen(g_messageCloseTag.c_str()));
|
||||
expanded.clear();
|
||||
expanded += head;
|
||||
expanded += message;
|
||||
expanded += tail;
|
||||
|
||||
if (expanded.find(g_messageTag) == std::string::npos) {
|
||||
return expanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00833160
|
||||
// FUNCTION: fn_10409
|
||||
int DecodeNavigationNumber(std::string value) {
|
||||
|
|
@ -527,6 +582,10 @@ std::size_t CCreateLineInfo::FindTag(std::string text, std::string keyword, bool
|
|||
return text.find(keyword, 0);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00839420
|
||||
|
||||
// OFFSET: 0x00839860
|
||||
|
||||
// OFFSET: 0x00839D60
|
||||
// FUNCTION: fn_10460
|
||||
std::pair<std::string, std::string> CCreateLineInfo::GetLinkTags(int type) {
|
||||
|
|
@ -552,6 +611,8 @@ std::pair<std::string, std::string> CCreateLineInfo::GetLinkTags(int type) {
|
|||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00839FA0
|
||||
|
||||
// OFFSET: 0x0083A180
|
||||
// FUNCTION: fn_10462
|
||||
void CCreateLineInfo::ApplyFont(std::string tag) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue