Decompile fn_14356 (AdventureGuide::CUIQuestInfo::SetTip)
Batch #8438 by SapitoSucio: 0 byte-identical, 1 confirmed by peer review. - fn_14356 AdventureGuide::CUIQuestInfo::SetTip: logic confirmed by peer review Peer-reviewed-by: eAthena, Toshiro, dori 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
e1c7681499
commit
ca778dce9d
2 changed files with 37 additions and 0 deletions
|
|
@ -952,6 +952,42 @@ void CUIAdventureGuide::Slot16() {
|
|||
g_renewQuestMgr->SendQuestStatusRequest();
|
||||
}
|
||||
|
||||
// OFFSET: 0x009DE7D0
|
||||
// FUNCTION: fn_14356
|
||||
void AdventureGuide::CUIQuestInfo::SetTip(int id) {
|
||||
CUITextViewer* viewer = reinterpret_cast<CUITextViewer*>(this->unknown_00EC);
|
||||
viewer->Clear();
|
||||
|
||||
const TipBoxEntry& tip = g_itemTagOwner->GetTip(id);
|
||||
if (tip.title.empty() || tip.paragraphs.empty()) {
|
||||
viewer->AddLine(std::to_string(id));
|
||||
return;
|
||||
}
|
||||
|
||||
std::string title = tip.title;
|
||||
std::match_results<const char*> match;
|
||||
std::regex_search(title.c_str(), title.c_str() + title.size(), match, std::regex("\\#"));
|
||||
if (!match.empty()) {
|
||||
title = match.prefix().str();
|
||||
}
|
||||
|
||||
const std::string whitespace(" \r\n\t\v\f");
|
||||
title.erase(0, title.find_first_not_of(whitespace));
|
||||
title.erase(title.find_last_not_of(whitespace) + 1);
|
||||
viewer->SetBold(true);
|
||||
viewer->AddLine(title);
|
||||
|
||||
title = tip.paragraphs.front();
|
||||
std::regex_search(title.c_str(), title.c_str() + title.size(), match, std::regex("\n"));
|
||||
if (!match.empty()) {
|
||||
title = match.prefix().str();
|
||||
}
|
||||
title.erase(0, title.find_first_not_of(whitespace));
|
||||
title.erase(title.find_last_not_of(whitespace) + 1);
|
||||
viewer->SetBold(false);
|
||||
viewer->AddLine(title);
|
||||
}
|
||||
|
||||
// OFFSET: 0x009DEBF0
|
||||
// FUNCTION: fn_14357
|
||||
void CUIAdventureGuide::MarkQuest(int questId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue