rodecomp/Source/Contents/Events/SpecialPopupMgr.h
ragnarok-clanker bc33e9427c Confirm fn_09059 (CSpecialPopupMgr::LuaAddMsg)
Batch #17406 by eAthena: 1 byte-identical, 0 confirmed by peer review.

- fn_09059 CSpecialPopupMgr::LuaAddMsg: byte-identical (already on main)

Merged automatically: every function is byte-identical to the original.
2026-11-11 22:28:07 +00:00

64 lines
1.5 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_EVENTS_SPECIALPOPUPMGR_H
#define RAGNAROK_SOURCE_CONTENTS_EVENTS_SPECIALPOPUPMGR_H
#include <map>
#include <string>
#include <vector>
struct lua_State;
// VTABLE: vt_00752
struct PopupData {
// INLINED
PopupData() : m_messageId(0), m_color(0xFFFFFFFF) {
}
virtual ~PopupData() {
}
/* 0004 */ int m_messageId;
/* 0008 */ unsigned int m_color;
/* 000C */ std::vector<std::string> m_descriptions;
};
// VTABLE: vt_00753
class CSpecialPopupMgr {
public:
// INLINED
CSpecialPopupMgr() {
this->m_initialized = true;
}
virtual ~CSpecialPopupMgr() {
}
static bool Create();
static void Destroy();
PopupData* GetPopup(int id);
bool Init();
static int LuaAddDesc(lua_State* state);
static int LuaAddMsg(lua_State* state);
// INLINED
void AddDescription(int id, std::string description) {
this->m_popups[id].m_descriptions.push_back(description);
}
// INLINED
void SetMessage(int id, int messageId, unsigned int color) {
this->m_popups[id].m_messageId = messageId;
this->m_popups[id].m_color = static_cast<unsigned char>(color >> 16) | (static_cast<unsigned char>(color >> 8) << 8) | (static_cast<unsigned char>(color) << 16);
}
/* 0004 */ bool m_initialized;
/* 0008 */ std::map<int, PopupData> m_popups;
};
extern CSpecialPopupMgr* g_specialPopupMgr;
std::string FormatPopupString(const char* format, ...);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(PopupData) == 0x18);
static_assert(sizeof(CSpecialPopupMgr) == 0x10);
#endif
#endif