Batch #1501 by ragnarok-clanker: 2 byte-identical, 0 confirmed by peer review. - fn_09131 CTipBoxMgr::HasImages: byte-identical - fn_09132 CTipBoxMgr::HasSearchResults: byte-identical Merged automatically: every function is byte-identical to the original.
88 lines
2.3 KiB
C++
88 lines
2.3 KiB
C++
#ifndef RAGNAROK_SOURCE_CONTENTS_TIPBOXTITLES_H
|
|
#define RAGNAROK_SOURCE_CONTENTS_TIPBOXTITLES_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct TipBoxImage {
|
|
/* 0000 */ int unknown_0000;
|
|
/* 0004 */ int unknown_0004;
|
|
/* 0008 */ int unknown_0008;
|
|
/* 000C */ int unknown_000C;
|
|
/* 0010 */ int unknown_0010;
|
|
/* 0014 */ int unknown_0014;
|
|
/* 0018 */ float unknown_0018;
|
|
};
|
|
|
|
struct TipBoxEntry {
|
|
TipBoxEntry();
|
|
/* 0000 */ std::string title;
|
|
/* 0018 */ unsigned char unknown_0018;
|
|
/* 001C */ std::string unknown_001C;
|
|
/* 0034 */ unsigned char searchable;
|
|
/* 0038 */ std::vector<std::string> paragraphs;
|
|
/* 0044 */ int unknown_0044;
|
|
/* 0048 */ int unknown_0048;
|
|
/* 004C */ std::vector<TipBoxImage> images;
|
|
};
|
|
|
|
struct TipBoxTitles {
|
|
const std::map<int, TipBoxEntry>& entries;
|
|
const TipBoxEntry& missing;
|
|
const int& maximumId;
|
|
const unsigned short& codePage;
|
|
|
|
std::string Title(int id, std::string* abbreviated, int width) const;
|
|
};
|
|
|
|
class CTipBoxMgr {
|
|
public:
|
|
CTipBoxMgr();
|
|
virtual ~CTipBoxMgr();
|
|
|
|
void AddParagraph(int id, std::string text);
|
|
TipBoxEntry& SelectRandomTip();
|
|
const TipBoxEntry& GetTip(int id) const;
|
|
void Sub7ACF50();
|
|
void RegisterLuaFunctions();
|
|
bool IsLastTip() const;
|
|
bool HasImages() const;
|
|
bool HasSearchResults() const;
|
|
std::vector<int>& Search(std::string& keyword);
|
|
void SelectTip(int id);
|
|
static bool Create();
|
|
static void Destroy();
|
|
|
|
int m_width;
|
|
int m_height;
|
|
int m_maximumId;
|
|
std::map<int, TipBoxEntry> m_entries;
|
|
std::vector<int> m_randomList;
|
|
TipBoxEntry m_currentEntry;
|
|
std::uint32_t unknown_007C[8];
|
|
std::string unknown_009C;
|
|
int unknown_00B4;
|
|
bool m_initialized;
|
|
TipBoxEntry m_missing;
|
|
int unknown_0114;
|
|
int unknown_0118;
|
|
};
|
|
|
|
extern CTipBoxMgr* g_itemTagOwner;
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(TipBoxImage) == 28);
|
|
static_assert(sizeof(TipBoxEntry) == 88);
|
|
static_assert(offsetof(TipBoxEntry, searchable) == 0x34);
|
|
static_assert(offsetof(TipBoxEntry, images) == 0x4C);
|
|
static_assert(sizeof(CTipBoxMgr) == 284);
|
|
static_assert(offsetof(CTipBoxMgr, m_randomList) == 0x18);
|
|
static_assert(offsetof(CTipBoxMgr, m_currentEntry) == 0x24);
|
|
static_assert(offsetof(CTipBoxMgr, unknown_00B4) == 0xB4);
|
|
static_assert(offsetof(CTipBoxMgr, unknown_0114) == 0x114);
|
|
#endif
|
|
|
|
#endif
|