add msg to emit

This commit is contained in:
2025-04-18 14:01:51 +03:00
parent 51c19a0c54
commit e419793cd3
3 changed files with 6 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ namespace VE
}
template <typename TYPE, typename DATA>
void EMIT(TYPE t, DATA d, int id = -1, std::any msg = "")
void EMIT(TYPE t, DATA d, int id = -1, std::string msg = "")
{
event_manager::instance().emit(event{ t, d, id, msg});
}

View File

@@ -1,17 +1,18 @@
#pragma once
#include <any>
#include <string>
namespace VE
{
struct event
{
event(std::any type, std::any data, int id, std::any msg) : m_type{ type }, m_data{ data }, m_id { id }, m_msg { msg } {}
event(std::any type, std::any data, int id, std::string msg) : m_type{ type }, m_data{ data }, m_id { id }, m_msg { msg } {}
~event() = default;
std::any m_type;
std::any m_data;
int m_id;
std::any m_msg;
std::string m_msg;
};
}

View File

@@ -19,9 +19,9 @@ namespace VE
hack::warn()("funs is empty");
return;
}
else
else if (!e.m_msg.empty())
{
hack::warn()("run emit");
hack::warn()("EMIT MSG:", e.m_msg);
}
std::size_t i = 0;