Batch #12699 by Yommy: 0 byte-identical, 6 confirmed by peer review. - fn_11210 UITextViewer::SplitTextLinkArguments: logic confirmed by peer review - fn_11205 UITextViewer::AddItemLinks: logic confirmed by peer review - fn_11206 UITextViewer::AddNaviLinks: logic confirmed by peer review - fn_11209 UITextViewer::AddQuestLinks: logic confirmed by peer review - fn_11211 UITextViewer::AddTipLinks: logic confirmed by peer review - fn_11212 UITextViewer::AddUrlLinks: logic confirmed by peer review Peer-reviewed-by: Tanke, aDw, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
39 lines
1.6 KiB
C++
39 lines
1.6 KiB
C++
#ifndef RAGNAROK_SOURCE_UI_TEXT_TEXTMARKUP_H
|
|
#define RAGNAROK_SOURCE_UI_TEXT_TEXTMARKUP_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct TextLink {
|
|
/* 0000 */ std::uint32_t position;
|
|
/* 0004 */ std::byte unknown_0004[8];
|
|
/* 000C */ std::string display;
|
|
/* 0024 */ std::string metadata;
|
|
};
|
|
|
|
bool HasTextLinks(const std::string& text);
|
|
std::string ExpandTextEscapes(const std::string& text);
|
|
std::string RemoveTextColors(const char* text);
|
|
const std::string DisplayTextTag(const std::string& source, const std::string& begin, const std::string& end);
|
|
const std::string DisplayItemTextTag(const std::string& text);
|
|
const std::string DisplayNavigationTextTag(const std::string& text);
|
|
const std::string DisplayQuestTextTag(const std::string& text);
|
|
const std::string DisplayTipBoxTextTag(const std::string& text);
|
|
const std::string DisplayUrlTextTag(const std::string& text);
|
|
const std::string RemoveTextLinkInfo(const std::string& source);
|
|
void ExtractTextLinks(const std::string& source, const std::string& begin, const std::string& end, std::vector<TextLink>& links);
|
|
void ExtractNavigationTextLinks(const std::string& text, std::vector<TextLink>& links);
|
|
void ExtractTipBoxTextLinks(const std::string& text, std::vector<TextLink>& links);
|
|
void ExtractUrlTextLinks(const std::string& text, std::vector<TextLink>& links);
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(TextLink) == 60);
|
|
static_assert(offsetof(TextLink, position) == 0x0);
|
|
static_assert(offsetof(TextLink, unknown_0004) == 0x4);
|
|
static_assert(offsetof(TextLink, display) == 0xC);
|
|
static_assert(offsetof(TextLink, metadata) == 0x24);
|
|
#endif
|
|
|
|
#endif
|