diff --git a/Source/Contents/TipOfTheDay.cpp b/Source/Contents/TipOfTheDay.cpp new file mode 100644 index 0000000..4917ef1 --- /dev/null +++ b/Source/Contents/TipOfTheDay.cpp @@ -0,0 +1,27 @@ +#include "Contents/TipOfTheDay.h" +#include "Client/Input/InputCharset.h" +#include "Contents/Configuration/ServiceConfiguration.h" +#include "File/File.h" +#include "File/ResourcePath.h" + +#include + +// GLOBAL: gl_24741 +CTipOfTheDay g_tipOfTheDay; + +// GLOBAL: gl_24740 +bool g_tipOfTheDayEnglish; + +// OFFSET: 0x00AE7760 + +// OFFSET: 0x00909CF0 +// FUNCTION: fn_12400 +int CTipOfTheDay::Size() { + if (this->m_bTryLoading == false) { + this->Load(); + } + + return static_cast(this->m_tipList.size()); +} + +// OFFSET: 0x00AE7710 diff --git a/Source/Contents/TipOfTheDay.h b/Source/Contents/TipOfTheDay.h new file mode 100644 index 0000000..c4a6c47 --- /dev/null +++ b/Source/Contents/TipOfTheDay.h @@ -0,0 +1,28 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_TIPOFTHEDAY_H +#define RAGNAROK_SOURCE_CONTENTS_TIPOFTHEDAY_H + +#include +#include +#include + +using StringList = std::vector; + +class CTipOfTheDay { +public: + int Load(); + int Size(); + StringList& GetTip(int index); + + /* 0000 */ bool m_bTryLoading = false; + /* 0004 */ std::vector m_tipList; +}; + +extern CTipOfTheDay g_tipOfTheDay; +extern bool g_tipOfTheDayEnglish; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CTipOfTheDay) == 0x10); +static_assert(offsetof(CTipOfTheDay, m_tipList) == 0x4); +#endif + +#endif diff --git a/data/compile.json b/data/compile.json index 40e10fb..0ed6d92 100644 --- a/data/compile.json +++ b/data/compile.json @@ -436,6 +436,7 @@ "Source/Contents/Store/StoreBackupData.cpp": 4, "Source/Contents/TerrainPathSearch.cpp": 4, "Source/Contents/TipBoxTitles.cpp": 4, + "Source/Contents/TipOfTheDay.cpp": 4, "Source/Contents/UserData/AccountLinkedUserDataLoadAsyncWork.cpp": 4, "Source/Contents/UserData/AccountLinkedUserDataMgr.cpp": 4, "Source/Contents/UserData/AccountLinkedUserDataSaveAsyncWork.cpp": 4,