add new implementation event

This commit is contained in:
2025-04-18 14:49:33 +03:00
parent 1081fa70a7
commit d6470893ac
12 changed files with 200 additions and 122 deletions

View File

@@ -6,14 +6,14 @@ namespace example
{
void ui_layer::on_attach()
{
VE::CONNECT(this);
CONNECT(this);
hack::log()("on_attach");
}
void ui_layer::on_detach()
{
VE::DISCONNECT(this);
DISCONNECT();
hack::log()("on_detach");
}
@@ -26,20 +26,7 @@ namespace example
VE_PUSH_FONT(REGULAR, 20);
if (ImGui::Button("Test signal", ImVec2(128, 130)))
VE::EMIT(test_event::TEST_EVEN, std::string("test event message"), 1, "event MSG");
// try
// {
// if (ImGui::Button("Test signal log error", ImVec2(128, 130)))
// VE::EMIT(test_event::TEST_EVEN, std::string("test event message"));
// }
// catch(hack::exception& e)
// {
// e.log();
// auto data = std::any_cast<VE::event>(e.get_data());
// hack::log()(data.m_id);
// }
EMIT(test_event::TEST_EVEN, std::string("test event message"), 1);
VE_POP_FONT();

View File

@@ -4,7 +4,7 @@
namespace example
{
class ui_layer : public VE::layer, public VE::flags
class ui_layer : public VE::layer, public VE::flags, public VE::connector
{
VE_OVERIDE();

View File

@@ -6,14 +6,14 @@ namespace example
{
void ui_layer_double::on_attach()
{
VE::CONNECT(this);
CONNECT(this);
hack::log()("on_attach");
}
void ui_layer_double::on_detach()
{
VE::DISCONNECT(this);
DISCONNECT();
hack::log()("on_detach");
}
@@ -26,7 +26,7 @@ namespace example
VE_PUSH_FONT(REGULAR, 20);
if (ImGui::Button("Test signal_double", ImVec2(128, 130)))
VE::EMIT(test_event::TEST_EVEN, std::string("test event message ui_layer_double"));
EMIT(test_event::TEST_EVEN, std::string("test event message ui_layer_double"));
if (ImGui::Button("Test on_detach", ImVec2(128, 130))) on_detach();
if (ImGui::Button("Test on_attach", ImVec2(128, 130))) on_attach();

View File

@@ -4,7 +4,7 @@
namespace example
{
class ui_layer_double : public VE::layer, public VE::flags
class ui_layer_double : public VE::layer, public VE::flags, public VE::connector
{
VE_OVERIDE();