diff --git a/Source/Contents/PlayerNameDictionary.cpp b/Source/Contents/PlayerNameDictionary.cpp index 31f4a2d..8837db0 100644 --- a/Source/Contents/PlayerNameDictionary.cpp +++ b/Source/Contents/PlayerNameDictionary.cpp @@ -11,6 +11,10 @@ CPlayerNameDictionary::CPlayerNameDictionary(PlayerNameContext& context) : m_enabled(true), m_context(&context) { } +// INLINED +CPlayerNameDictionary::CPlayerNameDictionary() : m_enabled(true), m_context(nullptr) { +} + // OFFSET: 0x0060A9D0 // OFFSET: 0x0060AAE0 // FUNCTION: fn_04256 @@ -90,3 +94,23 @@ void CPlayerNameDictionary::Update() { return; } } + +// GLOBAL: gl_24677 +CPlayerNameDictionary* g_playerNameDictionary = nullptr; + +// OFFSET: 0x0060AE30 + +// OFFSET: 0x0060AF90 +// FUNCTION: fn_04260 +void DestroyPlayerNameDictionary() { + if (g_playerNameDictionary) { + delete g_playerNameDictionary; + g_playerNameDictionary = nullptr; + } +} + +// OFFSET: 0x0060AFB0 +// FUNCTION: fn_04261 +std::string LookupPlayerName(std::uint32_t id) { + return g_playerNameDictionary->Lookup(id); +} diff --git a/Source/Contents/PlayerNameDictionary.h b/Source/Contents/PlayerNameDictionary.h index 99edb98..2d704e1 100644 --- a/Source/Contents/PlayerNameDictionary.h +++ b/Source/Contents/PlayerNameDictionary.h @@ -19,6 +19,7 @@ struct PlayerNameContext { class CPlayerNameDictionary { public: + CPlayerNameDictionary(); explicit CPlayerNameDictionary(PlayerNameContext& context); virtual ~CPlayerNameDictionary(); std::string Lookup(std::uint32_t id); @@ -53,4 +54,10 @@ private: static_assert(sizeof(CPlayerNameDictionary) == 60); #endif +extern CPlayerNameDictionary* g_playerNameDictionary; + +bool CreatePlayerNameDictionary(); +void DestroyPlayerNameDictionary(); +std::string LookupPlayerName(std::uint32_t id); + #endif